예제 #1
0
        public static object GetCurrencyByFilter(SessionInfo sessioninfo, string name, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            try
            {
                //Return result to jTable
                LookupBusiness _lookupbusiness = new LookupBusiness();
                //Get data from database
                List <MA_CURRENCY> currencies = _lookupbusiness.GetCurrencyByFilter(sessioninfo, name, jtSorting);

                //Return result to jTable
                return(new
                {
                    Result = "OK",
                    Records = jtPageSize > 0 ? currencies.Skip(jtStartIndex).Take(jtPageSize).ToList() : currencies,
                    TotalRecordCount = currencies.Count
                });
            }
            catch (BusinessWorkflowsException bex)
            {
                return(new { Result = "ERROR", Message = bex.Message });
            }
            catch (Exception ex)
            {
                return(new { Result = "ERROR", Message = ex.Message });
            }
        }
예제 #2
0
        public static object GetCurrencyByFilter(SessionInfo sessioninfo, string name, int jtStartIndex, int jtPageSize, string jtSorting)
        {
            try
            {
                //Return result to jTable
                LookupBusiness _lookupbusiness = new LookupBusiness();
                //Get data from database
                List<MA_CURRENCY> currencies = _lookupbusiness.GetCurrencyByFilter(sessioninfo, name, jtSorting);

                //Return result to jTable
                return new
                {
                    Result = "OK",
                    Records = jtPageSize > 0 ? currencies.Skip(jtStartIndex).Take(jtPageSize).ToList() : currencies,
                    TotalRecordCount = currencies.Count
                };
            }
            catch (BusinessWorkflowsException bex)
            {
                return new { Result = "ERROR", Message = bex.Message };
            }
            catch (Exception ex)
            {
                return new { Result = "ERROR", Message = ex.Message };
            }
        }