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 MainTemplate
{
    public partial class frmMain : Form
    {
        RptFolder.frmRepLogs frm1;
        frmRooms frm2;
        frmHotelUsers frm3;
        frmAbout frm4;
        frmCalculator frm5;
        frmRoomTypes frm6;
        frmRoomReserve frm7;
        frmRoomCancelReserve frm8;
        frmRoomTahvil frm9;
        frmTasviehHesab frm10;
        RptFolder.frmRptDaramad frm11;
        frmBackupDB frm12;

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            Class_Register_Logs LogsRegIn = new Class_Register_Logs(this.Text + " is Opened.");
            Class_Day_Lists Cls_Day_Lists = new Class_Day_Lists();
            Statuse_Main.Text = Cls_Day_Lists.CRCompleteShamsiDate;
        }

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

        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Class_Register_Logs LogsRegIn = new Class_Register_Logs(this.Text + " is Closed.");
            Application.Exit();
        }

        private void Timer_Main1001_Tick(object sender, EventArgs e)
        {
            Class_Day_Lists Cls_Day_Lists = new Class_Day_Lists();
            Statuse_Main.Text = Cls_Day_Lists.CRCompleteShamsiDate;
        }

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

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

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

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

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

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

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

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

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

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

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

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