private void FillGridBook(int studentID) { dgvIssueBookList.Rows.Clear(); foreach (var issueBook in IssueBooksHelper.GetIssueBookListFromStudentID(studentID)) { int row = dgvIssueBookList.Rows.Add(); dgvIssueBookList.Rows[row].Cells[0].Value = issueBook.IssueID; dgvIssueBookList.Rows[row].Cells[1].Value = issueBook.BookID; dgvIssueBookList.Rows[row].Cells[2].Value = BooksHelper.GetBookNameByID(issueBook.BookID); dgvIssueBookList.Rows[row].Cells[3].Value = StaffsHelper.GetByNameFromID(issueBook.StaffID); dgvIssueBookList.Rows[row].Cells[4].Value = issueBook.NoOfCopies; dgvIssueBookList.Rows[row].Cells[5].Value = issueBook.DateOfIssue.ToString("dd MMMM yyyy"); dgvIssueBookList.Rows[row].Cells[6].Value = issueBook.DateOfReturn.ToString("dd MMMM yyyy"); row++; } }
private void FillGrid() { dgvStudentList.Rows.Clear(); foreach (var student in StudentsHelper.GetActiveStudentsList()) { int row = dgvStudentList.Rows.Add(); dgvStudentList.Rows[row].Cells[0].Value = student.StudentID; dgvStudentList.Rows[row].Cells[1].Value = student.Name; dgvStudentList.Rows[row].Cells[2].Value = student.TCNO; dgvStudentList.Rows[row].Cells[3].Value = student.EnrollNo; dgvStudentList.Rows[row].Cells[4].Value = SessionsHelper.GetByNameFromID(student.SessionID); dgvStudentList.Rows[row].Cells[5].Value = DepartmentsHelper.GetByNameFromID(student.DepartmentID); dgvStudentList.Rows[row].Cells[6].Value = ProgramsHelper.GetByNameFromID(student.ProgramID); dgvStudentList.Rows[row].Cells[7].Value = student.RegisterDate.ToString("dd MMMM yyyy"); dgvStudentList.Rows[row].Cells[8].Value = student.Address; dgvStudentList.Rows[row].Cells[9].Value = student.ContactNo; dgvStudentList.Rows[row].Cells[10].Value = StaffsHelper.GetByNameFromID(student.StaffID); row++; } }
private void FillGrid() { dgvBookList.Rows.Clear(); foreach (var book in BooksHelper.GetBooksList()) { int row = dgvBookList.Rows.Add(); dgvBookList.Rows[row].Cells[0].Value = book.BookID; dgvBookList.Rows[row].Cells[1].Value = book.BookName; dgvBookList.Rows[row].Cells[2].Value = BookCategoriesHelper.GetByNameFromID(book.BookCategoryID); dgvBookList.Rows[row].Cells[3].Value = DepartmentsHelper.GetByNameFromID(book.DepartmentID); dgvBookList.Rows[row].Cells[4].Value = book.Author; dgvBookList.Rows[row].Cells[5].Value = book.Title; dgvBookList.Rows[row].Cells[6].Value = book.Edition; dgvBookList.Rows[row].Cells[7].Value = book.NoOfCopies; dgvBookList.Rows[row].Cells[8].Value = book.DateOfRegister.ToString("dd MMMM yyyy"); dgvBookList.Rows[row].Cells[9].Value = book.Price; dgvBookList.Rows[row].Cells[10].Value = StaffsHelper.GetByNameFromID(_staffID); row++; } }
private void FrmMain_Load(object sender, EventArgs e) { UserPre(); toolStripStatusLabel1.Text = StaffsHelper.GetByNameFromID(_staffID); }