private void DataPlay(int PageNo) { //得到当前页号 this.curpage.Text = PageNo.ToString(); HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; DataTable dt = new DataTable(); if (txtmid.Text == "dbsy") { dt = Hyoa_dbsy.Getdbsys_db(Session["hyuid"].ToString()); } if (txtmid.Text == "dysy") { dt = Hyoa_dbsy.Getdbsys_dy(Session["hyuid"].ToString()); } if (txtmid.Text == "ybsy") { dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString()); } if (txtmid.Text == "yysy") { dt = Hyoa_dbsy.Getdbsys_yy(Session["hyuid"].ToString()); } //电子邮件 if (this.Request.QueryString["mid"] == "mail") { //收件箱 if (this.Request.QueryString["tableid"].ToString() == "sjx") { sql = "select * from hyt_mail where hy_jsrid='" + Session["hyuid"].ToString() + "' and hy_type='收件' "; if (txtname.Value != "") { sql += " and hy_title like '%" + txtname.Value + "%' "; } sql += " order by hy_datetime desc "; dt = Hyoa_global.GetDataTable(sql); } //发件箱 if (this.Request.QueryString["tableid"].ToString() == "fjx") { sql = "select * from hyt_mail where hy_fsrid='" + Session["hyuid"].ToString() + "' and hy_type='发件' "; if (txtname.Value != "") { sql += " and hy_title like '%" + txtname.Value + "%' "; } sql += " order by hy_datetime desc "; dt = Hyoa_global.GetDataTable(sql); } } //日程安排 if (this.Request.QueryString["mid"] == "Mudelrcap") { sql = "select * from hyc_Tablercap where hy_djrid='" + Session["hyuid"].ToString() + "' "; if (txtname.Value != "") { sql += " and hyc_zt like '%" + txtname.Value + "%' "; } sql += " order by hyc_qssj desc "; dt = Hyoa_global.GetDataTable(sql); } //个人通讯录 if (this.Request.QueryString["mid"] == "Mudelgrtxl") { sql = "select * from hyc_Tablegrtxl where hy_djrid='" + Session["hyuid"].ToString() + "' "; if (txtname.Value != "") { sql += " and hyc_xm like '%" + txtname.Value + "%' "; } sql += " order by hyc_xm "; dt = Hyoa_global.GetDataTable(sql); } //个人通讯录类别 if (this.Request.QueryString["mid"] == "Mudelgrtxllb") { sql = "select * from hyc_Tablegrtxllb where hy_djrid='" + Session["hyuid"].ToString() + "' "; sql += " order by hyc_pxh "; dt = Hyoa_global.GetDataTable(sql); } //通知公告 if (this.Request.QueryString["mid"] == "Mudeltzgg") { sql = "select * from hyc_Tabletzgg where 1=1 "; if (txtname.Value != "") { sql += " and hyc_bt like '%" + txtname.Value + "%' "; } sql += " order by hyc_djsj desc "; dt = Hyoa_global.GetDataTable(sql); } //最新公文 if (this.Request.QueryString["mid"] == "gwk") { sql = "select * from hyp_gwk where 1=1 "; if (txtname.Value != "") { sql += " and hy_bt like '%" + txtname.Value + "%' "; } sql += " order by hy_djsj desc "; dt = Hyoa_global.GetDataTable(sql); } //工作日志 if (this.Request.QueryString["mid"] == "Mudelgzrz") { sql = "select * from hyc_Tablegzrz where 1=1 "; if (txtname.Value != "") { sql += " and hyc_zt like '%" + txtname.Value + "%' "; } if (this.Request.QueryString["type"].ToString() == "dept") { sql += " and hy_djrbmid = '" + Session["hydeptid"].ToString() + "' "; } else { sql += " and hy_djrid = '" + Session["hyuid"].ToString() + "' "; } sql += " order by hy_djsj desc "; dt = Hyoa_global.GetDataTable(sql); } //请假管理 if (this.Request.QueryString["mid"] == "Mudelqjsq") { sql = "select distinct a.* from hyc_Tableqjsq a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID and (','+b.hy_clrid+',' like '%," + Session["hyuid"].ToString() + ",%' or ','+b.hy_cyrid+',' like '%," + Session["hyuid"].ToString() + ",%') and b.hy_ifth!='是' "; if (txtname.Value != "") { sql += " and hyc_qjsy like '%" + txtname.Value + "%' "; } sql += " order by a.hy_djsj desc "; dt = Hyoa_global.GetDataTable(sql); } DataTable tempTable = dt.Clone(); //模块名称 DataColumn col1 = new DataColumn("show_mudelname", typeof(String)); tempTable.Columns.Add(col1); //显示的标题 DataColumn col2 = new DataColumn("show_bt", typeof(String)); tempTable.Columns.Add(col2); //显示的时间 DataColumn col3 = new DataColumn("show_sj", typeof(String)); tempTable.Columns.Add(col3); //显示的连接 DataColumn col4 = new DataColumn("show_lj", typeof(String)); tempTable.Columns.Add(col4); //删除按钮 DataColumn col5 = new DataColumn("show_delinfo", typeof(String)); tempTable.Columns.Add(col5); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } dr["show_mudelname"] = this.lblmudelname.Text; HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel = Hyoa_mudel.Getmudel(txtmid.Text); string ls_role = "Role9999"; if (dt_mudel.Rows.Count > 0) { ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString(); } if (txtmid.Text == "dbsy" || txtmid.Text == "dysy" || txtmid.Text == "ybsy" || txtmid.Text == "yysy") { dr["show_bt"] = dt.Rows[i]["hy_subbt"].ToString() + "-" + dt.Rows[i]["hy_bt"].ToString(); dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_createtime"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = dt.Rows[i]["hy_url"].ToString().Replace("main.aspx", "wap_main.aspx"); dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>"; } //电子邮件 if (this.Request.QueryString["mid"] == "mail") { dr["show_bt"] = dt.Rows[i]["hy_title"].ToString(); dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hy_datetime"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main_mailread.aspx?op=modify&mid=mail&tableid=sjx&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=mail&tableid=sjx&page=" + this.curpage.Text; dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>"; } //日程安排 if (this.Request.QueryString["mid"] == "Mudelrcap") { dr["show_bt"] = dt.Rows[i]["hyc_zt"].ToString(); dr["show_sj"] = "时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qssj"].ToString()).ToString("yyyy-MM-dd") + "至" + System.DateTime.Parse(dt.Rows[i]["hyc_jssj"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelrcap&tableid=Tablercap&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelrcap&tableid=Tablercap&page=" + this.curpage.Text; dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除]</a>"; } //个人通信录 if (this.Request.QueryString["mid"] == "Mudelgrtxl") { dr["show_bt"] = dt.Rows[i]["hyc_xm"].ToString(); dr["show_sj"] = "手机:" + dt.Rows[i]["hyc_sj"].ToString(); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxl&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxl&page=" + this.curpage.Text; dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>"; } //个人通信录类别 if (this.Request.QueryString["mid"] == "Mudelgrtxllb") { dr["show_bt"] = dt.Rows[i]["hyc_lb"].ToString(); dr["show_sj"] = "序号:" + dt.Rows[i]["hyc_pxh"].ToString(); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgrtxl&tableid=Tablegrtxllb&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgrtxl&tableid=Tablegrtxllb&page=" + this.curpage.Text; dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>"; } //通知公告 if (this.Request.QueryString["mid"] == "Mudeltzgg") { dr["show_bt"] = dt.Rows[i]["hyc_bt"].ToString(); dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudeltzgg&tableid=Tabletzgg&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudeltzgg&tableid=Tabletzgg&page=" + this.curpage.Text; //判断权限 if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>"; } } //公文库 if (this.Request.QueryString["mid"] == "gwk") { dr["show_bt"] = dt.Rows[i]["hy_bt"].ToString(); dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hy_djsj"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main_gwk.aspx?op=modify&mid=gwk&tableid=gwk&docid=" + dt.Rows[i]["ID"].ToString() + "&url=wap_list.aspx?mid=gwk&tableid=gwk&page=" + this.curpage.Text; //判断权限 if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["ID"].ToString() + "');\">[删除记录]</a>"; } } //工作日志 if (this.Request.QueryString["mid"] == "Mudelgzrz") { dr["show_bt"] = "[" + dt.Rows[i]["hy_djrname"].ToString() + "]" + dt.Rows[i]["hyc_zt"].ToString(); dr["show_sj"] = "发布时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_djsj"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelgzrz&tableid=Tablegzrz&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelgzrz&tableid=Tablegzrz&type=" + this.Request.QueryString["type"].ToString() + "&page=" + this.curpage.Text; dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>"; } //请假管理 if (this.Request.QueryString["mid"] == "Mudelqjsq") { dr["show_bt"] = dt.Rows[i]["hyc_qjr"].ToString() + "[" + dt.Rows[i]["hy_curtachename"].ToString() + "]"; dr["show_sj"] = "请假时间:" + System.DateTime.Parse(dt.Rows[i]["hyc_qjsj"].ToString()).ToString("yyyy-MM-dd"); dr["show_lj"] = "wap_main.aspx?op=modify&mid=Mudelqjsq&tableid=Tableqjsq&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url=wap_list.aspx?mid=Mudelqjsq&tableid=Tableqjsq&page=" + this.curpage.Text; //判断权限 if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { dr["show_delinfo"] = "<a href=\"#\" onclick=\"DelInfo('" + dt.Rows[i]["DOCID"].ToString() + "');\">[删除记录]</a>"; } } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); }
private void DataPlay(int PageNo) { //判断当前用户是否有新建删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) //{ // this.tddeldoc.Visible = true; //删除 //} //else //{ // this.tddeldoc.Visible = false; //删除 //} //得到当前页号 this.curpage.Text = PageNo.ToString(); HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); DataTable dt; dt = Hyoa_dbsy.Getdbsys_yb(Session["hyuid"].ToString()); DataTable tempTable = dt.Clone(); DataColumn col = new DataColumn("mudelname", typeof(String)); tempTable.Columns.Add(col); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } //根据模块ID得到模块名称 HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel = Hyoa_mudel.Getmudel(dt.Rows[i]["hy_mudelid"].ToString()); if(dt_mudel.Rows.Count>0) dr["mudelname"] = dt_mudel.Rows[0]["hy_mudelname"].ToString(); tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); }