示例#1
0
        private void ConnectButton_Click(object sender, EventArgs e)
        {
            if (AccInBox.Text.Length == 0)
            {
                LoginError.SetError(AccInBox, "Not Null!!");
            }
            if (PwdInBox.Text.Length == 0)
            {
                LoginError.SetError(PwdInBox, "空のインプットができません");
            }
            //else
            //{
            //    try
            //    {
            //        int i = Int32.Parse(PwdBox.Text.Trim());
            //        LoginError.SetError(PwdBox,"");
            //    }
            //    catch
            //    {
            //        LoginError.SetError(PwdBox,"数字のパスワードを入力してください");
            //    }
            //}

            //if (AccInBox.Text == "vickerszhu" && PwdInBox.Text == "database")
            //{
            //    this.AcceptButton = ConnectButton;
            //    sqlkey = "server=.;database=Vickers;uid=" + AccInBox.Text + ";pwd=" + PwdInBox.Text + ";";
            //    MainInterface f = new MainInterface(sqlkey);
            //    f.Show();
            //    this.Hide();
            //}
            if (PwdInBox.Text.Trim() == identi_tools.UsersSavedBuyers(dttb, AccInBox.Text.Trim()))
            {
                initConn.Close();
                this.AcceptButton = ConnectButton;
                sqlkey            = "server=.;database=Vickers;uid=" + AccInBox.Text + ";pwd=" + PwdInBox.Text + ";";
                MainUser          = AccInBox.Text.Trim();
                MainInterface f = new MainInterface(sqlkey);
                initConn.Close();
                f.Show();
                this.Hide();
            }
            else if (PwdInBox.Text == identi_tools.UsersSavedSellers(dttb, AccInBox.Text.Trim()))
            {
                initConn.Close();
                this.AcceptButton = ConnectButton;
                sqlkey            = "server=.;database=Vickers;uid=" + AccInBox.Text + ";pwd=" + PwdInBox.Text + ";";
                MainUser          = AccInBox.Text.Trim();
                SellerWorkstageInterface f = new SellerWorkstageInterface(sqlkey);
                initConn.Close();
                f.Show();
                this.Hide();
            }
        }