コード例 #1
0
 private void btnLogin_Click_1(object sender, EventArgs e)
 {
     if (b_user.Call_Get_accuracy(txttk.Text, txtmk.Text))
     {
         frm_Main frmmain = new frm_Main();
         frmmain.Get_name_user(txttk.Text);
         frmmain.FormClosed += new FormClosedEventHandler(mainForm_FormClosed);
         frmmain.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Failure");
     }
 }
コード例 #2
0
ファイル: frm_Login.cs プロジェクト: kenzu2lfc01/1660548
        private void btnLogin_Click(object sender, EventArgs e)
        {
            int type = BUS.BUS_Users.Instance.CheckLogin(txtUserID, txtPassword);

            if (type != 0)
            {
                List <int> role    = BUS.BUS_Users.Instance.Users_FillListRole(txtUserID.Text);
                frm_Main   frmMain = new frm_Main(this, role);
                frmMain.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu!!!", "Thông báo", MessageBoxButtons.OK);
            }
        }
コード例 #3
0
ファイル: frm_Login.cs プロジェクト: HajPhan/Th-c-T-p-CSDL
        private void btnLogin_Click_1(object sender, EventArgs e)
        {
            try
            {
                Login login = new Login();

                string userName = txtUser.Text;
                login.username = int.Parse(txtUser.Text);
                login.password = int.Parse(txtPass.Text);

                UserInfo.Id = int.Parse(userName);

                loginBLL logbll = new loginBLL();

                bool kq = logbll.CheckLogin(login);

                if (kq == true)
                {
                    MessageBox.Show(login.permission.ToString());
                    if (login.permission == "QLBH")
                    {
                        this.Hide();
                        frm_Main main = new frm_Main(login.fullname, login.namepermision);
                        UserInfo.permission = login.permission;
                        main.ShowDialog();
                        this.Close();
                    }
                    else if (login.permission == "NVBH")
                    {
                        this.Hide();
                        frm_Main main = new frm_Main(login.fullname, login.namepermision);
                        UserInfo.permission = login.permission;
                        main.ShowDialog();
                        this.Close();
                    }
                    else if (login.permission == "NVNEW")
                    {
                        MessageBox.Show("Bạn không có quyền đăng nhập vào hệ thống!");
                    }
                }
            }
            catch
            {
                MessageBox.Show("Username hoặc Password không đúng");
            }
        }
コード例 #4
0
 public frm_Main()
 {
     FormInstance = this;
     InitializeComponent();
 }