private void BindGrid1(int pageIndex) { CommonHelper com = new CommonHelper(); DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); SqlParameter[] paras = { new SqlParameter("@stime", stime1.Text.ToString()), new SqlParameter("@etime", etime1.Text.ToString()), new SqlParameter("@uid", Session["userId"].ToString()), }; sb.Append("owe_id is not null and owe_stime>=@stime and owe_etime<=@etime and u_id=@uid"); try { GCGrid.RecordCount = com.getDataCount("web_owe ", sb.ToString(), DB_JOB, paras); dt = com.getDataList(pageIndex, GCGrid.PageSize, "web_owe", "*", "owe_id", sb.ToString(), "order by owe_ID desc", DB_JOB, paras); } catch (Exception ex) { Alert.Show(ex.Message); return; } if (pageIndex == 0) { GCGrid.PageIndex = 0; } GCGrid.DataSource = dt; GCGrid.DataBind(); }
private void BindGrid(int pageIndex) { CommonHelper com = new CommonHelper(); DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); sb.Append("duty_id is not null"); try { GCGrid.RecordCount = com.getDataCount("web_duty ", sb.ToString(), DB_JOB); dt = com.getDataList(pageIndex, GCGrid.PageSize, "web_duty", "*", "duty_id", sb.ToString(), "order by duty_id desc", DB_JOB); } catch (Exception ex) { Alert.Show(ex.Message); return; } if (pageIndex == 0) { GCGrid.PageIndex = 0; } GCGrid.DataSource = dt; GCGrid.DataBind(); }
private void BindGrid(int pageIndex) { CommonHelper com = new CommonHelper(); DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); sb.Append("u_id is not null and u_type=1"); try { GCGrid.RecordCount = com.getDataCount("web_usr", sb.ToString(), DB_JOB); dt = com.getDataList(pageIndex, GCGrid.PageSize, "web_usr", "u_id,u_name,u_truename,u_mail,u_phone,u_address,(case u_type when '0' then '业主' when '1' then '物业管理员' end) as type,thisIP,thisTime", "u_id", sb.ToString(), "order by u_id desc", DB_JOB); } catch (Exception ex) { Alert.Show(ex.Message); return; } if (pageIndex == 0) { GCGrid.PageIndex = 0; } GCGrid.DataSource = dt; GCGrid.DataBind(); }