using HKLib.DB;

namespace HKCardManager
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            Task.Factory.StartNew(() => 
            {
                DbContext.InitTable();
            }); 
        }

        private void 人员录入ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new PersonnelEntry().ShowDialog();
        }

        private void 机构录入ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new InstitutionalEntry().ShowDialog();
        }

        private void 发卡ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new Hairpin().ShowDialog();
        }

        private void 销户ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cancellation cancellation = new Cancellation();
            cancellation.Text = "销户";
            cancellation.ShowDialog();
        }

        private void 挂失ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cancellation cancellation = new Cancellation();
            cancellation.Text = "挂失";
            cancellation.ShowDialog();
        }

        private void 解挂ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cancellation cancellation = new Cancellation();
            cancellation.Text = "解挂";
            cancellation.ShowDialog();
        }

        private void 月餐段汇总表ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
            dailyConsumptionTable.Text = "月餐段汇总表";
            dailyConsumptionTable.ShowDialog();
        }

        private void 计次就餐天消费表ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
            dailyConsumptionTable.Text = "计次就餐天消费表";
            dailyConsumptionTable.ShowDialog();
        }

        private void 计次就餐消费明细表ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
            dailyConsumptionTable.Text = "计次就餐消费明细表";
            dailyConsumptionTable.ShowDialog();
        }

        private void 餐段设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new MealSegmentSet().ShowDialog();
        }
    }
}