Exemplo n.º 1
0
        private void GetMagList()
        {
            string sql = "and IsDeleted = 0 ";
            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 TypeCode = string.Empty;
            try
            {

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

            string TypeName = string.Empty;
            try
            {

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

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