Example #1
0
        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();
            }
        }
Example #2
0
 public frmBorrow()
 {
     InitializeComponent();
     CreateBorrowInfoTable();
     dgvBorrowInfo.AutoGenerateColumns = false;
     ctx = new SA43_Team10A_LibrarySystemEntities();
 }
Example #3
0
 public frmReturn()
 {
     InitializeComponent();
     ctx = new SA43_Team10A_LibrarySystemEntities();
     dataGridView1.AutoGenerateColumns = false;
     CreateDataTable();
 }
Example #4
0
 public frmMemberSearch()
 {
     InitializeComponent();
     ctx = new SA43_Team10A_LibrarySystemEntities();
     dgvMemberInfo.AutoGenerateColumns = false;
 }
Example #5
0
 private void frmBookMaintenance_Load(object sender, EventArgs e)
 {
     ctx  = new SA43_Team10A_LibrarySystemEntities();
     blst = ctx.BooksDetails.ToList();
     InitialState();
 }