public ActionResult AddPlanItem(Guid projectID, string name, string detail, int category) { var pic = new PlanItemCreate(projectID); pic.Name = name; pic.Detail = detail; pic.Category = category; return(RedirectToAction("Create", "PlanItem", new { model = pic })); }
public ActionResult Create(PlanItemCreate model) { if (!ModelState.IsValid) { return(View(model)); } var service = CreateService(); if (service.CreatePlanItem(model)) { TempData["SaveResult"] = "Your PlanItem was created."; return(RedirectToAction("Details", "Project", new { id = model.ProjectID })); } return(View(model)); }
public bool CreatePlanItem(PlanItemCreate model) { PlanItem entity = new PlanItem { PlanItemID = Guid.NewGuid(), Name = model.Name, Details = model.Detail, ProjectID = model.ProjectID, Category = model.Category, CreatorID = _userId, LastModifiedBy = _userId, CreatedUTC = DateTimeOffset.Now, ModifiedUTC = null }; UpdateProjectModifiedDate(model.ProjectID); Context.PlanItems.Add(entity); return(Context.TrySave()); }
public ActionResult Create(Guid projectID, bool b) { var model = new PlanItemCreate(projectID); return(View(model)); }