using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Runtime.InteropServices;
using System.IO;

namespace DabirKhane
{
    public partial class Form2 : Form
    {
        public class key
        {
            [DllImport("user32.dll", SetLastError = true)]
            public static extern int LoadKeyboardLayoutA(string pwszKLID, int Flags);
        }
        PersianCalendar cal = new PersianCalendar();
        public groh fGroh = new groh();
   
        public Form2()
        {
            InitializeComponent();
        }

        

        private void e5_Click(object sender, EventArgs e)
        {
            //MessageBox.Show("آیا می خواهید از برنامه خارج شوید", "خروج",MessageBoxButtons.YesNo,MessageBoxIcon.Exclamation);
            Application.Exit();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

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

        private void e4_Click(object sender, EventArgs e)
        {
            toolStripLabel4_Click(sender ,e );
        }

        private void toolStripLabel5_Click(object sender, EventArgs e)
        {
            e5_Click(sender, e);
        }

        private void d1_Click(object sender, EventArgs e)
        {
            Variables.tab = "a";
            SabtErsali frmSabt = new SabtErsali();
            frmSabt.ShowDialog();
        }

        private void g1_Click(object sender, EventArgs e)
        {
            Variables.tab = "g1";
            fGroh.ShowDialog();



        }

        private void j1_Click(object sender, EventArgs e)
        {
            Variables.tab = "j1";
            search frmsearch = new search();
            frmsearch.ShowDialog();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Form2_Load(object sender, EventArgs e)
        {
            Hide();
            key.LoadKeyboardLayoutA("00000429", 1);
            FrmLogin  login = new FrmLogin ();
            if (login.ShowDialog(this)==DialogResult.OK )
                Show();
               
            else
                Application.Exit();
            //if (new Form1().ShowDialog() == DialogResult.OK)
            //    Show();
            //else
            //    Application.Exit();
            
        }

        private void e1_Click(object sender, EventArgs e)
        {
            pass frmpass = new pass();
            frmpass.ShowDialog();
        }

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

        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            e1_Click(sender, e);
        }

        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            e2_Click(sender, e);
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void toolStripLabel6_Click(object sender, EventArgs e)
        {
            Help.ShowHelp(this, @"c:\\windows\\System32\\calc.exe");
        }

        private void g3_Click(object sender, EventArgs e)
        {
            Variables.tab = "g2";
            fGroh.ShowDialog();
           
        }

        private void dafater_Click(object sender, EventArgs e)
        {

        }

        private void toolStripLabel11_Click(object sender, EventArgs e)
        {

        }

        private void Form2_Activated(object sender, EventArgs e)
        {
            saat.Text = DateTime.Now.ToLongTimeString();
            tarikh.Text = cal.GetYear(DateTime.Now).ToString() + "/" + cal.GetMonth(DateTime.Now).ToString() + "/" + cal.GetDayOfMonth(DateTime.Now).ToString();
            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            saat.Text = DateTime.Now.ToLongTimeString();
        }

        private void toolStripLabel12_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
           
        }

        private void toolStripButton9_Click(object sender, EventArgs e)
        {
            //Help.ShowHelp(this, @"c:\\windows\\System32\\calc.exe");
            System.Diagnostics.Process.Start("calc.exe");
        }

        private void button1_Click(object sender, EventArgs e)
        {
           // Form8 frm8 = new Form8();
            //frm8.ShowDialog();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            chap frm8 = new chap();
            frm8.ShowDialog();
        }

        private void l1_Click(object sender, EventArgs e)
        {
            list list = new list();
            list.ShowDialog ();
        }

        private void button1_Click_2(object sender, EventArgs e)
        {

        }

        private void button1_Click_3(object sender, EventArgs e)
        {
            //Form8 fr = new Form8();
            //fr.ShowDialog();
       
        }

        private void d2_Click(object sender, EventArgs e)
        {
            Variables.tab = "b";
            SabtErsali frmSabt = new SabtErsali();
            frmSabt.ShowDialog();
        }

        private void d3_Click(object sender, EventArgs e)
        {
            Variables.tab = "c";
            SabtErsali frmSabt = new SabtErsali();
            frmSabt.ShowDialog();
        }

        private void j2_Click(object sender, EventArgs e)
        {
            Variables.tab = "j2";
            search frmserch = new search();
            frmserch.ShowDialog();
            
        }

        private void e3_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start(Application.StartupPath+"\\Help\\Help.chm");

            
              
        }

     
    }
}
