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 GcDevicePc.CK_UI
{
    public partial class LandIn : Form
    {
        private string user = "admin";
        public static bool Island = false;
        CKVocAnalyzer.NumForm form;
        public LandIn(string userstr)
        {
            InitializeComponent();
            this.ControlBox = false;
            this.user = userstr;
        }
       


        private void button1_Click(object sender, EventArgs e)  //登录系统
        {
            string strpw = DateTime.Now.ToString("HHmm");
            if (textBox1.Text == user && textBox2.Text == strpw)
            {
                Island = true;
            }
            else
            {
                Island = false;
            }

            if (form != null)
            {
                form.Close();
                if (!form.IsDisposed)
                {
                    form.Dispose();
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)  //放弃
        {
            Island = false;
            if (form != null)
            {
                form.Close();
                if (!form.IsDisposed)
                {
                    form.Dispose();
                }
            }
        }

        private void LandIn_Load(object sender, EventArgs e)
        {
            textBox1.Text = user;
        }

        private void textBox2_Click(object sender, EventArgs e)
        {
            form = CKVocAnalyzer.NumForm.GetInstance((TextBox)sender);// new CKVocAnalyzer.NumForm((TextBox)sender);
            form.Icon = this.Icon;
            form.Show();
        }
    }
}
