Ejemplo n.º 1
0
 public vmEnrollment()
 {
     Course = new vmCourse();
     Student = new vmStudent();
     Semester = new vmSemester();
     Semesters = new List<Semester>();
     Courses = new List<Course>();
     Students = new Dictionary<int, string>();
 }
Ejemplo n.º 2
0
 public vmEnrollment()
 {
     Course    = new vmCourse();
     Student   = new vmStudent();
     Semester  = new vmSemester();
     Semesters = new List <Semester>();
     Courses   = new List <Course>();
     Students  = new Dictionary <int, string>();
 }
Ejemplo n.º 3
0
 public ActionResult Details(int id)
 {
     using (SemestersManager)
     {
         var disp = Mapper.Map<vmSemester>(SemestersManager.GetSemesterbyID(id));
         if (disp == null)
         {
             disp = new vmSemester();
             ModelState.AddModelError("", "Failed to load details for requested item.");
         }
         return View(disp);
     }
 }
Ejemplo n.º 4
0
 public ActionResult Create(vmSemester sem)
 {
     try
     {
         if (ModelState.IsValid)
         {
             using (SemestersManager)
             {
                 var item = Mapper.Map<Semester>(sem);
                 var success = SemestersManager.AddSemester(item);
                 if (success)
                 {
                     return RedirectToAction("Details", new { id = item.ID });
                 }
                 throw new DataException("Unable to save Semester. Please try again.");
             }
         }
     }
     catch (DataException ex)
     {
         ModelState.AddModelError("", ex.Message);
     }
     return View(sem);
 }
Ejemplo n.º 5
0
 public ActionResult Create()
 {
     var disp = new vmSemester();
     return View(disp);
 }