public AddOfficalStudentForm() { InitializeComponent(); StudentDAL studentDAL = new StudentDAL(); studentDAL.ConnectToDatabase(); textboxStudentID.Text = ID_CHAR + (studentDAL.GetAllStudent().Count + 1).ToString(); }
void InitStudentData() { StudentDAL studentDAL = new StudentDAL(); studentDAL.ConnectToDatabase(); List <StudentDTO> studentDTOs = studentDAL.GetAllStudent(); dgvListStudent.DataSource = studentDTOs; }
public static List <Student> GetAllStudentByGrade(int id) { try { return(StudentDAL.GetAllStudent(id)); } catch (Exception) { throw; } }
void LoadComboBoxStudent() { StudentDAL studentDAL = new StudentDAL(); studentDAL.ConnectToDatabase(); List <StudentDTO> classDTOs = studentDAL.GetAllStudent(); comboBoxListStudent.DataSource = classDTOs; comboBoxListStudent.DisplayMember = "StudentName"; comboBoxListStudent.ValueMember = "StudentId"; }
void InitOfficialStudentData() { StudentDAL studentDAL = new StudentDAL(); studentDAL.ConnectToDatabase(); List <StudentDTO> studentDTOs = studentDAL.GetAllStudent(); dgvListStudent.DataSource = studentDTOs; DataGridViewCheckBoxColumn addConfirm = new DataGridViewCheckBoxColumn() { HeaderText = "Add" }; dgvListStudent.Columns.Add(addConfirm); }
//Gets all Student details and display it in a table // GET: Student public async Task <IActionResult> Browse(string searchString) { // Stop accessing the action if not logged in // or account not in the "Student" role if ((HttpContext.Session.GetString("Role") == null) || (HttpContext.Session.GetString("Role") != "Student")) { return(RedirectToAction("Index", "Home")); } ViewData["CurrentFilter"] = searchString; List <Student> studentList = studentContext.GetAllStudent(); var students = from s in studentList select s; if (!String.IsNullOrEmpty(searchString)) { students = students.Where(s => s.Name.Contains(searchString)); return(View(students.ToList())); } else { return(View(studentList)); } }
public SuggestionViewModel MapToStudentVM(Suggestion suggestion) { if (suggestion != null) { string studentName = ""; List <Student> studentList = studentContext.GetAllStudent(); foreach (Student student in studentList) { if (student.StudentID == suggestion.StudentId) { studentName = student.Name; break; } } string suggestionStatus; if (suggestion.Status == 'N') { suggestionStatus = "Not Acknowledged"; } else { suggestionStatus = "Acknowledged"; } SuggestionViewModel suggestionVM = new SuggestionViewModel { SuggestionId = suggestion.SuggestionId, LecturerId = suggestion.LecturerId, Description = suggestion.Description, Status = suggestionStatus, DateCreated = suggestion.DateCreated, StudentName = studentName }; return(suggestionVM); } else { return(null); } }