Beispiel #1
0
        public ActionResult Disable(string id, int id2)
        {
            if (engine == null)
            {
                return(View("Error", ERROR_MESSAGE));
            }

            UiTimerNode node = engine.GetNode(id) as UiTimerNode;

            if (node == null)
            {
                return(NotFound());
            }

            UITimerTask task = node.GetTask(id2);

            if (task == null)
            {
                return(NotFound());
            }

            task.Enabled = false;

            node.UpdateTask(task);

            if (Request.Headers["Referer"].Any())
            {
                return(Redirect(Request.Headers["Referer"].ToString()));
            }
            else
            {
                return(RedirectToAction("Tasks"));
            }
        }
Beispiel #2
0
        public ActionResult Edit(UITimerTask task, int TaskId)
        {
            if (engine == null)
            {
                return(View("Error", ERROR_MESSAGE));
            }

            task.Id = TaskId; //pasing id dont work!
            UiTimerNode node = engine.GetNode(task.NodeId) as UiTimerNode;

            if (node == null)
            {
                return(NotFound());
            }

            node.UpdateTask(task);

            return(RedirectToAction("Tasks", new { id = task.NodeId }));
        }