public void UpdateAgileTask() { _agileTodoTaskModel[0].Description = "Updated"; ToDoTask _toDoTask = new ToDoTask(); TodoTaskModel _todoTaskModel = _toDoTask.Save(_agileTodoTaskModel[0]); Assert.AreNotEqual(null, _todoTaskModel); }
//[Authorize] //[ValidateAntiForgeryToken] public JsonResult UpdateNormalTask(NormalTodoTaskModel todoTaskModel) { todoTaskModel.IsActive = true; todoTaskModel.UpdatedDate = DateTime.Now; //Need to change todoTaskModel.UpdatedBy = ((Models.User)Session["User"]).Id; todoTaskModel.UserId = ((Models.User)Session["User"]).Id; ToDoTask toDoTask = new ToDoTask(); toDoTask.SetToDoTaskStrategy(new NormalTask()); TodoTaskModel _normalTodoTaskModel = toDoTask.Save(todoTaskModel); return(Json(_normalTodoTaskModel, JsonRequestBehavior.AllowGet)); }
public JsonResult InsertNormalTask(NormalTodoTaskModel todoTaskModel) { todoTaskModel.Id = Guid.NewGuid(); todoTaskModel.IsActive = true; todoTaskModel.CreatedDate = DateTime.Now; todoTaskModel.CreatedBy = Guid.Parse(HttpContext.User.Identity.Name.Split('$')[1]); todoTaskModel.UserId = Guid.Parse(HttpContext.User.Identity.Name.Split('$')[1]); todoTaskModel.ProjectId = AppSettings.NormalProjectId; ToDoTask toDoTask = new ToDoTask(); toDoTask.SetToDoTaskStrategy(new NormalTask()); TodoTaskModel normalTodoTaskModel = toDoTask.Save(todoTaskModel); return(Json(normalTodoTaskModel, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdateNormalTask(NormalTodoTaskModel todoTaskModel) { todoTaskModel.IsActive = true; todoTaskModel.UpdatedDate = DateTime.Now; string[] dateParts = todoTaskModel.CreatedDateString.Split('/'); if (dateParts.Length > 0) { todoTaskModel.CreatedDate = Convert.ToDateTime(dateParts[1] + "/" + dateParts[0] + "/" + dateParts[2]); } todoTaskModel.UpdatedBy = Guid.Parse(HttpContext.User.Identity.Name.Split('$')[1]); todoTaskModel.UserId = Guid.Parse(HttpContext.User.Identity.Name.Split('$')[1]); ToDoTask toDoTask = new ToDoTask(); toDoTask.SetToDoTaskStrategy(new NormalTask()); TodoTaskModel normalTodoTaskModel = toDoTask.Save(todoTaskModel); return(Json(normalTodoTaskModel, JsonRequestBehavior.AllowGet)); }