using parkMonitor.entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace parkMonitor.controlPanel
{
    public partial class InitWin : Form
    {
        public InitWin()
        {
            InitializeComponent();
        }

        private void btn_confirm_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确定要初始化系统吗？", "初始化确认", MessageBoxButtons.YesNoCancel);
            if (dr == DialogResult.Yes)
            {
                if (rbtn_1.Enabled)
                {
                    EntityForCore.ins.globalStatus = EntityForCore.ins.ReInit(0);
                }
                else if (rbtn_2.Enabled)
                {
                    EntityForCore.ins.globalStatus = EntityForCore.ins.ReInit(1);
                }
                else if (rbtn_3.Enabled)
                {
                    EntityForCore.ins.globalStatus = EntityForCore.ins.ReInit(2);
                }
                this.Close();
            }
            else if(dr == DialogResult.No)
            {
                this.Close();
            }
        }
    }
}
