예제 #1
0
 public static void CreateTask(TodoTask task)
 {
     using (TodoContext ctx = new TodoContext())
     {
         ctx.Tasks.Add(task);
         ctx.SaveChanges();
     }
 }
예제 #2
0
        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);
 }