Beispiel #1
0
        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);
        }
Beispiel #2
0
        public IEnumerable <qtDepartment> DanhSachDepartment_TheoDonVi(int?UnitId)
        {
            qtDepartmentService        _department  = new qtDepartmentService();
            IEnumerable <qtDepartment> dsDepartment = _department.FindList();

            if (UnitId.HasValue && UnitId.Value > 0)
            {
                dsDepartment = dsDepartment.Where(x => x.UnitId == UnitId);
            }

            return(dsDepartment);
        }
Beispiel #3
0
        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);
        }