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;
using ManualSoftwareSystem.lib;

namespace ManualSoftwareSystem
{
    public partial class FrmInspectionWorkInputInspector : Form
    {
        public FrmInspectionWorkInputInspector()
        {
            InitializeComponent();
        }

        private void FrmInspectionWorkInputInspector_Load(object sender, EventArgs e)
        {
            CheckSerialUSB.SerialUSB = CheckSerialUSB.CheckSerialUSBLicense();

            CheckSerialUSBWarning();
        }

        public void CheckSerialUSBWarning()
        {
            if (CheckSerialUSB.SerialUSB == string.Empty)
            {
                MessageBox.Show(this, "Please insert the USB key.",
                                       "Warning", MessageBoxButtons.OK,
                                       MessageBoxIcon.Exclamation,
                                       MessageBoxDefaultButton.Button1, 0);

                Application.Exit();
            }
            else if (CheckSerialUSB.SerialUSB == "Get")
            {
                MessageBox.Show(this, "Not correct",
                                       "Warning", MessageBoxButtons.OK,
                                       MessageBoxIcon.Exclamation,
                                       MessageBoxDefaultButton.Button1, 0);
                Application.Exit();
            }
        }
    }
}
