Пример #1
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     main = new Login();
     Application.Run(main);
 }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string id = textBox1.Text;
            string password = textBox2.Text;
            string againPw = textBox3.Text;

            string check = "select ID from Administrator";

            DataSet ds = DbHelperSQL.Query(check, "ID");

            if (id != "" && password != "" && againPw != "")
            {
                foreach (DataRow row in ds.Tables["ID"].Rows)
                {
                    if(row["ID"].ToString().Trim()==id.Trim())
                    {
                        MessageBox.Show("该用户名已被占用,请重新输入");
                        textBox1.Text = null;
                        return;
                    }
                }
                if (password != againPw)
                {
                    MessageBox.Show("请确保两段密码相同.");
                }
                else
                {

                    string insert = "insert into Administrator(ID,Password) values ('" + id + "','" + password + "')";
                    DbHelperSQL.ExecuteSql(insert);

                    MessageBox.Show("注册成功.");
                    Login loginView = new Login();
                    loginView.Show();
                    this.Dispose();
                }
            }
            else
            {
                MessageBox.Show("该输入所有数据.");
            }
        }
Пример #3
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            String user = this.txt_user.Text;
             String pass = this.txt_password.Text;
             Conexion c = new Conexion();
             //verifica que la conexiòn se haya establecido
            if (Conexion.Success()) {
                //verifica que los datos del login sean correctos
                Login L = new Login(user, pass,c);
                if (Login.Success())
                {
                    Principal F1 = new Principal();
                    F1.Show();
                    this.Hide();
                    //se cierra la conexión
                    c.Close();
                }
                else { MessageBox.Show("Contaseña inválida"); }

            }
            else { MessageBox.Show("Imposible conectar a la base de datos"); }
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string getstr="";
            Login log = new Login();

            getstr = log.Authenticate(textBox1.Text, textBox2.Text);

            if (getstr == "doc")
            {
                doc.Show();
            }

            if(getstr == "staff" )
            {
                st.Show();
            }
               /* if (textBox1.Text == "doctor" && textBox2.Text == "doctor")
            {
                doc.Show();

            }
            else
            {
                if (textBox1.Text == "staff" && textBox2.Text == "staff")
                {
                    st.Show();

                }
                else
                {
                    MessageBox.Show("Invalid User");

                }

            }*/
        }
Пример #5
0
 private void toolStripMenuItem3_Click(object sender, EventArgs e)
 {
     Login log = new Login();
     log.Show();
 }
Пример #6
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Login login = new Login();
            DialogResult dr = new DialogResult();
            dr = login.ShowDialog();
            if (dr == DialogResult.OK)
            {
                ser = login.server;
                uname = login.username;
                pass = login.pass;
            }
            connetionString = @"Data Source="+ser+
                ",1433;Network Library = DBMSSOCN; Initial Catalog = u453901;User ID ="+
                uname+"; Password ="+pass;
            isConnected = true; lastCheck = DateTime.UtcNow;


        }
Пример #7
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     this.Dispose();
     Login login = new Login();
     login.Show();
 }
Пример #8
0
 private void bt_logout_Click(object sender, EventArgs e)
 {
     Login p = new Login();/*Al desloguearse volvemos a login*/
     p.Show();
     this.Hide();
 }
Пример #9
0
 private void tsb_Logoff_Click(object sender, EventArgs e)
 {
     this.Dispose();
     Login login = new Login();
     login.Show();
 }
Пример #10
0
 private void button2_Click(object sender, EventArgs e)
 {
     Login fm = new Login();
     fm.Show();
     Hide();
 }
Пример #11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //String fdsa = Cookie.GetCookies(Define.Domain);
            //MessageBox.Show(fdsa);

            Data.init();

            Login login = new Login();  //新建一个NewForm窗口(NewForm是自己定义的Form)
            login.ShowDialog();         //新窗口显现

            if (Data.GetLoginResult != Define.Login_Succeed)
            {
                this.Close();
                return;
            }

            this.MaximizeBox = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            //String  dda = Des.GetMachineInfo(channel.ToString());

            CreateColumnHeader(listView_Order);
            CreateColumnHeader(listView_Completed);

            ColumnHeader BTCc1 = new ColumnHeader();
            BTCc1.Text = "比特币BTC预警";
            BTCc1.Width = 210;
            listViewBTC.Columns.AddRange(new ColumnHeader[] { BTCc1 });//将这两列加入listView1
            listViewBTC.View = View.Details;

            ColumnHeader LTCc1 = new ColumnHeader();
            LTCc1.Text = "莱特币LTC预警";
            LTCc1.Width = 210;
            listViewLTC.Columns.AddRange(new ColumnHeader[] { LTCc1 });//将这两列加入listView1
            listViewLTC.View = View.Details;

            Title = Define.TitleBase;
            this.Text = Title;

            String mac = "";
            NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface netWork in netWorks)
            {
                mac += netWork.GetPhysicalAddress().ToString();
            }

            timer.Interval = 1000;
            timer.Enabled = true;

            timerWarnPlay.Interval = 60000;
            timerWarnPlay.Enabled = false;

            timerDepth.Interval = 1000;
            timerDepth.Enabled = true;

            timer_AccountRecord.Interval = 5000;
            timer_AccountRecord.Enabled = true;
            timer_order.Interval = 5000;
            timer_order.Enabled = true;

            timer_OrderHistory.Interval = 5000;
            timer_OrderHistory.Enabled = true;

            tabControl1.Width = 745;
            tabControl1.Height = 224;

            lab_alert.Text = "";
            lab_sell_alert.Text = "";

            cur_BTCorLTC(0);

            CSPList.Add(CSP5);
            CSPList.Add(CSP4);
            CSPList.Add(CSP3);
            CSPList.Add(CSP2);
            CSPList.Add(CSP1);

            CSNList.Add(CSN5);
            CSNList.Add(CSN4);
            CSNList.Add(CSN3);
            CSNList.Add(CSN2);
            CSNList.Add(CSN1);

            CBPList.Add(CBP1);
            CBPList.Add(CBP2);
            CBPList.Add(CBP3);
            CBPList.Add(CBP4);
            CBPList.Add(CBP5);

            CBNList.Add(CBN1);
            CBNList.Add(CBN2);
            CBNList.Add(CBN3);
            CBNList.Add(CBN4);
            CBNList.Add(CBN5);

            ThreadEx threadex = new ThreadEx();
            threadex.Start(new ThreadStart(threadex.GetCheckVersion), new EventHandler(GetCheckVersion), this);

            ThreadEx threadex2 = new ThreadEx();
            threadex2.Start(new ThreadStart(threadex2.GetUserConfig), new EventHandler(GetUserConfig), this);
        }
Пример #12
0
 private void LogoutTS_Click(object sender, EventArgs e)
 {
     Login login = new Login();
     login.Show();
     this.Hide();
 }
Пример #13
0
 private void bt_siguiente_Click(object sender, EventArgs e)
 {
     Login p = new Login();/*Al desloguearse volvemos a login*/
     p.Show();
     this.Hide();
 }