public ActionResult Create(CreateHomeworkModel modelHomework) { var myHomework = new Homework { Title = modelHomework.Title, Description = modelHomework.Description, DeliverDate = ParseToHonduranDateTime.Parse(modelHomework.DeliverDate), Points = modelHomework.Points, AcademicYearDetail = _academicYearDetailRepository.FindByCourse(_courseRepository.GetById(modelHomework.Course).Id, GetTeacherId()) }; _homeworkRepository.Create(myHomework); const string title = "Tarea agregada"; string content = "La tarea " + myHomework.Title + " ha sido agregado exitosamente."; _viewMessageLogic.SetNewMessage(title, content, ViewMessageType.SuccessMessage); return(RedirectToAction("Index")); }
public ActionResult Add(AcademicYearDetailsRegisterModel academicYearDetailsModel) { var academicYearDetails = new AcademicYearDetail { TeacherStartDate = ParseToHonduranDateTime.Parse(academicYearDetailsModel.TeacherStartDate), TeacherEndDate = ParseToHonduranDateTime.Parse(academicYearDetailsModel.TeacherEndDate), Schedule = ParseToHonduranDateTime.Parse(academicYearDetailsModel.Schedule), Room = academicYearDetailsModel.Room, Course = _courseRepository.GetById(academicYearDetailsModel.Course.Id), Teacher = _teacherRepository.GetById(academicYearDetailsModel.Teacher.Id), AcademicYear = _academicYearRepository.GetById(academicYearDetailsModel.AcademicYearId) }; _academicYearDetailsRepository.Create(academicYearDetails); const string title = "Detalles de Año Académico Agregado"; const string content = "El detalle del año académico ha sido agregado exitosamente."; _viewMessageLogic.SetNewMessage(title, content, ViewMessageType.SuccessMessage); return(Redirect(string.Format("~/AcademicYearDetails/Index/{0}", academicYearDetailsModel.AcademicYearId))); }