private void BindData() { if (Session["UserID"] != null) { string UserID = Session["UserID"].ToString(); string Unit = UserBll.GetUnitByUserID(UserID); if (Unit != "") { DataSet ds = new DataSet(); PagedDataSource pds = new PagedDataSource(); ds = Bll.GetListByMishuAuditPri(Unit); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; pds.AllowPaging = true; pds.PageSize = AspNetPager1.PageSize; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.DataSource = ds.Tables[0].DefaultView; GridView1.DataSource = pds; GridView1.DataKeyNames = new string[] { "PK_AID" }; GridView1.DataBind(); flag = 0; Session["flag"] = 0; } } else { Response.Redirect("~/login.aspx"); } }
private void BindData() { if (Session["UserID"] != null) { string userID = Session["UserID"].ToString(); string unit = UserBll.GetUnitByUserID(userID); if (unit != "") { DataSet ds = new DataSet(); PagedDataSource pds = new PagedDataSource(); ds = Bll.GetListByMishuAudit(unit); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; pds.AllowPaging = true; pds.PageSize = AspNetPager1.PageSize; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.DataSource = ds.Tables[0].DefaultView; GridView1.DataSource = pds; GridView1.DataKeyNames = new string[] { "PK_AID" }; GridView1.DataBind(); } } else { Response.Write("<script language=javascript>alert('您已经与服务器断开连接,请重新登录!');window.location.href='~/../../login.aspx';</script>"); } }
void BindInformation() { if (Session["UserID"] != null) { DataSet ds = new DataSet(); string userid = Session["UserID"].ToString(); string Unit = UserBll.GetUnitByUserID(userid); string lwSql = " where UserUnit='" + Unit + "' and SmallSort='学术论文' and AuditState in (5,7)"; //学术论文类 string zzSql = " where UserUnit='" + Unit + "' and SmallSort in ('学术著作','教材') and AuditState in (5,7)"; //学术著作 string ProjectSql = " where UserUnit='" + Unit + "' and SmallSort='科研项目' and AuditState in (5,7)"; //科研项目 string OtherSql = " where UserUnit='" + Unit + "' and SmallSort not in ('学术论文','学术著作','教材','科研项目') and AuditState in (5,7)"; //其他 int lwCounts = Int32.Parse(Bll.GetCountByMishuAch(lwSql)) + Int32.Parse(Bll.GetCountByMishuLw(lwSql)) + Int32.Parse(Bll.GetCountByMishuPro(lwSql)); int zzCounts = Int32.Parse(Bll.GetCountByMishuAch(zzSql)) + Int32.Parse(Bll.GetCountByMishuLw(zzSql)) + Int32.Parse(Bll.GetCountByMishuPro(zzSql)); int ProjectCounts = Int32.Parse(Bll.GetCountByMishuAch(ProjectSql)) + Int32.Parse(Bll.GetCountByMishuLw(ProjectSql)) + Int32.Parse(Bll.GetCountByMishuPro(ProjectSql)); int OtherCounts = Int32.Parse(Bll.GetCountByMishuAch(OtherSql)) + Int32.Parse(Bll.GetCountByMishuLw(OtherSql)) + Int32.Parse(Bll.GetCountByMishuPro(OtherSql)); if (Session["flag"].ToString() == "0") { lb_Information.Visible = true; lb_Information.Text = "单位名称:(盖章):" + Unit + "\t单位汇总:学术论文" + lwCounts + "篇\t学术著作(教材)" + zzCounts + "篇\t科研项目" + ProjectCounts + "篇\t其他" + OtherCounts + "篇"; ds = Bll.GetListByMishuPrint(Unit); } else if (Session["flag"].ToString() == "1" && Session["ds"] != null) { ds = (DataSet)Session["ds"]; lb_Information.Visible = false; } GV_Print.DataSource = ds.Tables[0].DefaultView; GV_Print.DataKeyNames = new string[] { "PK_AID" }; GV_Print.DataBind(); } else { Response.Redirect("~/login.aspx"); } }