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 = globaldata.UserName;
        private string superuser = "superadmin";
        public static bool Island = false;
        public static bool Issa = false;
        private string dt;
        CKVocAnalyzer.NumForm form;
        public LandIn(string userstr,string pwd)
        {
            InitializeComponent();
            this.ControlBox = false;
            this.user = userstr;
            this.dt = pwd;
        }
       


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

            if (textBox1.Text == superuser&& textBox2.Text == "tt62436458")
            {
                Island = true;
                Issa = true;
            }
            else
            {
                Issa = false;
            }

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

        private void button2_Click(object sender, EventArgs e)  //放弃
        {
            Island = false;
            Issa = 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();
        }
    }
}
