Exemplo n.º 1
0
        public async Task <ActionResult> AddRegistration(string groupId, string semesterId,
                                                         string studentId, string flowSubjectId)
        {
            if (string.IsNullOrEmpty(studentId))
            {
                List <Student> students = await Student.GetCollectionAsync(groupId, semesterId);

                List <Person> people = await Person.GetCollectionAsync();

                ViewBag.students      = students;
                ViewBag.flowSubjectId = flowSubjectId;
                return(View("AddReg"));
            }
            else
            {
                Student.StudentFlowSubject studentFlowSubject = new Student.StudentFlowSubject
                {
                    StudentId     = studentId,
                    FlowSubjectId = flowSubjectId
                };
                if (await studentFlowSubject.Add())
                {
                    return(Redirect(string.Format("/Student/{0}/registry", flowSubjectId)));
                }
                else
                {
                    return(View("~/Views/Shared/Error.cshtml"));
                }
            }
        }
Exemplo n.º 2
0
 public async Task <ActionResult> Add(Student.StudentFlowSubject registration)
 {
     if (registration != null)
     {
         if (await registration.Add())
         {
             return(View()); //TODO: редирект на страницу списка зареганных студентов
         }
     }
     return(View("~/Views/Shared/Error.cshtml"));
 }
Exemplo n.º 3
0
 public async Task <ActionResult> DelRegistration(string studentRegId)
 {
     Student.StudentFlowSubject registry = new Student.StudentFlowSubject
     {
         ID = studentRegId
     };
     if (await registry.Delete())
     {
         return(Redirect(Request.UrlReferrer.ToString()));
     }
     else
     {
         return(View("~/Views/Shared/Error.cshtml"));
     }
 }