using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Self_Project
{
    public partial class DeleteReserves : Form
    {
        public DeleteReserves()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("آیا رزروهای بین 2 هفته، حذف شود ؟", "حذف رزرو", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "No") return;
            Reserve R = new Reserve();
            R.DeleteReserve(T1.Text, T2.Text);
            MessageBox.Show("رزروهای بین 2 هفته با موفقیت حذف شد", "حذف رزرو", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Close();
        }

        private void T1_SelectedIndexChanged(object sender, EventArgs e)
        {
            T2.Items.Clear();
            int i;
            for (i = Convert.ToInt32(T1.Text); i <= 52; i++)
            {
                T2.Items.Add(i.ToString());
            }
            T2.SelectedIndex = 0;
        }

        private void DeleteReserves_Load(object sender, EventArgs e)
        {
            T1.SelectedIndex = 0;
        }
    }
}