//[MenuHightlight(CurrentItem = "depart_tt", CurrentParentItem = "user_home")] public ActionResult Create() { var areas = _areaService.Get(properties: new[] { "Id", "AreaName" }).Select(p => new SelectListItem { Text = p.AreaName, Value = p.Id.ToString(), }).ToList(); ViewData["Areas"] = areas; var expression = new[] { new ExpressionCriteria{ PropertyName = "DEPT_INFO_ISDEL", Value = 0, Operate = Operator.Equal }, }; var deps = _departmentService.Get(expression).Select(p => new SelectListItem { Text = p.Name, Value = p.Id.ToString(), }).ToList(); ViewData["Departments"] = deps; var item = new DepartmentContract() { Id = Guid.NewGuid(), CreatedBy = CurrentUser.UserName }; return View(new DepartmentViewModel(item)); }
public DepartmentViewModel(DepartmentContract contract) { DepartmentContract = contract; }