namespace SalesAndMonitoring { public partial class frmLogin : Form { private string User = ""; private bool isvalid = false; private string[] privileges; public string[] Privileges { get { return privileges; } } public string getUser { get { return User; } } public bool isValid { get { return isvalid; } } private void sValidate() { var user = BusinessAccessLayer.GetEntity().User_tbl.Where( e => e.UserID == txtUsername.Text && e.Password == txtPassword.Text); if(user.Count() >0) { isvalid = true; User = txtUsername.Text; Close(); return; } MessageBox.Show("Invalid username or password", "invalid", MessageBoxButtons.OK, MessageBoxIcon.Information); } public frmLogin() { InitializeComponent(); txtUsername.Focus(); } private void btnCancel_Click(object sender, EventArgs e) { DialogResult rs = MessageBox.Show("Are you sure you want to exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rs == DialogResult.No) { return; } Application.Exit(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)