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

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

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

            dgvListStudent.DataSource = studentDTOs;
        }
Exemplo n.º 3
0
 public static List <Student> GetAllStudentByGrade(int id)
 {
     try
     {
         return(StudentDAL.GetAllStudent(id));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo 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";
        }
Exemplo 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);
        }
Exemplo 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));
            }
        }
Exemplo 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);
     }
 }