示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public ActionResult CreateProject()
 {
     var model = new ProjectViewModel { Project = new Project() };
     FillAdditionalProperties(model);
     return View("EditProject", model);
 }
示例#4
0
 public ActionResult EditProject(int id)
 {
     var model = new ProjectViewModel { Project = bll.ProjectManager.SelectProject(id) };
     FillAdditionalProperties(model);
     return View(model);
 }
示例#5
0
 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";
 }