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 RadioLogy
{
    public partial class frmMainMdi : Form
    {
        frmBimar frm1;
        frmService frm2;
        frmBimeDesc frm3;
        frmPaziresh frm4;
        frmPicture frm5;
        frmUserType frm6;
        frmUsersRadioLogy frm7;
        frmUserLogIn frm8;
        frmReportBimar frm9;
        frmReportPaziresh frm10;
        frmReportPicture frm11;
        frmReportUsers frm12;
        frmReportDaramad frm13;
        public frmMainMdi()
        {
            InitializeComponent();
        }

        private void frmMainMdi_Load(object sender, EventArgs e)
        {
            Class_tblLogs LogReg = new Class_tblLogs(this.Text + " فعال گردید.");
            LogReg.UDF_SaveLogToDb();
            toolStripStatusLabel.Text = "وارد شده با : " + Class_GlobalVar.Str_LogedUserName.Trim();
            if (int.Parse(Class_GlobalVar.Str_LogedUserTypeID ) != 1 )
            {
                Mnu_Karbaran_UserType.Visible = false;
                Mnu_Karbaran_InformationUsers.Visible = false;
                Mnu_Gozareshat_InformatinUsers.Visible = false;
            }
            
        }

        private void frmMainMdi_FormClosed(object sender, FormClosedEventArgs e)
        {
            Class_tblLogs LogReg = new Class_tblLogs(this.Text + " بسته شد.");
            LogReg.UDF_SaveLogToDb();
            Application.Exit();
        }

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

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

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

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

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

        //private void aaaToolStripMenuItem_Click(object sender, EventArgs e)
        //{
           

        //}

        //private void Mnu_Parvande_Users_Click(object sender, EventArgs e)
        //{
           
        //}

        private void Mnu_Gozareshat_Logs_Click(object sender, EventArgs e)
        {

        }

        private void Mnu_Gozareshat_Bimar_Click(object sender, EventArgs e)
        {
            if (frm9 == null || frm9.IsDisposed)
            {
                frm9 = new frmReportBimar();
                frm9.MdiParent = this;
                frm9.Show();
            }
            else
            {
                frm9.Activate();
            }
        }
      
        private void Mnu_Karbaran_UserType_Click(object sender, EventArgs e)
        { 
                if (frm6 == null || frm6.IsDisposed)
                {
                    frm6 = new frmUserType();
                    frm6.MdiParent = this;
                    frm6.Show();
                }
                else
                {
                    frm6.Activate();
                }
            }
    
        

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

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

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

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

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

        //private void Mnu_Gozareshat_Daramad_Click(object sender, EventArgs e)
        //{
        //    if (frm13 == null || frm13.IsDisposed)
        //    {
        //        frm13 = new frmReportDaramad();
        //        frm13.MdiParent = this;
        //        frm13.Show();
        //    }
        //    else
        //    {
        //        frm13.Activate();
        //    }
        //}

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

        private void Mnu_Help_About_Click(object sender, EventArgs e)
        {

        }

        private void Mnu_Gozareshat_Daramad_Click(object sender, EventArgs e)
        {

        }

        

      
    }
}
