public DataTable getNewsDt() { SQLHelper_ db = new SQLHelper_(); string pagesize = PagerMember.PageSize.ToString(); string curpage = pg.request(PagerMember.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "10"; } if (curpage == "") { curpage = "1"; } string sql = @"SELECT * FROM " + com.tablePrefix + "Members ORDER BY RegTime DESC"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); PagerMember.RecordCount = rowCount; if (rowCount == 0) { PagerMember.Visible = false; } return(dt); }
public DataTable getNewsDt() { lbid = hlbid.Value; SQLHelper_ db = new SQLHelper_(); try { if (Pager1 == null) { Response.Write("2.1 Pager1 == null。"); } if (Pager1.PageSize == null) { Response.Write("2.2 Pager1.PageSize == null。"); } string pagesize = Pager1.PageSize.ToString(); string curpage = pg.request(Pager1.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "20"; } if (curpage == "") { curpage = "1"; } string sql = @"SELECT NewsID,Title,Pic,Description,OrderId FROM " + com.tablePrefix + @"News WHERE lbid=" + lbid; sql += " ORDER BY title"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager1.RecordCount = rowCount; if (rowCount == 0) { Pager1.Visible = false; } return(dt); } catch (NullReferenceException ex) { Response.Write("2. " + ex.Message + "。"); //Response.End(); return(new DataTable()); } }
public void bindGv(bool addNewRow) { lbid = hlbid.Value; SQLHelper_ db = new SQLHelper_(); string pagesize = Pager2.PageSize.ToString(); string curpage = pg.request(Pager2.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "5"; } if (curpage == "") { curpage = "1"; } string sql = @"SELECT * FROM " + com.tablePrefix + @"News WHERE lbid=" + lbid; sql += " ORDER BY isTop DESC,IsIndex DESC,EditTime DESC"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager2.RecordCount = rowCount; if (rowCount == 0) { Pager2.Visible = false; } if (addNewRow) { DataRow newRow = dt.NewRow(); dt.Rows.Add(newRow); } GV.DataSource = dt.DefaultView; GV.DataBind(); }
public DataTable getNewsDt() { SQLHelper_ db = new SQLHelper_(); try { string pagesize = Pager1.PageSize.ToString(); string curpage = pg.request(Pager1.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "10"; } if (curpage == "") { curpage = "1"; } string sql = "SELECT Id,LbName FROM DXLb WHERE IsDeleted=0 "; if (ddlLbid.SelectedValue.Length > 0) { sql += " AND ParentId=" + ddlLbid.SelectedValue; } sql += " ORDER BY OrderId"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager1.RecordCount = rowCount; //if (rowCount == 0) Pager1.Visible = false; return(dt); } catch (NullReferenceException ex) { Response.Write("2. " + ex.Message + "。"); //Response.End(); return(new DataTable()); } }
public DataTable getNewsDt() { productid = hlbid.Value; SQLHelper_ db = new SQLHelper_(); string pagesize = Pager0.PageSize.ToString(); string curpage = pg.request(Pager0.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "20"; } if (curpage == "") { curpage = "1"; } string sql = @"SELECT c.imgTypeName,b.ColorValue,b.ColorName ,SUBSTRING((''000''+CONVERT(varchar,b.OrderId)),LEN(''000''+CONVERT(varchar,b.OrderId))-2,3)+''-''+b.ColorName AS ColorText ,a.* FROM " + com.tablePrefix + @"News a LEFT JOIN " + com.tablePrefix + @"Color b ON a.colorId=b.id LEFT JOIN " + com.tablePrefix + @"ProductImgType c ON c.id =a.pro_imgTypeid WHERE a.ParentNewsID=" + productid; sql += " ORDER BY a.OrderId"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager0.RecordCount = rowCount; if (rowCount == 0) { Pager0.Visible = false; } return(dt); }
public DataTable getNewsDt() { SQLHelper_ db = new SQLHelper_(); try { string pagesize = Pager1.PageSize.ToString(); string curpage = pg.request(Pager1.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "10"; } if (curpage == "") { curpage = "1"; } string sql = "SELECT id,name,OrderId,JianCheng FROM " + com.tablePrefix + "province WHERE 1=1 "; sql += " ORDER BY OrderId"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager1.RecordCount = rowCount; //if (rowCount == 0) Pager1.Visible = false; return(dt); } catch (NullReferenceException ex) { Response.Write("2. " + ex.Message + "。"); //Response.End(); return(new DataTable()); } }
public DataTable getNewsDt() { lbid = hlbid.Value; SQLHelper_ db = new SQLHelper_(); string pagesize = Pager0.PageSize.ToString(); string curpage = pg.request(Pager0.PagePara); string pageCount = "";//总页数 int rowCount = 0; if (pagesize == "") { pagesize = "10"; } if (curpage == "") { curpage = "1"; } string sql = @"SELECT * FROM " + com.tablePrefix + @"News WHERE ParentNewsID=" + lbid; sql += " ORDER BY isTop DESC,IsIndex DESC,AddTime DESC"; sql = "exec sp_GetPageData '" + sql + "'," + curpage + "," + pagesize; db.sql = sql; DataSet ds = db.Get_DataSet(); DataTable dt = ds.Tables[2]; pageCount = ds.Tables[1].Rows[0]["COUNTPAGE"].ToString(); rowCount = Int32.Parse(ds.Tables[1].Rows[0]["ROWCOUNT"].ToString()); Pager0.RecordCount = rowCount; if (rowCount == 0) { Pager0.Visible = false; } return(dt); }