// GET: /Admin/Project/Create
        public ActionResult Create()
        {
            BCWeb.Areas.Admin.Models.Projects.ViewModel.ProjectEditModel viewModel = new BCWeb.Areas.Admin.Models.Projects.ViewModel.ProjectEditModel();

            viewModel.States = _service.GetStates().Select(s => new SelectListItem { Text = s.Abbr, Value = s.Id.ToString() });
            viewModel.ProjectTypes = Util.CreateSelectListFromEnum(typeof(ProjectType));
            viewModel.ProjectCategories = Util.CreateSelectListFromEnum(typeof(ProjectCategory));
            viewModel.ConstructionTypes = _service.GetConstructionTypes().Select(c => new SelectListItem { Text = c.Name, Value = c.Id.ToString() });
            viewModel.BuildingTypes = _service.GetBuildingTypes().Select(b => new SelectListItem { Text = b.Name, Value = b.Id.ToString() });
            viewModel.Architects = _service.GetArchitects().Select(a => new SelectListItem { Text = a.CompanyName + " - " + (a.StateId.HasValue ? a.State.Abbr : "N/A"), Value = a.Id.ToString() });
            viewModel.CreatedBy = _service.GetArchitectsAndGenContractorUsers().OrderBy(u => u.Company.CompanyName).Select(u => new SelectListItem { Text = u.Company.CompanyName + " --- " + u.Email, Value = u.UserId.ToString() });

            return View(viewModel);
        }
 public ActionResult Edit(int id)
 {
     var raw = _service.Get(id);
     BCWeb.Areas.Admin.Models.Projects.ViewModel.ProjectEditModel viewModel = new BCWeb.Areas.Admin.Models.Projects.ViewModel.ProjectEditModel
     {
         Address = raw.Address == null ? "" : raw.Address,
         ArchitectId = raw.ArchitectId,
         BidDateTime = raw.BidDateTime,
         BuildingTypeId = raw.BuildingTypeId,
         City = raw.City,
         ConstructionTypeId = raw.ConstructionTypeId,
         CreatedById = raw.CreatedById,
         Description = raw.Description,
         Id = raw.Id,
         Number = raw.Number,
         PostalCode = raw.PostalCode,
         ProjectCategory = raw.ProjectCategory,
         ProjectType = raw.ProjectType,
         SelectedScope = raw.Scopes.Select(s => s.ScopeId).ToArray(),
         StateId = raw.StateId,
         Title = raw.Title,
         WalkThruDateTime = raw.WalkThruDateTime,
         WalkThruStatus = raw.WalkThruStatus
     };
     rePopVieModel(viewModel);
     return View(viewModel);
 }