private void btnLogin_Click(object sender, EventArgs e)
        {
            SA47_Team10BCADatabaseEntities context = new SA47_Team10BCADatabaseEntities();

            if (memberIDTextBox.Text == context.LoginDetails.Select(x => x.Username).First().ToString() && passwordTextBox.Text == context.LoginDetails.Select(x => x.Password).First().ToString())
            {
                DialogResult = DialogResult.OK;
            }
            else
            {
                wrongLoginLabel.Text = "Wrong Member ID / Password";
            }
        }
Exemple #2
0
        private void IssueReturnList_Load(object sender, EventArgs e)
        {
            SA47_Team10BCADatabaseEntities context = new SA47_Team10BCADatabaseEntities();

            dataGridView2.DataSource = context.IssueReturn.Select
                                           (x => new
            {
                x.TransactionID,
                x.MemberID,
                x.BookID,
                x.DateExpiry,
                x.DateIssue,
                x.DateReturn,
                x.LoanStatus,
                x.Remarks
            }).ToList();
        }
        private void BorrowRecordForm_Load(object sender, EventArgs e)
        {
            context = new SA47_Team10BCADatabaseEntities();

            Members member = context.Members.Where(x => x.MemberID == memID).First();

            MemberNameLabel.Text = "Borrow Record of " + member.MemberName;

            BorrowRecordDataGridView.DataSource = context.IssueReturn.Where(x => x.MemberID == memID)
                                                  .Select(x => new
            {
                x.TransactionID,
                x.MemberID,
                x.BookID,
                x.Book.BookName,
                x.DateIssue,
                x.DateExpiry,
                x.DateReturn,
                x.LoanStatus,
                x.Remarks
            }).ToList();
        }
Exemple #4
0
 private void Home_Load(object sender, EventArgs e)
 {
     context             = new SA47_Team10BCADatabaseEntities();
     dateTimeLabel.Text  = DateTime.Now.ToString();
     IssuedQtyLabel.Text = context.Books.Sum(x => x.NumberBorrowed).ToString();
 }
 private void SearchMemberForm_Load(object sender, EventArgs e)
 {
     context = new SA47_Team10BCADatabaseEntities();
 }
Exemple #6
0
 private void MemberListForm_Load(object sender, EventArgs e)
 {
     context = new SA47_Team10BCADatabaseEntities();
     MemListDataGridView.DataSource = context.Members.Select(x => new { x.MemberID, x.MemberName, x.PhoneNumber }).ToList();
 }
Exemple #7
0
        private void BookMaintainList_Load(object sender, EventArgs e)
        {
            SA47_Team10BCADatabaseEntities context = new SA47_Team10BCADatabaseEntities();

            dataGridView1.DataSource = context.Books.ToList();
        }