示例#1
0
 public static void CreateTask(TodoTask task)
 {
     using (TodoContext ctx = new TodoContext())
     {
         ctx.Tasks.Add(task);
         ctx.SaveChanges();
     }
 }
        public ActionResult CreateTask(TodoTask task)
        {
            if (ModelState.IsValid)
            {
                TasksBL.CreateTask(task);
                return RedirectToAction("Index", "Home");
            }

            return View();
        }
示例#3
0
 public static void CreateTask(TodoTask task)
 {
     task.CreatedDate = DateTime.Now;
     task.Status = TodoTaskStatus.New;
     TasksDAL.CreateTask(task);
 }