예제 #1
0
        public ActionResult GetDivision(DataSourceLoadOptions loadOptions, DivisionCriteriaCombo criteria)
        {
            criteria.userCode = UserDetail.UserID;
            List <DivisionCombo> divisionCombo = this.CommonService.GetDivisionCombo(criteria);

            if ((criteria.IncludeAll ?? false) == true)
            {
                divisionCombo.Insert(0, new DivisionCombo()
                {
                    DivCodeKey = ConstantValues.AllValue, DivName = ConstantValues.AllDisplay
                });
            }

            return(Content(JsonConvert.SerializeObject(DataSourceLoader.Load(divisionCombo, loadOptions)), ConstantValues.JSON_CONTENT_TYPE));
        }
예제 #2
0
        public List <DivisionCombo> GetDivisionCombo(DivisionCriteriaCombo criteria)
        {
            using (CommonEntities Context = new CommonEntities())
            {
                var result = Context.GetDivisionCombo(
                    prodDate: criteria.ProdDate
                    , prodDateFrom: criteria.ProdDateFrom
                    , prodDateTo: criteria.ProdDateTo
                    , divCodeKey: criteria.DivCodeKey
                    , userCode: criteria.userCode
                    , isActiveOnly: criteria.IsActiveOnly
                    ).ToList();

                return(result);
            }
        }