private void b_Login_Click(object sender, EventArgs e)
        {
            if (tB_UseName.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn chưa nhập tên đăng nhập.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                tB_UseName.Focus();
                return;
            }

            if (tB_Password.Text.Trim().Length == 0)
            {
                MessageBox.Show("Bạn chưa nhập mật khẩu.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                tB_Password.Focus();
                return;
            }

            IDEmployee = Class.DataConnection.GetID(tB_UseName.Text.Trim(), tB_Password.Text.Trim());
            if (IDEmployee != "")
            {
                Form_Menu f = new Form_Menu(IDEmployee);
                this.Hide();
                f.ShowDialog();
                this.Show();
                tB_UseName.Text  = "";
                tB_Password.Text = "";
            }

            else
            {
                MessageBox.Show("Tài khoản hoặc mật khẩu không đúng. Xin hãy nhập lại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (Form_Menu mn = new Form_Menu())
     {
         mn.ShowDialog();
     }
 }
        private void BT_Menu_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form_Menu menuForm = new Form_Menu(User.UserId);

            //menuForm.StyleManager = this.StyleManager;
            menuForm.ShowDialog();
            this.Close();
        }
 private void btn_Login_Click(object sender, EventArgs e) //check to see if the right input was entered, if so, log in.
 {
     if (String.IsNullOrWhiteSpace(txt_User.Text) || String.IsNullOrWhiteSpace(txt_Password.Text))
     {
         MessageBox.Show("Username and Password Required!");
     }
     else if (Data.Database.CheckUser(txt_User.Text, txt_Password.Text))
     {
         Form_Menu Menu = new Form_Menu();
         Menu.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("Incorrect Username or Password");
     }
 }
Exemple #5
0
 private void btnSignIn_Click(object sender, EventArgs e)
 {
     using (QuanLyBenhVienDataContext db = new QuanLyBenhVienDataContext())
     {
         var a = (from user in db.accounts
                  where txbPassword.Text == user.password && txbUsername.Text == user.usernamme
                  select user).FirstOrDefault();
         if (a != null)
         {
             DisplayName = a.tenhienthi;
             admin       = a.admin;
             this.Hide();
             Form_Menu form_Menu = new Form_Menu();
             form_Menu.ShowDialog();
             this.Show();
         }
         else
         {
             MessageBox.Show("Mật khẩu hoặc tên tài khoản sai", "Thông báo");
         }
     }
 }
Exemple #6
0
 public Form_Tables(Form_Menu parent)
 {
     InitializeComponent();
     menu = parent;
     MAJLabels();
 }