Exemplo n.º 1
0
 public ActionResult DeleteConfirmed(int id)
 {
     bll_task = new BLL_Task();
     if (bll_task.DeleteTaskInfo(id))
     {
         TempData["message"] = "Task Delete Successfully";
         return(RedirectToAction("Index"));
     }
     else
     {
         TempData["message"] = "Task not Deleted !";
         return(RedirectToAction("Index"));
     }
 }
Exemplo n.º 2
0
        // GET: Task/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            bll_task = new BLL_Task();
            TaskVM vm = bll_task.GetTaskInfoById(Convert.ToInt32(id));

            if (vm == null)
            {
                return(HttpNotFound());
            }
            return(View(vm));
        }
Exemplo n.º 3
0
 public ActionResult Edit(TaskVM vm)
 {
     if (ModelState.IsValid)
     {
         bll_task = new BLL_Task();
         if (bll_task.UpdateTaskInfo(vm))
         {
             TempData["message"] = "Task update Successfully";
             return(RedirectToAction("Index"));
         }
         else
         {
             TempData["message"] = "Task update problem !";
             return(View(vm));
         }
     }
     return(View(vm));
 }
Exemplo n.º 4
0
        public ActionResult Create(TaskVM vm)
        {
            if (ModelState.IsValid)
            {
                bll_task = new BLL_Task();
                if (bll_task.CreateTaskInfo(vm))
                {
                    TempData["message"] = "Task Saved Successfully";

                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["message"] = "Task not saved";
                    return(View(vm));
                }
            }

            return(View(vm));
        }
Exemplo n.º 5
0
 // GET: Task
 public ActionResult Index()
 {
     bll_task = new BLL_Task();
     return(View(bll_task.GetAllTaskInfo()));
 }