using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;
using System.IO;
using System.Globalization;

namespace check
{
    public partial class Form1 : Form
    {
        PersianCalendar pc = new PersianCalendar();

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            login fl = new login();
            fl.ShowDialog();
            if (fl.Result == false)
            {
                Application.Exit();
            }

            btn_account.Enabled = fl.ch_account;
            btn_bank.Enabled = fl.ch_bank;
            btn_ckeck.Enabled = fl.ch_ckeck;
            btn_ckecklist.Enabled = fl.ch_ckecklist;
            btn_remider.Enabled = fl.ch_remider;
            btn_user.Enabled = fl.ch_users;

            string year, month, day;
            year = pc.GetYear(DateTime.Now).ToString();
            month = pc.GetMonth(DateTime.Now).ToString();
            day = pc.GetDayOfMonth(DateTime.Now).ToString();

            lbl_date.Text = year + "/" + month + "/" + day.ToString();


            try
            {
                lbl_today.Text = pc.GetDayOfMonth(DateTime.Now).ToString();
                switch (DateTime.Now.DayOfWeek)
                {
                    case DayOfWeek.Saturday:
                        lbl_today.Text = "شنبه";
                        break;
                    case DayOfWeek.Sunday:
                        lbl_today.Text = "بکشنبه";
                        break;
                    case DayOfWeek.Monday:
                        lbl_today.Text = "دوشنبه";
                        break;
                    case DayOfWeek.Tuesday:
                        lbl_today.Text = "سه شنبه";
                        break;
                    case DayOfWeek.Wednesday:
                        lbl_today.Text = "چهارشنبه";
                        break;
                    case DayOfWeek.Thursday:
                        lbl_today.Text = "پنج شنبه";
                        break;
                    case DayOfWeek.Friday:
                        lbl_today.Text = "جمعه";
                        break;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "خطا");

            }


            try
            {
                StreamReader sr = new StreamReader(Application.StartupPath + "\\Style.Htl");
                string strstyle = sr.ReadLine().ToString();
                sr.Close();

                switch (strstyle)
                {
                    case "Office2007blue":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2007Blue;
                            break;
                        }
                    case "Office2007silver":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2007Silver;
                            break;
                        }


                    case "Office2007black":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2007Black;
                            break;
                        }

                    case "Office2010blue":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2010Blue;
                            break;
                        }

                    case "Office2010silver":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2010Silver;
                            break;
                        }



                    case "Office2010black":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2010Black;
                            break;
                        }



                    case "Office2013":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2013;
                            break;
                        }


                    case "Office2016":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2016;
                            break;
                        }


                    case "Officemob2014":
                        {
                            styleManager1.ManagerStyle = eStyle.OfficeMobile2014;
                            break;
                        }


                    case "Office2007VistaGlass":
                        {
                            styleManager1.ManagerStyle = eStyle.Office2007VistaGlass;
                            break;
                        }


                    case "VisualStudio2010Blue":
                        {
                            styleManager1.ManagerStyle = eStyle.VisualStudio2010Blue;
                            break;
                        }

                    case "VisualStudio2012Light":
                        {
                            styleManager1.ManagerStyle = eStyle.VisualStudio2012Light;
                            break;
                        }

                    case "VisualStudio2012Dark":
                        {
                            styleManager1.ManagerStyle = eStyle.VisualStudio2012Dark;
                            break;
                        }



                    case "Windows7":
                        {
                            styleManager1.ManagerStyle = eStyle.Windows7Blue;
                            break;
                        }
                }
            }

            catch
            {
                styleManager1.ManagerStyle = eStyle.Office2007Blue;
            }
        }

        private void btn_account_Click(object sender, EventArgs e)
        {
            account a = new account();
            a.ShowDialog();
        }

        private void btn_ckeck_Click(object sender, EventArgs e)
        {
            ckeck ch = new ckeck();
            ch.ShowDialog();
        }

        private void btn_bank_Click(object sender, EventArgs e)
        {
            bank b = new bank();
            b.ShowDialog();
        }

        private void btn_ckecklist_Click(object sender, EventArgs e)
        {
            ckecklist ch = new ckecklist();
            ch.ShowDialog();
        }

        private void btn_remider_Click(object sender, EventArgs e)
        {
            remider r = new remider();
            r.ShowDialog();
           
        }

        private void btn_exit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btn_user_Click(object sender, EventArgs e)
        {
            users u = new users();
            u.ShowDialog();
        }

        private void btn_calc_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("calc");
        }

        private void btn_notepad_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("notepad");
        }

        private void Office2007blue_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2007Blue;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2007Blue");
            tw.Close();
        }

        private void Office2007silver_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2007Silver;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2007Silver");
            tw.Close();
        }

        private void Office2007black_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2007Black;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2007Black");
            tw.Close();
        }

        private void Office2010blue_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2010Blue;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2010Blue");
            tw.Close();
        }

        private void Office2010silver_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2010Silver;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2010Silver");
            tw.Close();
        }

        private void Office2010black_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2010Black;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2010Black");
            tw.Close();
        }

        private void Office2013_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2013;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2013");
            tw.Close();
        }

        private void Office2016_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2016;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2016");
            tw.Close();
        }

        private void Officemob2014_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.OfficeMobile2014;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("OfficeMobile2014");
            tw.Close();
        }

        private void Office2007VistaGlass_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Office2007VistaGlass;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Office2007VistaGlass");
            tw.Close();
        }

        private void VisualStudio2010Blue_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.VisualStudio2010Blue;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("VisualStudio2010Blue");
            tw.Close();
        }

        private void VisualStudio2012Light_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.VisualStudio2012Light;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("VisualStudio2012Light");
            tw.Close();
        }

        private void VisualStudio2012Dark_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.VisualStudio2012Dark;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("VisualStudio2012Dark");
            tw.Close();
        }

        private void Windows7_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.Windows7Blue;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("Windows7");
            tw.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            string hours, minutes, seconds;
            hours = DateTime.Now.TimeOfDay.Hours.ToString();
            minutes = DateTime.Now.TimeOfDay.Minutes.ToString();
            seconds = DateTime.Now.TimeOfDay.Seconds.ToString();

            lbl_time.Text = hours + ":" + minutes + ":" + seconds.ToString();
        }

        private void btn_backup_Click(object sender, EventArgs e)
        {
            backup b = new backup();
            b.ShowDialog();
        }

        private void btn_restore_Click(object sender, EventArgs e)
        {
            restore re = new restore();
            re.ShowDialog();
        }

        private void btn_about_Click(object sender, EventArgs e)
        {
            about ab = new about();
            ab.ShowDialog();
        }
    }
}
