public Report()
 {
     StudentSummary = new StudentSummary
     {
         StudentDetails = new List <StudentDetails>()
     }
 }
Beispiel #2
0
 public ActionResult DeleteStudent(StudentSummary studentSummary)
 {
     if (summariesService == null)
     {
         InitializeSummariesService(HttpContext);
         AddRedirect(Response);
     }
     return(Content(string.Concat(summariesService.StudentOut(studentSummary),
                                  string.Concat(Environment.NewLine, StudentControllerConst.RedirectMessage.Replace(
                                                    StudentControllerConst.ReplaceTime, StudentControllerConst.RedirectTime)))));
 }
Beispiel #3
0
 public ActionResult UpdateInfoStudent(int?ID)
 {
     if (ID != null)
     {
         if (summariesService == null)
         {
             InitializeSummariesService(HttpContext);
         }
         StudentSummary studentSummary = summariesService.StudentInfo(ID.Value);
         return(View(studentSummary));
     }
     else
     {
         return(View());
     }
 }
Beispiel #4
0
        public async Task <JsonResult> Find(string keywords)
        {
            List <StudentSummary> summaries = new List <StudentSummary>();

            // No keywords, no results (avoid the hassle of sending a 400 with JsonResult in ASP.NET)
            if (keywords == null)
            {
                return(Json(summaries));
            }

            string[] words        = keywords.Split(",");
            var      applications = _context.StudentApplications
                                    .Include(o => o.Student)
                                    .ThenInclude(s => s.Skills);

            foreach (var app in applications)
            {
                HashSet <string> skills = new HashSet <string>();
                foreach (var skill in app.Student.Skills)
                {
                    skills.Add(skill.Skill.Name.ToLower());
                }

                // an OR search, not AND
                foreach (var word in words)
                {
                    if (skills.Contains(word.Trim().ToLower()))
                    {
                        var student = await _userManager.FindByIdAsync(app.Student.StudentId);

                        StudentSummary summary = new StudentSummary
                        {
                            Name          = student.UserName,
                            ApplicationId = app.StudentApplicationId,
                            UId           = app.UId,
                            GPA           = app.GPA,
                            Skills        = skills.ToList <string>(),
                            Summary       = app.PersonalStatement
                        };
                        summaries.Add(summary);
                        break;
                    }
                }
            }

            return(Json(summaries));
        }
Beispiel #5
0
 private void FormStudentInfo_Load(object sender, EventArgs e)
 {
     tabcMain.SelectedTabPageIndex = 0;
     Student = new StudentDAO().GetModel(Student.StudentID);
     Sum     = new StudentSummaryDao().GetModel(Student.StudentID);
     Ext     = new StudentExtDao().GetModel(Student.StudentID);
     BindLoadStudent();
     if (Ext != null)
     {
         BindLoadExt();
     }
     if (Sum != null)
     {
         BindLoadExam();
         BindLoadSummary();
         BindLoadOther();
         BindLoadInterval();
     }
     Init();
 }