public qtDepartment ThemMoi_HieuChinhDepartment(int DepartmentId, string DepartmentName, string Address, string Phone, string Fax, string Email, int?UnitId, int?SortOrder, bool?Status, DateTime?CreatedDate) { qtDepartmentService _department = new qtDepartmentService(); qtDepartment department = new qtDepartment(); if (DepartmentId > 0) { department = _department.FindByKey(DepartmentId); } department.DepartmentName = DepartmentName; department.Address = Address; department.Phone = Phone; department.Fax = Fax; department.Email = Email; department.UnitId = UnitId; department.SortOrder = SortOrder; department.Status = Status; department.CreatedDate = CreatedDate; if (DepartmentId > 0) { _department.Update(department); } else { _department.Insert(department); } return(department); }
public string DepartmentName(int?DepartmentId) { string DepartmentName = string.Empty; if (DepartmentId.HasValue) { qtDepartmentService _departmentService = new qtDepartmentService(); qtDepartment department = _departmentService.FindByKey(DepartmentId); if (department != null) { return(department.DepartmentName); } return(DepartmentName); } return(DepartmentName); }