private void btnLogin_Click(object sender, EventArgs e) { SA43_Team10A_LibrarySystemEntities ctx = new SA43_Team10A_LibrarySystemEntities(); string userName = txtUserID.Text; string passWord = txtPassword.Text; var login = ctx.EmpCredentials.Where(x => x.EmployeeName == userName && x.Password == passWord).FirstOrDefault(); if (login == null) //no match found for user name and password { count--; string remainingAttempt = Convert.ToString(count); lblLoginPrompt.Visible = true; lblLoginPrompt.Text = "Incorrect User ID or Password. You have " + remainingAttempt + " more attempts"; } else //successful login attempt { frmMain m = new frmMain(); this.Hide(); m.ShowDialog(); this.Close(); } if (count == 0) //failed 3 login consecutively in session { MessageBox.Show("You have reached your maximum attempt. Please try again later"); this.Close(); } }
public frmBorrow() { InitializeComponent(); CreateBorrowInfoTable(); dgvBorrowInfo.AutoGenerateColumns = false; ctx = new SA43_Team10A_LibrarySystemEntities(); }
public frmReturn() { InitializeComponent(); ctx = new SA43_Team10A_LibrarySystemEntities(); dataGridView1.AutoGenerateColumns = false; CreateDataTable(); }
public frmMemberSearch() { InitializeComponent(); ctx = new SA43_Team10A_LibrarySystemEntities(); dgvMemberInfo.AutoGenerateColumns = false; }
private void frmBookMaintenance_Load(object sender, EventArgs e) { ctx = new SA43_Team10A_LibrarySystemEntities(); blst = ctx.BooksDetails.ToList(); InitialState(); }