コード例 #1
0
        public static object GetProductByFilter(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_PRODUCT> products = _lookupbusiness.GetProductByFilter(sessioninfo, name, jtSorting);

                //Return result to jTable
                return(new { Result = "OK",
                             Records = jtPageSize > 0 ? products.Skip(jtStartIndex).Take(jtPageSize).ToList() : products,
                             TotalRecordCount = products.Count });
            }
            catch (BusinessWorkflowsException bex)
            {
                return(new { Result = "ERROR", Message = bex.Message });
            }
            catch (Exception ex)
            {
                return(new { Result = "ERROR", Message = ex.Message });
            }
        }
コード例 #2
0
ファイル: LookupUIP.cs プロジェクト: Theeranit/DealMarker
        public static object GetProductByFilter(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_PRODUCT> products = _lookupbusiness.GetProductByFilter(sessioninfo, name, jtSorting);

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