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.SqlClient;
using System.Drawing.Printing;


namespace amlakyar
{
    public partial class main : Form
    {
        static SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\amlak.mdf;integrated security=true;User Instance=True");
        SqlDataAdapter da = new SqlDataAdapter("", con);
        DataSet ds = new DataSet();
        public main()

        {
            InitializeComponent();
        }

        private void main_Load(object sender, EventArgs e)
        {
           
            lbll.Text = cls_variable.stru;
            if (lbll.Text == "کاربر عادی")
            {
                toolStripButton7.Enabled = false;
                toolStripButton4.Enabled=false;
                toolStripButton5.Enabled = false; 
                StripMenuItem1.Enabled=false ;
                StripMenuItem2.Enabled=false;
                StripMenuItem3.Enabled = false;

            }
            //axShockwaveFlash1.Movie = Application.StartupPath + @"\1.swf";
            timer1.Enabled = true;
            System.Globalization.PersianCalendar pc = new System.Globalization.PersianCalendar();
            DateTime dt = new DateTime();
            dt = DateTime.Now;
            Class_date cdate = new Class_date();
            string date = dt.Year.ToString() + "/" + dt.Month.ToString() + "/" + dt.Day.ToString();

            lb_date.Text = cdate.Shamsi(date);

            
            

            
           
         
        
        }

    

        private void خریدزمینToolStripMenuItem_Click(object sender, EventArgs e)
        {

            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            Frm_Forush vorod1 = new Frm_Forush();
            vorod1.ShowDialog();
        }

        private void خروجToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        

        private void اجارهآپارتمانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }


            frm_gholname_forush vorod18 = new frm_gholname_forush();
            vorod18.ShowDialog();
        }

        
        private void گزارشکلیToolStripMenuItem_Click(object sender, EventArgs e)
        {
            about vorod2 = new about();
            vorod2.ShowDialog();
        }

        private void اجارهمنزلToolStripMenuItem_Click(object sender, EventArgs e)
        {

            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            frm_gholname_rahn_ejare vorod19 = new frm_gholname_rahn_ejare();
            vorod19.ShowDialog();
        }

        private void فروشزمینToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_darkhast_kharid vorod11 = new frm_darkhast_kharid();
            vorod11.ShowDialog();
            toolStripProgressBar1.Enabled = true;
        }

        private void فروشآپارتمانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            frm_dakhast_rahn_ejare vorod12 = new frm_dakhast_rahn_ejare();
            vorod12.ShowDialog();
        }

        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            search vorod15 = new search();
            vorod15.ShowDialog();
        }

        private void گزارشخریدارانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
           
           
            frm_etelat_amlak vorod4 = new frm_etelat_amlak();
            vorod4.ShowDialog();
        }

        private void گزارشاجارههایآپاراتمانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frmgozaresh_amlak_forushe vorod20 = new frmgozaresh_amlak_forushe();
            vorod20.ShowDialog();
        }

       

        private void گزارشپیشخریدمغازهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_modirat_tabaghe vorod5 = new frm_modirat_tabaghe();
            vorod5.ShowDialog();
        }

        private void گزارشکلیخریدارانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_moreriat_mantaghe vorod7 = new frm_moreriat_mantaghe();
            vorod7.ShowDialog();
        }

        private void گزارشپیشخریدآپارتمانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_moderiat_nemaha vorod6 = new frm_moderiat_nemaha();
            vorod6.ShowDialog();
        }

        private void گزارشخریدارانمغازهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            frm_moderiat_saghf vorod9 = new frm_moderiat_saghf();
            vorod9.ShowDialog();
        }

        private void گزارشخریدارانToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_moreriat_ashkal_zamin vorod10 = new frm_moreriat_ashkal_zamin();
            vorod10.ShowDialog();
        }

        private void گزارشخریدارانمنزلToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            
            
            frm_etelat_kharidar_va_foroshande vorod8 = new frm_etelat_kharidar_va_foroshande();
            vorod8.ShowDialog();
        }

       

        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
        }

     
        private void timer2_Tick_1(object sender, EventArgs e)
        {
            timer2.Enabled = true;
            System.Globalization.PersianCalendar pcc = new System.Globalization.PersianCalendar();
            DateTime tm = new DateTime();
            tm = DateTime.Now;
            toolStripStatusLabel8.Text = pcc.GetHour(tm).ToString() + ":" + pcc.GetMinute(tm).ToString() + ":" + pcc.GetSecond(tm).ToString();
        }

       
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            Frm_Forush vorod1 = new Frm_Forush();
            vorod1.ShowDialog();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }


            frm_darkhast_kharid vorod11 = new frm_darkhast_kharid();
            vorod11.ShowDialog();
            toolStripProgressBar1.Enabled = true;
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }

            frm_dakhast_rahn_ejare vorod12 = new frm_dakhast_rahn_ejare();
            vorod12.ShowDialog();
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }


            frm_gholname_forush vorod18 = new frm_gholname_forush();
            vorod18.ShowDialog();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }

            frm_gholname_rahn_ejare vorod19 = new frm_gholname_rahn_ejare();
            vorod19.ShowDialog();
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            search vorod15 = new search();
            vorod15.ShowDialog();
        }

        

        private void گزارشاجارهمنزToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frmgozaresh_kharid vorod22 = new frmgozaresh_kharid();
            vorod22.ShowDialog();
            
            
            
            
        }

        private void گزارشاجارههایمغازهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frmgozaresh_rahn_ejare vorod23 = new frmgozaresh_rahn_ejare();
            vorod23.ShowDialog();


            
        }

        private void راهنمایبرنامهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            Help  vorodH = new Help ();
            vorodH.ShowDialog();
        }

        

            //axShockwaveFlash1.Movie = Application.StartupPath + @"\1.swf";
            //BackgroundImage = axShockwaveFlash1.AllowFullScreen ()   ;
        

        private void مدیریتاعضاToolStripMenuItem_Click(object sender, EventArgs e)
        {
           timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frm_update_user vorod30 = new frm_update_user();
            vorod30.ShowDialog(); 
            
            
            
            
            
        }

        private void لیستقولنامهفروشToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frmgozaresh_gholname_forush vorod31 = new frmgozaresh_gholname_forush();
            vorod31.ShowDialog();


            
        }

        private void لیستقولنامهرهنواجارهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frmgozaresh_gholname_rahn_ejare vorod32 = new frmgozaresh_gholname_rahn_ejare();
            vorod32.ShowDialog();



        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frm_update_user vorod30 = new frm_update_user();
            vorod30.ShowDialog();
        }

        private void toolStripButton8_Click(object sender, EventArgs e)
        {

            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frm_backup vorod70 = new frm_backup();
            vorod70.ShowDialog ();
        }

        private void تهیهنسخهپشتیبانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            toolStripProgressBar1.PerformStep();
            if (toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
            {
                timer1.Enabled = false;
                toolStripProgressBar1.Value = 5;
            }
            toolStripProgressBar1.PerformStep();
            frm_backup vorod37 = new frm_backup();
            vorod37.ShowDialog();
        }

    
    }
}