Ejemplo n.º 1
0
        public static object GetSpotRateByFilter(SessionInfo sessioninfo, string processdate, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            try
            {
                LookupBusiness _lookupbusiness = new LookupBusiness();
                //Get data from database
                List <MA_SPOT_RATE> SpotRates = _lookupbusiness.GetSpotRateByFilter(sessioninfo, processdate, jtSorting);

                //var jsonData = (from s in SpotRates
                //                select new
                //                {
                //                    ID = s.ID,
                //                    CurrencyLabel = s.MA_CURRENCY.LABEL,
                //                    Proc_date = s.PROC_DATE,
                //                    Rate = s.RATE
                //                }).ToList();
                //Return result to jTable
                return(new
                {
                    Result = "OK",
                    Records = jtPageSize > 0 ? SpotRates.Skip(jtStartIndex).Take(jtPageSize).ToList() : SpotRates,
                    TotalRecordCount = SpotRates.Count
                });
            }
            catch (BusinessWorkflowsException bex)
            {
                return(new { Result = "ERROR", Message = bex.Message });
            }
            catch (Exception ex)
            {
                return(new { Result = "ERROR", Message = ex.Message });
            }
        }
Ejemplo n.º 2
0
        public static object GetSpotRateByFilter(SessionInfo sessioninfo, string processdate, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            try
            {

                LookupBusiness _lookupbusiness = new LookupBusiness();
                //Get data from database
                List<MA_SPOT_RATE> SpotRates = _lookupbusiness.GetSpotRateByFilter(sessioninfo, processdate, jtSorting);

                //var jsonData = (from s in SpotRates
                //                select new
                //                {
                //                    ID = s.ID,
                //                    CurrencyLabel = s.MA_CURRENCY.LABEL,
                //                    Proc_date = s.PROC_DATE,
                //                    Rate = s.RATE
                //                }).ToList();
                //Return result to jTable
                return new
                {
                    Result = "OK",
                    Records = jtPageSize > 0 ? SpotRates.Skip(jtStartIndex).Take(jtPageSize).ToList() : SpotRates,
                    TotalRecordCount = SpotRates.Count
                };
            }
            catch (BusinessWorkflowsException bex)
            {
                return new { Result = "ERROR", Message = bex.Message };
            }
            catch (Exception ex)
            {
                return new { Result = "ERROR", Message = ex.Message };
            }
        }