//[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 static BASE_DEPARTMENT_INFO ToEntity(this DepartmentContract source) { if (source == null) { throw new InvalidOperationException("source is null"); } return(new BASE_DEPARTMENT_INFO { DEPT_INFO_ID = source.Id, DEPT_INFO_NAME = source.Name, PARENT_ID = source.ParentId, DEPT_INFO_CODE = source.Code, DEPT_INFO_ADDRESS = source.Address, DEPT_INFO_PRINCIPALMAN = source.PrincipalMan, DEPT_INFO_TEL = source.Tel, DEPT_INFO_FAX = source.Fax, DEPT_INFO_MAIL = source.Mail, DEPT_INFO_CAPACITY = source.Capacity, GEO_INFO_ID = source.AreaId, DEPT_INFO_CREATEDBY = source.CreatedBy, DEPT_INFO_CREATEDDATE = source.CreatedTime, DEPT_INFO_ISDEL = source.IsDel, DEPT_INFO_ISSUP = source.DeptInfoIssup, SUP_ADD_ZC = source.SupAddZc, SUP_PROJECT = source.SupProject, SUP_XZ = source.SupXz, SUP_ZJ = source.SupZj }); }
public void Update(DepartmentContract dto) { Information.Department = dto.Department; Information.ContactPerson = dto.ContactPerson; Information.MainUrl = dto.MainUrl; Information.NutsCodes = dto.NutsCodes; Information.PostalAddress = dto.PostalAddress; Information.TelephoneNumber = dto.TelephoneNumber; Information.ValidationState = dto.ValidationState; Information.Email = dto.Email; ContractingAuthorityType = dto.ContractingAuthorityType; OtherContractingAuthorityType = dto.OtherContractingAuthorityType; ContractingType = dto.ContractingType; MainActivity = dto.MainActivity; OtherMainActivity = dto.OtherMainActivity; MainActivityUtilities = dto.MainActivityUtilities; }
public DepartmentViewModel(DepartmentContract contract) { DepartmentContract = contract; }