using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;
using System.IO;
using System.Globalization;
namespace shop
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

       
                

        private void Form1_Load(object sender, EventArgs e)
        {
            string year, month, day,today;
            PersianCalendar pc = new PersianCalendar();
            year = pc.GetYear(DateTime.Now).ToString();
            month = pc.GetMonth(DateTime.Now).ToString();
            day = pc.GetDayOfMonth(DateTime.Now).ToString();
            today = pc.GetDayOfWeek(DateTime.Now).ToString();



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

            try
            {
                System.Globalization.PersianCalendar p = new System.Globalization.PersianCalendar();
                lbltoday.Text = today.ToString();

                switch (DateTime.Now.DayOfWeek)
                {
                    case DayOfWeek.Friday:
                        lbltoday.Text = "جمعه";
                        break;
                    case DayOfWeek.Monday:
                        lbltoday.Text = "دوشنبه";
                        break;
                    case DayOfWeek.Saturday:
                        lbltoday.Text = "شنبه";
                        break;
                    case DayOfWeek.Sunday:
                        lbltoday.Text = "یکشنبه";
                        break;
                    case DayOfWeek.Thursday:
                        lbltoday.Text = "پنجشنبه";
                        break;
                    case DayOfWeek.Tuesday:
                        lbltoday.Text = "سه شنبه";
                        break;
                    case DayOfWeek.Wednesday:
                        lbltoday.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 پشتيبانگيريازبانكToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void Form1_Enter(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo language = new System.Globalization.CultureInfo("fa-ir");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(language);
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo language = new System.Globalization.CultureInfo("fa-ir");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(language);
        }

        

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        private void buttonItem25_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("آيا مي خواهيد از برنامه خارج شويد؟", "توجه", MessageBoxButtons.YesNo) == DialogResult.Yes)
                Application.Exit();
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        private void vs2012d_Click(object sender, EventArgs e)
        {
            styleManager1.ManagerStyle = eStyle.VisualStudio2012Dark;
            TextWriter tw = new StreamWriter(Application.StartupPath + "\\Style.Htl");
            tw.WriteLine("VisualStudio2012Dark");
            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();

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

        
    }
}
