Пример #1
0
        public JsonResult QueryProductSelectList(string productfamily, string product, int page)
        {
            if (product == null)
            {
                product = string.Empty;
            }


            string sql = @"select * from (select PRODUCTNAME id, PRODUCTNAME text, count(*) 
over() as totalCount,row_number()  over (order by PRODUCTNAME) as rn from fwproductversion  where PRODUCTNAME like '" + product.Replace("'", "''") + "%' {0} GROUP BY PRODUCTNAME) where rn >" +
                         (page - 1) * 10 + " and rn <" + page * 10;
            string filter = string.Empty;

            if (!string.IsNullOrWhiteSpace(productfamily))
            {
                filter = string.Format(" AND ProductFamily in ('{0}') ", productfamily);
            }

            sql = string.Format(sql, filter);
            return(Json(_CommonLogic.QuerySelectList("HiDM.Reporting.DataAccess", sql)));
        }