Esempio n. 1
0
        /// <summary>
        /// Gets inflation index rates list by inflation index Id
        /// </summary>
        /// <param name="param">The params</param>
        /// <param name="inflationIndexId">Inflation Index Id</param>
        /// <returns>inflation index rate list</returns>
        public ActionResult GetInflationIndexRateListById(MODEL.jQueryDataTableParamModel param, int inflationIndexId)
        {
            try
            {
                InflationIndexRateService   inflationIndexRateService = new InflationIndexRateService();
                List <InflationIndexRateVO> inflationIndexRateVOList  = inflationIndexRateService.GetInflationIndexRateListById(inflationIndexId);

                List <MODEL.InflationIndexRate> inflationIndexRateList = new List <MODEL.InflationIndexRate>();
                if (inflationIndexRateVOList != null)
                {
                    foreach (InflationIndexRateVO inflationIndexRateVO in inflationIndexRateVOList)
                    {
                        inflationIndexRateList.Add(new MODEL.InflationIndexRate(inflationIndexRateVO));
                    }
                }

                //get the field on with sorting needs to happen and set the
                //ordering function/delegate accordingly.
                int sortColumnIndex  = Convert.ToInt32(Request["iSortCol_0"]);
                var orderingFunction = GetInflationIndexRateOrderingFunction(sortColumnIndex);

                var result = GetFilteredObjects(param, inflationIndexRateList, orderingFunction);
                return(result);
            }
            catch (Exception e)
            {
                return(new HttpStatusCodeAndErrorResult(500, e.Message));
            }
        }