Beispiel #1
0
        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;
 }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        public int?Add(LearningFlow flow)
        {
            var currentDashboard = this.dashRepo.GetById(SessionManager.CurrentUserSession.MainDashboardId);

            currentDashboard.Flows.Add(flow);
            this.dashRepo.Update(currentDashboard);
            return(flow.ID);
        }
Beispiel #5
0
 public ActionResult Remove(LearningFlow flow)
 {
     if (this.LearningFlowService.Remove(flow.ID))
     {
         return(this.RedirectToAction("Index", "Home"));
     }
     else
     {
         return(this.View("Error", ErrorType.Internal));
     }
 }
Beispiel #6
0
        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")));
            }
        }
Beispiel #7
0
        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();
        }
Beispiel #9
0
        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());
        }
Beispiel #10
0
        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);
 }