public string showuid(string uname) { Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); if (tm.GetModelList(" m_name = '" + ren.Trim() + "'").Count > 0) { return(tm.GetModelList(" m_name = '" + ren.Trim() + "'")[0].m_id.ToString()); } else { return("-1"); } }
protected void Page_Load(object sender, EventArgs e) { Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin(); if (ul.LoginID != 1) { Response.Write("禁止访问!"); Response.End(); } if (!IsPostBack) { Repeater1.DataSource = tm.GetModelList("1=1"); Repeater1.DataBind(); } }
public string showShengRi() { string str2 = string.Empty; Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber(); List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>(); tmList = tm.GetModelList("1=1"); for (int i = 0; i < tmList.Count; i++) { string shengRi = tmList[i].m_birth.ToString(); string userName = tmList[i].m_name; for (int j = 0; j < 100; j++) { if (DateTime.Compare(Convert.ToDateTime(shengRi).AddYears(j), DateTime.Today) == 0) { str2 += userName + "<br/>"; } } } if (str2.Length > 0) { str2 = str2.Substring(0, str2.Length - 1); } return(str2); }
protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e) { Repeater rptSub = (Repeater)e.Item.FindControl("Repeater3"); Tunnel.Model.Tunnel_bum model = (e.Item.DataItem as Tunnel.Model.Tunnel_bum); Tunnel.BLL.Tunnel_menber userBll = new Tunnel.BLL.Tunnel_menber(); List <Tunnel.Model.Tunnel_menber> userModelList = new List <Tunnel_menber>(); if (Convert.ToInt32(model.b_id) == 0) { userModelList = userBll.GetModelList(" m_bum = 0 "); } else { userModelList = userBll.GetModelList(" m_bum = " + model.b_id); } rptSub.DataSource = userModelList; rptSub.DataBind(); }
public void UserSave() { Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); Tunnel.BLL.Tunnel_jiaose tj = new Tunnel.BLL.Tunnel_jiaose(); Tunnel.Model.Tunnel_jiaose tjj = new Tunnel_jiaose(); Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber(); Tunnel.BLL.Tunnel_uyingshe tu = new Tunnel.BLL.Tunnel_uyingshe(); Tunnel.Model.Tunnel_uyingshe tuu = new Tunnel_uyingshe(); tmm.m_login = txtName.Value.Trim(); tmm.m_name = txtName.Value.Trim(); tmm.m_password = Tunnel.Data.DESEncrypt.Encrypt(txtPwd.Text.Trim()); //tmm.m_mail = txtMail.Text.Trim(); //if (Tunnel.Common.RegexComm.IsValidEmail(tmm.m_mail)) //{ if (tm.GetModelList("m_login='******'").Count == 0) { tmm.m_spassword = Tunnel.Data.DESEncrypt.Encrypt("123456"); int i = tm.Add(tmm); if (i > 0) { tuu.uy_uid = i.ToString(); tuu.uy_list = ""; tu.Add(tuu); Tunnel.Common.Message.Show("添加用户成功,请继续完善资料,审批密码默认为123456,请尽快修改!", "tunnel_userupd.aspx?updid=" + i.ToString() + ""); } else { Tunnel.Common.Message.Show("注册失败"); } } else { Tunnel.Common.Message.Show("用户名已占用"); } //} //else //{ // Tunnel.Common.Message.Show("不是有效的邮箱名"); //} }
protected void Page_Load(object sender, EventArgs e) { Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); GridViewE.DataSource = tm.GetModelList("1=1"); GridViewE.DataBind(); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); this.GridViewE.RenderControl(hw); Response.Clear(); Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; GridViewE.Page.EnableViewState = true; Response.AppendHeader("Content-Disposition", "attachment;filename=\"txl.xls"); Response.Write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset=UTF8\"><title> adsf</title></head><body><table><tr><td> 帐号</td><td>姓名</td><td>电话</td><td>电子邮件</td></tr>"); Response.Write(sw.ToString()); Response.Write("</table></body></html>"); Response.End(); }
protected void btnSave_Click(object sender, EventArgs e) { Tunnel.BLL.Tunnel_Vote tv = new Tunnel.BLL.Tunnel_Vote(); Tunnel.Model.Tunnel_Vote tvv = new Tunnel.Model.Tunnel_Vote(); Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin(); tvv.vote_userId = Convert.ToInt32(ul.LoginID.ToString()); tvv.vote_bumGroup = TextbumId.Value; tvv.vote_startDate = TextBox1.Text.Trim().Length > 0 ? Convert.ToDateTime(TextBox1.Text) : DateTime.Now; tvv.vote_endDate = TextBox2.Text.Trim().Length > 0 ? Convert.ToDateTime(TextBox2.Text) : Convert.ToDateTime(tvv.vote_startDate).AddYears(1); tvv.vote_mark = txtText.Text; tvv.vote_state = 0; tvv.vote_Title = txtTitle.Text; tvv.vote_top = 0; tvv.vote_Type = Convert.ToInt32(DropDownList1.SelectedValue); tvv.vote_max = 1; if (tvv.vote_Type == 1) { if (TextBox3.Text.Length > 0) { tvv.vote_max = Convert.ToInt32(TextBox3.Text.Trim()); } else { tvv.vote_max = 1; } } int relf = tv.Add(tvv); if (relf > 0) { if (CheckBox1.Checked) { #region 发消息给大家////////////////////////////////////// //获得所需参数 string strToIds = tvv.vote_bumGroup; string strTitle = "投票:" + tvv.vote_Title; //写入数据库 if (strToIds != "" && strToIds != "|") { strToIds = strToIds.Split('|')[0].ToString(); if (strToIds.LastIndexOf(',') > 0) { strToIds = strToIds.Remove(strToIds.LastIndexOf(','), 1); } string[] arr = strToIds.Split(','); List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>(); foreach (string item in arr) { Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); tmList = new List <Tunnel.Model.Tunnel_menber>(); tmList = tm.GetModelList("m_bum=" + item + ""); for (int j = 0; j < tmList.Count; j++) { call(strTitle, relf.ToString(), DateTime.Now, tmList[j].m_id); } } } else { List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>(); Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); tmList = tm.GetModelList(""); foreach (Tunnel.Model.Tunnel_menber item in tmList) { call(strTitle, relf.ToString(), DateTime.Now, item.m_id); } } #endregion } Tunnel.Common.Message.Show("添加成功!", "VoteItemsAdd.aspx?id=" + relf + ""); } else { Tunnel.Common.Message.Show("添加失败!"); } }
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(); } }
/// <summary> /// 获取菜单 /// </summary> /// <param name="bid">公文ID</param> /// <param name="state">公文状态</param> /// <param name="uli">发布人ID</param> /// <param name="sort">公文分类</param> /// <returns></returns> public string GetMenu(string bid, string state, string uli, string sort, string stype) { string l = ""; if ("0".Equals(stype) || string.IsNullOrEmpty(stype)) { l = "<a href=\"../ODocument/Document_FlowView.aspx?lid=" + bid + "\" target=\"_blank\">流程图</a> "; switch (state) { case "1": if (ul.JiaoSe(ul.LoginID) == "系统管理员") { l += "<a href=\"Apply_zSh.aspx?bid=" + bid + "\">审核</a>"; } else { if (Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "流程审批", "我的工作", false)) { if (ul.JiaoSe(ul.LoginID) != "系统管理员") { string ll = ""; List <Tunnel.Model.Tunnel_menber> mlist = new List <Tunnel.Model.Tunnel_menber>(); mlist = bm.GetModelList("m_bum=" + ul.UsbnLogin.m_bum); foreach (Tunnel.Model.Tunnel_menber mm in mlist) { ll = "<a href=\"Apply_zSh.aspx?bid=" + bid + "\">审核</a>"; } l += ll; } } } break; case "2": if (ul.JiaoSe(ul.LoginID) == "系统管理员") { l += "<a href=\"Apply_zSp.aspx?bid=" + bid + "\">审批</a>"; } else { string currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbid", "e_gid=" + bid + " order by e_id desc"); if ("".Equals(currbid)) { return(""); } string ulist = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_id=" + currbid); if ("".Equals(ulist)) { return(""); } else { string[] list = ulist.Split(','); foreach (string u in list) { if (u == ul.LoginID.ToString()) { l += "<a href=\"Apply_zSp.aspx?bid=" + bid + "\">审批</a>"; } } } } break; default: l += ""; break; } } else { l = "<a href=\"../OtherDocument/Other_FlowView.aspx?lid=" + bid + "\" target=\"_blank\">流程图</a> "; switch (state) { case "1": if (ul.JiaoSe(ul.LoginID) == "系统管理员") { l += "<a href=\"Apply_zSh.aspx?bid=" + bid + "\">审核</a>"; } else { if (Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "流程审批", "我的工作", false)) { if (ul.JiaoSe(ul.LoginID) != "系统管理员") { string ll = ""; List <Tunnel.Model.Tunnel_menber> mlist = new List <Tunnel.Model.Tunnel_menber>(); mlist = bm.GetModelList("m_bum=" + ul.UsbnLogin.m_bum); foreach (Tunnel.Model.Tunnel_menber mm in mlist) { ll = "<a href=\"Apply_zSh.aspx?bid=" + bid + "\">审核</a>"; } l += ll; } } } break; case "2": if (ul.JiaoSe(ul.LoginID) == "系统管理员") { l += "<a href=\"../OtherDocument/Other_zSp.aspx?bid=" + bid + "\">审批</a>"; } else { string ulist = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbuser", "e_gid=" + bid + " order by e_id desc"); if ("".Equals(ulist)) { return(""); } else { string[] list = ulist.Split(','); foreach (string u in list) { if (u == ul.LoginID.ToString()) { l += "<a href=\"../OtherDocument/Other_zSp.aspx?bid=" + bid + "\">审批</a>"; } } } } break; default: l += ""; break; } } return(l); }