// Create a task public ActionResult CreateTask() { if (!(User.Identity.IsAuthenticated && User.Identity.Name == "admin")) { return(RedirectToAction("Index", "Home")); } try { if (Request.Form["save"] != null) { DateTime start = DateTime.Now; if (Request.Form["start"] != "") { start = DateTime.Parse(Request.Form["start"]); } DateTime end = DateTime.Now; if (Request.Form["end"] != "") { end = DateTime.Parse(Request.Form["end"]); } string values = Request.Form["users"]; string[] userIds = values.Split(','); TasksDAL.CreateTask(Request.Form["taskName"], Request.Form["description"], start, end, int.Parse(Request.Form["estimation"]), Request.Form["status"], userIds); } return(RedirectToAction("Task", "Admin")); } catch (Exception ex) { return(View()); } }
public static void CreateTask(TodoTask task) { task.CreatedDate = DateTime.Now; task.Status = TodoTaskStatus.New; TasksDAL.CreateTask(task); }
public static int CreateTask(TasksDTO task, List <int> arrUser, int ownerId) { return(TasksDAL.CreateTask(task, arrUser, ownerId)); }