/// <summary> /// 页面数据绑定 /// </summary> public void PageBind() { PageBase pb = new PageBase(); pb.TblName = "Tunnel_menber"; pb.FldName = "m_id"; pb.ProcedureName = "pagination1"; pb.PageSize = pageSize; if (cuttentPage == 0) { cuttentPage = pb.PageIndex; } pb.PageIndex = cuttentPage; pb.StrWhere = SearchWhere; int count = 0; List <Tunnel.Model.Tunnel_menber> modelList = new List <Tunnel.Model.Tunnel_menber>(); modelList = tbll.GetList(pb, ref count); //获取分页结果 pb.DoCount = 1; tbll.GetList(pb, ref count); //获取总条数 //数据绑定 GridView1.DataSource = modelList; GridView1.DataBind(); if ("系统管理员" != ul.JiaoSe(ul.LoginID)) { foreach (RepeaterItem item in GridView1.Items) { item.FindControl("czId").Visible = false; item.FindControl("UNczId").Visible = true; } } //数据分页 MTCPager1.PageSize = pageSize; MTCPager1.RecordCount = count; MTCPager1.PageIndex = cuttentPage; if (count <= pb.PageSize) { MTCPager1.Visible = false; } else { MTCPager1.Visible = true; } }
/// <summary> /// 页面数据绑定 /// </summary> public void PageBind() { PageBase pb = new PageBase(); pb.TblName = "Tunnel_menber"; pb.FldName = "m_id"; pb.ProcedureName = "pagination"; pb.PageSize = pageSize; if (cuttentPage == 0) { cuttentPage = pb.PageIndex; } pb.PageIndex = cuttentPage; pb.StrWhere = SearchWhere; int count = 0; List <Tunnel.Model.Tunnel_menber> modelList = new List <Tunnel.Model.Tunnel_menber>(); modelList = tbll.GetList(pb, ref count); //获取分页结果 pb.DoCount = 1; tbll.GetList(pb, ref count); //获取总条数 //数据绑定 GridViewE.DataSource = modelList; GridViewE.DataBind(); //数据分页 MTCPager1.PageSize = pageSize; MTCPager1.RecordCount = count; MTCPager1.PageIndex = cuttentPage; if (count <= pb.PageSize) { MTCPager1.Visible = false; } else { MTCPager1.Visible = true; } }
private void BindLinkman() { lbxlinkman.Items.Clear(); Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); DataSet das = new DataSet(); das = tm.GetList("m_mail <> ''"); foreach (DataRow rows in das.Tables[0].Rows) { ListItem item = new ListItem(); item.Text = rows["m_name"].ToString().Trim(); item.Value = rows["m_mail"].ToString().Trim() + "[" + rows["m_name"].ToString().Trim() + "];"; lbxlinkman.Items.Add(item); } }
public void BindSource() { Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber(); string sid = null == Request.QueryString["uid"] ? "" : Request.QueryString["uid"].ToString().Trim(); if (sid != "") { sid = sid.Substring(0, sid.Length - 1); DataSet ds = tm.GetList(string.Format("m_id in ({0})", sid)); cbListUser.DataSource = ds; cbListUser.DataTextField = "m_name"; cbListUser.DataValueField = "m_id"; cbListUser.DataBind(); } }
/// <summary> /// 办理中的用户 /// </summary> /// <param name="ulist">用户ID列表</param> /// <returns></returns> private string getallUname(string ulist) { ulist = ulist.Substring(0, ulist.Length - 1); string unamelist = ""; Tunnel.BLL.Tunnel_menber bm = new Tunnel.BLL.Tunnel_menber(); DataSet ds = bm.GetList("m_id in(" + ulist + ")"); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { unamelist += dr["m_name"].ToString() + ","; } unamelist = unamelist.Substring(0, unamelist.Length - 1); } return(unamelist); }
protected string UserNameList(string Idlist) { if (!"".Equals(Idlist)) { Idlist = Idlist.Substring(0, Idlist.Length - 1); DataSet ds = tm.GetList("m_id in (" + Idlist + ")"); string NameList = string.Empty; if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { NameList += dr["m_name"] + ","; } } return(NameList); } else { return(""); } }
void bindflow() { string bWhere = ""; mtb = btb.GetModel(int.Parse(Request.Params["bid"])); mf = bf.GetModel(mtb.b_sort); if (mf.f_sort == 18) { bWhere = " and e_bid<>0"; } else { bWhere = ""; } Page.Title = mtb.b_title; DataSet ds = bte.GetList("e_gid=" + mtb.b_id + bWhere + " order by e_id asc"); StringBuilder text = new StringBuilder(); StringBuilder texttop = new StringBuilder(); texttop.Append("<tr>"); texttop.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>1</font>步</td>"); texttop.Append("<td align=\"left\" style=\"height: 30px; width: 20%\"> 发起</td>"); texttop.Append("<td align=\"left\" style=\"height: 30%\"> <strong style=\"color:Red\">" + getUname(mtb.b_user.ToString()) + "</strong> [<font color=Green>发起</font>]"); texttop.Append("<br /> 发起于:" + mtb.b_time.ToString() + "</td>"); texttop.Append("<td align=\"left\" style=\"height: 30px; width: 40%\"> <td>"); texttop.Append("</tr> "); if (mtb.b_state == 3) { nextb = ""; isend = true; } else if (mtb.b_state == 1) { string suser = ""; if (mtb.b_suser == 0) { ul.UsbnLogin = bm.GetModel(mtb.b_user); DataSet dss = new DataSet(); dss = bm.GetList("m_bum=" + ul.UsbnLogin.m_bum); foreach (DataRow dr in dss.Tables[0].Rows) { if (Tunnel.BLL.Permission.IfHasPrimision(dr["m_id"].ToString(), "流程审核", "我的工作", false)) { suser += dr["m_id"].ToString() + ","; } } if (!string.IsNullOrEmpty(suser)) { text.Append("<tr>"); text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>2</font>步</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\"> 审核</td>"); text.Append("<td align=\"left\" style=\"height: 30%\"> <strong style=\"color:Red\">" + getallUname(suser) + " 主办</strong> [<font color=blue>审核中</font>]"); text.Append("<br /> 开始于:" + mtb.b_time.ToString() + "</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\"> </td>"); text.Append("</tr> "); } else { text.Append("<tr>"); text.Append("<td align=\"center\" colspan='4' style=\"height: 30px; width: 10%;color:red\">没有设置审核人,请与管理员联系!</td>"); text.Append("</tr> "); } } else { text.Append("<tr>"); text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>2</font>步</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\"> 审核</td>"); text.Append("<td align=\"left\" style=\"height: 30%\"> <strong style=\"color:Red\">" + getUname(mtb.b_suser.ToString()) + " 主办</strong> [<font color=blue>审核中</font>]"); text.Append("<br /> 开始于:" + mtb.b_time.ToString() + "</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\"> </td>"); text.Append("</tr> "); } nextb = text.ToString(); } else { if (mtb.b_state > 0) { string currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbid", "e_gid=" + mtb.b_id + " order by e_id desc"); string currtime = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_time", "e_gid=" + mtb.b_id + " order by e_id desc"); int currnum = Convert.ToInt32(Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "count(*)", "e_gid=" + mtb.b_id)); if ("".Equals(currbid) || "0".Equals(currbid)) { currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + mtb.b_sort + " and s_num=1"); } mts = ts.GetModel(Convert.ToInt32(currbid)); string nextnum = ""; string nextname = ""; string nextuser = ""; if (mts != null) { nextnum = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_num", "s_id=" + mts.s_id); nextname = getname(mts.s_id.ToString()); nextuser = getallUname(mts.s_zid.ToString()); } else { nextname = "步骤不存在或已删除"; nextuser = nextnum = "无"; } text.Append("<tr>"); text.Append("<td align=\"center\" style=\"height: 30px; width: 10%;\">第<font color=red>" + (currnum + (bWhere == "" ? 2 : 1)) + "</font>步</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 20%\"> " + "序号" + nextnum + ":" + nextname + "</td>"); text.Append("<td align=\"left\" style=\"height: 30%\"> <strong style=\"color:Red\">" + nextuser + " 主办</strong> [<font color=blue>办理中</font>]"); text.Append("<br /> 开始于:" + currtime + "</td>"); text.Append("<td align=\"left\" style=\"height: 30px; width: 40%\"> </td>"); text.Append("</tr> "); nextb = text.ToString(); } } toptb = texttop.ToString(); Repeater2.DataSource = ds; Repeater2.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { try { System.Web.HttpFileCollection uploadFiles = Request.Files; System.Web.HttpPostedFile theFile; for (int i = 0; i < uploadFiles.Count; i++) { theFile = uploadFiles[i]; if (Convert.ToDouble(theFile.ContentLength) / 1024 / 1024 > 10) { Tunnel.Common.Message.back("附件大小不能大于10MB"); return; } else { continue; } } Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID); //下一步骤ID string currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + Request.Params["Flow"] + " and s_num=1"); string curruser = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_lid=" + Request.Params["Flow"] + " and s_num=1"); //如果流程没有预设步骤 if ("".Equals(currbid)) { Tunnel.Common.Message.back("本流程未预设步骤,请与管理员联系!"); return; } Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind(); Tunnel.BLL.Tunnel_Remind br = new Tunnel.BLL.Tunnel_Remind(); mf = bf.GetModel(int.Parse(Request.Params["Flow"])); if (mf.f_state.ToString() == "0") { isshen = true; } else { isshen = false; } if (!isshen) { //将当前步骤存入数据库表:Tunnel_exam Tunnel.BLL.Tunnel_exam bte = new Tunnel.BLL.Tunnel_exam(); Tunnel.Model.Tunnel_exam mte = new Tunnel.Model.Tunnel_exam(); mte.e_bid = 0; mte.e_endtime = DateTime.Now; mte.e_gid = this.sava(); mte.e_user = ul.LoginID; mte.e_time = DateTime.Now; mte.e_nextbid = Convert.ToInt32(currbid); bte.Add(mte); string[] users = curruser.Split(','); foreach (string user in users) { if (!string.IsNullOrEmpty(user)) { tr.m_title = TextBox1.Text.Trim() + "<font color=red>(待审批)</font>"; tr.m_url = "N_WorkFlow/MyApply/Apply_zSp.aspx?bid=" + mte.e_gid; tr.m_touser = Convert.ToInt32(user); tr.m_time = DateTime.Now; tr.m_type = 1; tr.m_typeid = mte.e_gid; tr.m_bid = Convert.ToInt32(currbid); tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00"); tr.m_isread = 0; long messge = br.Add(tr); } } } else { int s = this.sava(); ul.UsbnLogin = bm.GetModel(ul.LoginID); DataSet dss = bm.GetList("m_bum=" + ul.UsbnLogin.m_bum); string userlist = ""; foreach (DataRow dr in dss.Tables[0].Rows) { if (Tunnel.BLL.Permission.IfHasPrimision(dr["m_id"].ToString(), "流程审核", "我的工作", false)) { userlist = dr["m_id"].ToString(); } } tr.m_title = TextBox1.Text.Trim() + "<font color=red>(待审核)</font>"; tr.m_url = "N_WorkFlow/MyApply/Apply_zSh.aspx?bid=" + s; tr.m_touser = (RadioButtonList3.SelectedValue == "1" ? int.Parse(m_value.Value) : Convert.ToInt32(userlist)); tr.m_time = DateTime.Now; tr.m_type = 1; tr.m_typeid = s; tr.m_bid = 0; tr.m_callTime = Convert.ToDateTime("1800-1-1 00:00:00"); tr.m_isread = 0; long messge = br.Add(tr); } Tunnel.Common.Message.Show("提交成功!", "Apply_Add.aspx?Flow=" + Request.Params["Flow"]); } catch { Tunnel.Common.Message.back("流程错误,请与管理员联系!"); } }
void ShowInit() { List <Tunnel.Model.Tunnel_menber> listCount = new List <Tunnel.Model.Tunnel_menber>(); DataSet ds = null; if ("bum" == Request.Params["act"]) { ds = new DataSet(); ds = tm.GetList("m_bum=" + Request.Params["idh"]); } else if ("jiao" == Request.Params["act"]) { ds = new DataSet(); ds = tm.GetList("m_jiao=" + Request.Params["idh"]); } else if ("xian" == Request.Params["act"]) { string xjb = null == Request.QueryString["idh"] ? "" : Request.QueryString["idh"].ToString().Trim(); if (xjb != "") { List <Tunnel.Model.Tunnel_menber> list = tm.GetModelList("1=1"); foreach (Tunnel.Model.Tunnel_menber ilist in list) { if (ilist.m_xjb.ToString().Trim() != "") { string[] strXJB = ilist.m_xjb.Split(new Char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strXJB.Length; i++) { if (xjb == strXJB[i]) { listCount.Add(ilist); break; } } } } } } else if ("search" == Request.Params["act"]) { ds = new DataSet(); if ("" != Request.Params["idh"]) { ds = tm.GetList("m_name like '%" + Request.Params["idh"] + "%' or m_login like '" + Request.Params["idh"] + "%'"); } else { ds = null; } } else { ds = new DataSet(); ds = null; } if ("xian" == Request.Params["act"]) { Repeater1.DataSource = listCount; Repeater1.DataBind(); } else { Repeater1.DataSource = ds; Repeater1.DataBind(); } }
void ShowInit(string sql) { DataSet ds = new DataSet(); string where = ""; string userlist = "0"; Tunnel.BLL.Tunnel_menber bm = new Tunnel.BLL.Tunnel_menber(); ul.UsbnLogin = bm.GetModel(ul.LoginID); if (Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "流程审核", "我的工作", false)) { DataSet dss = new DataSet(); if (ul.JiaoSe(ul.LoginID) != "系统管理员") { dss = bm.GetList("m_bum=" + ul.UsbnLogin.m_bum); foreach (DataRow dr in dss.Tables[0].Rows) { userlist += dr["m_id"].ToString() + ","; } if (userlist.Length > 0) { userlist = userlist.Substring(0, userlist.Length - 1); } } else { userlist = "0"; } } else { userlist = "0"; } if ("search".Equals(sql)) { if (TextBox1.Text.Trim() != "") { where += " and b_time>='" + TextBox1.Text + "'"; } if (TextBox2.Text.Trim() != "") { where += " and b_time<='" + TextBox2.Text + "'"; } if (TextBox3.Text.Trim() != "") { try { where += " and b_id=" + int.Parse(TextBox3.Text.Trim()); } catch { Tunnel.Common.Message.back("请输入正确的文号"); } } if (TextBox4.Text.Trim() != "") { where += " and b_title like '%" + TextBox4.Text + "%'"; } } else { where = ""; } string sWhere = ""; if (ul.JiaoSe(ul.LoginID) != "系统管理员") { sWhere = "select DISTINCT bf.b_id,bf.b_title,bf.b_sort,bf.b_time,bf.b_file,bf.b_state,bf.b_user,bf.b_suser,bf.b_stype from tunnel_bumf bf left join tunnel_exam em on bf.b_id=em.e_gid left join tunnel_step ep on em.e_nextbid=ep.s_id where (((CHARINDEX('" + ul.LoginID + ",', ep.s_zid)>=1 or ep.s_zid ='" + ul.LoginID + "') or (CHARINDEX('" + ul.LoginID + ",', em.e_nextbuser) >= 1 or em.e_nextbuser ='******')) " + where + " and bf.b_state>0) or (b_user in(" + userlist + ") or b_suser="******") order by bf.b_state asc,bf.b_time desc"; ds = Tunnel.Data.DbHelperSQL.Query(sWhere); } else { ds = tb.GetList("b_state>0 " + where + " order by b_state asc,b_time desc"); } PagedDataSource pds = new PagedDataSource(); pds.DataSource = ds.Tables[0].DefaultView;//设置数据源(DataTable类型) pds.AllowPaging = true; //每页显示的行数 //pds.PageSize = 12; AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.PageSize = AspNetPager1.PageSize; Repeater1.DataSource = pds; Repeater1.DataBind(); }