public ActionResult CreateToDo(TO_DO toDo) { using (var context = new ToDoEntities()) { context.ADD_TO_DO(toDo.Name, toDo.Description, toDo.Deadline, toDo.Status, toDo.UserID); TempData["Message"] = "Success"; } return(RedirectToAction("ToDoList", "Admin")); }
public ActionResult CreateToDo(TO_DO toDo) { string usrname = User.Identity.Name; using (var context = new ToDoEntities()) { var usrid = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()); context.ADD_TO_DO(toDo.Name, toDo.Description, toDo.Deadline, toDo.Status, usrid); TempData["Message"] = "Success"; } return(RedirectToAction("ToDoList", "Home")); }
public void CreateToDo() { // Arrange AdminController controller = new AdminController(); TO_DO td = new TO_DO { Name = "Example ToDo", Description = "Example Description", Deadline = new DateTime(2019, 06, 25), Status = 1, UserID = Guid.Parse("0797F007-813A-455C-BF42-5D8BE5DE34A7") }; // Act ViewResult result = controller.CreateToDo(td) as ViewResult; ToDoEntities tden = new ToDoEntities(); var expecting = tden.TO_DO.Where(x => x.Name == td.Name && x.Description == td.Description).FirstOrDefault(); // Assert Assert.IsNotNull(expecting); }
public DataRowIntention(TO_DO to_do) { this.to_do = to_do; }
public DataRowIntention(TO_DO to_do) { this.to_do = to_do; }