public async Task <ActionResult> CreateOrEdit(int?id) { if (!id.HasValue) { return(View(new CourseDto())); } var course = await _courseAppService.Get(id.Value); return(View(course)); }
public async Task <ActionResult> EditCourseModal(int courseId) { var course = await _courseAppService.Get(new EntityDto <int>(courseId)); var model = new EditCourseViewModel() { Course = course, SelectStatusCode = course.Status, }; return(View("_EditCourseModal", model)); }
public async Task <ActionResult> Edit(int courseId) { var course = await _courseAppService.Get(new EntityDto <int>(courseId)); var model = new Edit { Course = course, Status = course.Status }; return(View("Edit", model)); }
public async Task <ActionResult> Schedule(int?id, int?entityId, string entitype, bool showAlert = false) { ViewBag.EntityType = entitype; if (id.HasValue) { var notification = await _notificationAppService.Get(id.Value); return(View(notification)); } if (!entityId.HasValue) { return(View(new NotificationDto() { AssignedTo = entitype })); } NotificationDto model; switch (entitype) { case "feeds": var feed = await _feedAppService.Get(entityId.Value); model = new NotificationDto() { AssignedTo = "feeds", DataObj = new DataMessageRequest("feeds", entityId.Value, showAlert), Message = feed.Description, Title = feed.Title, AssignedToId = entityId.Value }; model.TurnToData(); return(View(model)); case "courses": var course = await _courseAppService.Get(entityId.Value); model = new NotificationDto() { AssignedTo = "courses", DataObj = new DataMessageRequest("courses", entityId.Value, showAlert), Message = course.Description, Title = course.Title, AssignedToId = entityId.Value }; model.TurnToData(); return(View(model)); case "scholarships": var scholarship = await _scoralshipAppService.Get(entityId.Value); model = new NotificationDto() { AssignedTo = "scholarships", DataObj = new DataMessageRequest("scholarships", entityId.Value, showAlert), Message = scholarship.Description, Title = scholarship.Title, AssignedToId = entityId.Value }; model.TurnToData(); return(View(model)); case "messages": var message = await _dialyMessageAppService.Get(entityId.Value); model = new NotificationDto() { AssignedTo = "messages", DataObj = new DataMessageRequest("messages", entityId.Value, showAlert), Message = message.Description, Title = message.Title, AssignedToId = entityId.Value }; model.TurnToData(); return(View(model)); } return(View(new NotificationDto())); }