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 System.Globalization;

namespace amlak_keshavarzi
{
    public partial class main : DevComponents.DotNetBar.Metro.MetroForm
    {
        public main()
        {
            InitializeComponent();
        }

        private void main_Load(object sender, EventArgs e)
        {
            string year, month, day;

            PersianCalendar pc = new PersianCalendar();
            year = pc.GetYear(DateTime.Now).ToString();
            month = pc.GetMonth(DateTime.Now).ToString();
            day = pc.GetDayOfMonth(DateTime.Now).ToString();

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


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


p.GetYear(DateTime.Now).ToString() + "/" + p.GetMonth(DateTime.Now).ToString("0#") + "/" + p.GetDayOfMonth(DateTime.Now).ToString("0#");

                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, "خطا");
            }

        }

        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();
        }

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

        private void btn_zamin_Click(object sender, EventArgs e)
        {
            zamin z = new zamin();
            z.Show();
            this.Hide();
        }

        private void btn_bagh_Click(object sender, EventArgs e)
        {
            bagh b = new bagh();
            b.Show();
            this.Hide();
        }

        private void btn_hazinehha_Click(object sender, EventArgs e)
        {
            hazineha hh = new hazineha();
            hh.Show();
            this.Hide();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            tajhizat tj = new tajhizat();
            tj.Show();
            this.Hide();
        }

        private void btn_backup_Click(object sender, EventArgs e)
        {
            backuping bk = new backuping();
            bk.Show();
            this.Hide();
        }

        private void btn_report_Click(object sender, EventArgs e)
        {
            reports r = new reports();
            r.Show();
            this.Hide();
        }

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



             
    }
}
