protected void btnLate_Click(object sender, EventArgs e) { var schoolId = info.getId(); var semesterId = MyDate.getCurrentSemesterId(); // var LibrarianId = info.getSchoolLibrarian(); var preInfo = (from k in km.BorrowsofStudents join emp in km.Students on k.StudentId equals emp.IdentityNumber where k.SchoolId == schoolId && k.SemesterId == semesterId && k.isReturn == false && k.DateReturn < DateTime.Now orderby k.DateReturn, k.DateBorrow select new { emp.Name, k.DateReturn, k.DateBorrow, k.BookId, auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(), bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(), k.isReturn }).ToList(); LstStudentsBorrow.DataSource = preInfo; LstStudentsBorrow.DataBind(); }
public void FillBorrowNotReturn() { var schoolId = info.getId(); var semesterId = MyDate.getCurrentSemesterId(); if (Request.QueryString["BookId"] != null) { int Bookid = int.Parse(Request.QueryString["BookId"]); var preInfo = (from k in km.BorrowsofEmployees join emp in km.Employees on k.EmployeeId equals emp.IdentityNumber where k.SchoolId == schoolId && k.SemesterId == semesterId && k.isReturn == false && k.BookId == Bookid orderby k.DateReturn, k.DateBorrow select new { k.Id, emp.Name, k.DateReturn, k.DateBorrow, k.BookId, auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(), bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(), k.isReturn }).ToList(); LstEmployeeBorrow.DataSource = preInfo; LstEmployeeBorrow.DataBind(); var preInfo2 = (from k in km.BorrowsofStudents join emp in km.Students on k.StudentId equals emp.IdentityNumber where k.SchoolId == schoolId && k.SemesterId == semesterId && k.isReturn == false && k.BookId == Bookid orderby k.DateReturn, k.DateBorrow select new { k.Id, emp.Name, k.DateReturn, k.DateBorrow, k.BookId, auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(), bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(), k.isReturn }).ToList(); LstStudentsBorrow.DataSource = preInfo2; LstStudentsBorrow.DataBind(); } }
public void FillBorrowAll() { var schoolId = info.getId(); var semesterId = MyDate.getCurrentSemesterId(); // var LibrarianId = info.getSchoolLibrarian(); var preInfo = (from k in km.BorrowsofStudents join e in km.Students on k.StudentId equals e.IdentityNumber where k.SchoolId == schoolId && k.SemesterId == semesterId orderby k.DateReturn, k.DateBorrow select new { e.Name, k.DateReturn, k.DateBorrow, k.BookId, auther = (from b in km.Books where b.Id == k.BookId select b.Auther).FirstOrDefault(), bookname = (from b in km.Books where b.Id == k.BookId select b.Title).FirstOrDefault(), k.isReturn }).ToList(); LstStudentsBorrow.DataSource = preInfo; LstStudentsBorrow.DataBind(); }