public IActionResult Edit(Logica.Models.BindingModel.ProjectEditBindingModel model) { if (ModelState.IsValid) { Logica.BL.Projects projects = new Logica.BL.Projects(); projects.UpdateProject(model.Id, model.Title, model.Details, model.ExpectedCompletionDate); return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult Edit(int id) { Logica.BL.Projects projects = new Logica.BL.Projects(); var result = projects.GetProjects(id, null).FirstOrDefault(); var projectEditModel = new Logica.Models.BindingModel.ProjectEditBindingModel { Id = result.Id, Details = result.Details, Title = result.Title, ExpectedCompletionDate = result.ExpectedCompletionDate.Value }; return(View(projectEditModel)); }