Пример #1
0
        public ActionResult GetDepartment(DataSourceLoadOptions loadOptions, DepartmentCriteriaCombo criteria)
        {
            criteria.userCode = UserDetail.UserID;
            List <DepartmentCombo> departmentCombo = this.CommonService.GetDepartmentCombo(criteria);

            if ((criteria.IncludeAll ?? false) == true)
            {
                departmentCombo.Insert(0, new DepartmentCombo()
                {
                    DeptCodeKey = ConstantValues.AllValue, DeptName = ConstantValues.AllDisplay
                });
            }

            return(Content(JsonConvert.SerializeObject(DataSourceLoader.Load(departmentCombo, loadOptions)), ConstantValues.JSON_CONTENT_TYPE));
        }
Пример #2
0
        public List <DepartmentCombo> GetDepartmentCombo(DepartmentCriteriaCombo criteria)
        {
            using (CommonEntities Context = new CommonEntities())
            {
                var result = Context.GetDepartmentCombo(
                    prodDate: criteria.ProdDate
                    , prodDateFrom: criteria.ProdDateFrom
                    , prodDateTo: criteria.ProdDateTo
                    , divCodeKey: criteria.DivCodeKey
                    , deptCodeKey: criteria.DeptCodeKey
                    , userCode: criteria.userCode
                    , isActiveOnly:  criteria.IsActiveOnly
                    ).ToList();

                return(result);
            }
        }