Exemple #1
0
        private void GetMagList()
        {
            string sql = "";
            int iStart = 0;
            try
            {
                iStart = int.Parse(HttpContext.Current.Request["pageIndex"].ToString()) * int.Parse(HttpContext.Current.Request["pageSize"].ToString());
            }
            catch { }
            int iLimit = 20;
            try
            {
                iLimit = int.Parse(HttpContext.Current.Request["pageSize"].ToString());
            }
            catch { }

            string ProdCode = string.Empty;
            try
            {

                ProdCode = HttpUtility.UrlDecode(HttpContext.Current.Request["ProdCode"].ToString());
            }
            catch
            { }
            if (!string.IsNullOrEmpty(ProdCode))
            {
                sql += "and ProdCode like '%" + ProdCode + "%' ";
            }

            string ProdName = string.Empty;
            try
            {

                ProdName = HttpUtility.UrlDecode(HttpContext.Current.Request["ProdName"].ToString());
            }
            catch
            { }
            if (!string.IsNullOrEmpty(ProdName))
            {
                sql += "and ProdName like '%" + ProdName + "%' ";
            }

            string SupName = string.Empty;
            try
            {

                SupName = HttpUtility.UrlDecode(HttpContext.Current.Request["SupName"].ToString());
            }
            catch
            { }
            if (!string.IsNullOrEmpty(SupName))
            {
                sql += "and SupName like '%" + SupName + "%' ";
            }

            string TypeName = string.Empty;
            try
            {

                TypeName = HttpUtility.UrlDecode(HttpContext.Current.Request["TypeName"].ToString());
            }
            catch
            { }
            if (!string.IsNullOrEmpty(TypeName))
            {
                sql += "and TypeName like '%" + TypeName + "%' ";
            }

            ProdListFactory bll = new ProdListFactory();
            HttpContext.Current.Response.Write(bll.GetMagList(sql, iStart, iLimit));
        }