private void btnLogin_Click(object sender, EventArgs e) { int result = new NGUOIDUNGF().Login(txtUserName.Text, txtPassword.Text); if (result > -1) { MessageBox.Show("Done"); Constant.NGUOIDUNG_ = new NGUOIDUNGF().FindEntity(txtUserName.Text); this.Hide(); frmMain frm = new frmMain(); frm.ShowDialog(); this.Close(); } }
private void btnSave_Click(object sender, EventArgs e) { NGUOIDUNG model = new NGUOIDUNG { UserName = txtUserName.Text, PassWord = txtPassword.Text, }; var ans = new NGUOIDUNGF().Update(model); if (ans) { Constant.NGUOIDUNG_ = model; MessageBox.Show("Done"); this.Close(); } }