public void RemoveTask(LearningFlow flow, int taskId) { var task = this.tasksRepo.GetById(taskId); flow.Tasks.Remove(task); this.Update(flow); }
public int? Add(LearningFlow flow) { var currentDashboard = this.dashRepo.GetById(SessionManager.CurrentUserSession.MainDashboardId); currentDashboard.Flows.Add(flow); this.dashRepo.Update(currentDashboard); return flow.ID; }
public ActionResult Edit(LearningFlow flow) { this.ViewBag.FlowTypes = new LearningFlow().FlowType.ToSelectList(); if (ModelState.IsValid) { var lastFlow = LearningFlowService.Get(flow.ID); lastFlow.Name = flow.Name; var state = LearningFlowService.Update(lastFlow); if (state) { Notification.Notify(NotificationType.Success, "Edit Successfull"); } else { Notification.Notify(NotificationType.Fail, "Edit Failed"); } return(this.RedirectToAction("List")); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return(this.View(flow)); }
public int?Add(LearningFlow flow) { var currentDashboard = this.dashRepo.GetById(SessionManager.CurrentUserSession.MainDashboardId); currentDashboard.Flows.Add(flow); this.dashRepo.Update(currentDashboard); return(flow.ID); }
public ActionResult Remove(LearningFlow flow) { if (this.LearningFlowService.Remove(flow.ID)) { return(this.RedirectToAction("Index", "Home")); } else { return(this.View("Error", ErrorType.Internal)); } }
public ActionResult Clear(LearningFlow flow) { var state = LearningFlowService.Update(flow); if (state) { return(this.Json(Is.Success.Empty)); } else { return(this.Json(Is.Fail.Message("Clear Failed"))); } }
public ActionResult EditItems(LearningFlow flow) { if (ModelState.IsValid) { var state = LearningFlowService.Update(flow); if (state) { Notification.Notify(NotificationType.Success, "Edit Successfull"); } else { Notification.Notify(NotificationType.Fail, "Edit Failed"); } return(this.View(flow)); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return(this.View(flow)); }
public ActionResult Add(LearningFlow newFlow) { if (ModelState.IsValid) { newFlow.Tasks = new List<LearningTask>(); var id = LearningFlowService.Add(newFlow); if (id > 0) { Notification.Notify(NotificationType.Success, "Adding new flow successfull"); } else { Notification.Notify(NotificationType.Fail, "Adding new flow failed"); } return this.RedirectToAction("EditItems", new { id }); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return this.View(); }
public ActionResult Add(LearningFlow newFlow) { if (ModelState.IsValid) { newFlow.Tasks = new List <LearningTask>(); var id = LearningFlowService.Add(newFlow); if (id > 0) { Notification.Notify(NotificationType.Success, "Adding new flow successfull"); } else { Notification.Notify(NotificationType.Fail, "Adding new flow failed"); } return(this.RedirectToAction("EditItems", new { id })); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return(this.View()); }
public bool Update(LearningFlow flow) { var result = this.flowRepo.Update(flow); return(result); }
public ActionResult Remove(LearningFlow flow) { if (this.LearningFlowService.Remove(flow.ID)) { return this.RedirectToAction("Index", "Home"); } else { return this.View("Error", ErrorType.Internal); } }
public ActionResult EditItems(LearningFlow flow) { if (ModelState.IsValid) { var state = LearningFlowService.Update(flow); if (state) { Notification.Notify(NotificationType.Success, "Edit Successfull"); } else { Notification.Notify(NotificationType.Fail, "Edit Failed"); } return this.View(flow); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return this.View(flow); }
public ActionResult Edit(LearningFlow flow) { this.ViewBag.FlowTypes = new LearningFlow().FlowType.ToSelectList(); if (ModelState.IsValid) { var lastFlow = LearningFlowService.Get(flow.ID); lastFlow.Name = flow.Name; var state = LearningFlowService.Update(lastFlow); if (state) { Notification.Notify(NotificationType.Success, "Edit Successfull"); } else { Notification.Notify(NotificationType.Fail, "Edit Failed"); } return this.RedirectToAction("List"); } Logger.Warn("Flow model not valid!. Propably client validation didn't worked out."); Notification.Notify(NotificationType.Fail, "Validation Failed!"); return this.View(flow); }
public ActionResult Clear(LearningFlow flow) { var state = LearningFlowService.Update(flow); if (state) { return this.Json(Is.Success.Empty); } else { return this.Json(Is.Fail.Message("Clear Failed")); } }
public bool Update(LearningFlow flow) { var result = this.flowRepo.Update(flow); return result; }
public void RemoveTask(LearningFlow flow, int taskId) { var task = this.tasksRepo.GetById(taskId); flow.Tasks.Remove(task); this.Update(flow); }