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;

namespace Morakhassi
{
    public partial class frmMain : Form
    {
        frmRepRokhdadha frm1;
        frmDarsadEdt frm2;
        frmCalculatePrice frm3;

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            this.Text = this.Text + " - "  + " وارد شده با " + Class.Class_Global_Var.ThisLogedUserName;
            Class.Class_Register_Logs _log = new Morakhassi.Class.Class_Register_Logs(this.Text + " Form Is Loaded.");
        }

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Class.Class_Register_Logs _log = new Morakhassi.Class.Class_Register_Logs(this.Text + " Form Is Closed. (App.closed)");
            Application.Exit();
        }

        private void mnuExitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Class.Class_Register_Logs _log = new Morakhassi.Class.Class_Register_Logs(this.Text + " Form Is Closed.");
            Application.Exit();
        }

        private void perSabtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frm2 == null || frm2.IsDisposed)
            {
                frm2 = new frmDarsadEdt();
                frm2.MdiParent = this;
                frm2.Show();
            }
            else
            {
                frm2.Activate();
            }
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("برنامه ارزگذاری املاک");
        }

        private void rokhdadhaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frm1 == null || frm1.IsDisposed)
            {
                frm1 = new frmRepRokhdadha();
                frm1.MdiParent = this;
                frm1.Show();
            }
            else
            {
                frm1.Activate();
            }
        }

        private void mohasebeDarsadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frm3 == null || frm3.IsDisposed)
            {
                frm3 = new frmCalculatePrice();
                frm3.MdiParent = this;
                frm3.Show();
            }
            else
            {
                frm3.Activate();
            }
        }
    }
}
