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)); }
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); } }