Esempio n. 1
0
        public AddOfficalStudentForm()
        {
            InitializeComponent();
            StudentDAL studentDAL = new StudentDAL();

            studentDAL.ConnectToDatabase();
            textboxStudentID.Text = ID_CHAR + (studentDAL.GetAllStudent().Count + 1).ToString();
        }
Esempio n. 2
0
        void InitStudentData()
        {
            StudentDAL studentDAL = new StudentDAL();

            studentDAL.ConnectToDatabase();
            List <StudentDTO> studentDTOs = studentDAL.GetAllStudent();

            dgvListStudent.DataSource = studentDTOs;
        }
Esempio n. 3
0
 public static List <Student> GetAllStudentByGrade(int id)
 {
     try
     {
         return(StudentDAL.GetAllStudent(id));
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        void LoadComboBoxStudent()
        {
            StudentDAL studentDAL = new StudentDAL();

            studentDAL.ConnectToDatabase();
            List <StudentDTO> classDTOs = studentDAL.GetAllStudent();

            comboBoxListStudent.DataSource    = classDTOs;
            comboBoxListStudent.DisplayMember = "StudentName";
            comboBoxListStudent.ValueMember   = "StudentId";
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        //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));
            }
        }
Esempio n. 7
0
 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);
     }
 }