public ActionResult Item(int id) { var model = new ProjectViewModel { Project = bll.ProjectManager.SelectProject(id), ServicedApplicationCategories = bll.ProjectManager.SelectServicedApplicationCategories(), ServicedIndustries = bll.ProjectManager.SelectServicedIndustries(), Technologies = bll.DictManager.SelectDicts("Technology", string.Empty) }; return View(model); }
public ActionResult EditProject([Bind(Prefix = "Project")]Project item, IEnumerable<string> technologies) { if (ModelState.IsValid) { if (item.Id != 0) { bll.ProjectManager.UpdateProject(item, technologies); } else { bll.ProjectManager.InsertProject(item, technologies); } TempData["message"] = new AlertMessage(string.Format("{0} has been saved", item.Name)); return RedirectToAction("Projects"); } else { var model = new ProjectViewModel { Project = item }; FillAdditionalProperties(model); return View(model); } }
public ActionResult CreateProject() { var model = new ProjectViewModel { Project = new Project() }; FillAdditionalProperties(model); return View("EditProject", model); }
public ActionResult EditProject(int id) { var model = new ProjectViewModel { Project = bll.ProjectManager.SelectProject(id) }; FillAdditionalProperties(model); return View(model); }
private void FillAdditionalProperties(ProjectViewModel model) { model.Categories = bll.DictManager.SelectDicts("Category"); model.Customers = bll.CustomerManager.SelectCustomers(); model.TechnologyDicts = bll.DictManager.SelectDicts("Technology"); ViewBag.DictColumnsType = "Technology"; }