/// <summary> /// 得到 类型ID 和 ID /// </summary> public void getIdtypeId(ref int tmpId, ref int typeId) { if (!string.IsNullOrEmpty(Request.QueryString["uid"])) { tmpId = Convert.ToInt32(Request.QueryString["uid"].ToString()); tempName = "用户管理"; Tunnel.BLL.Tunnel_menber menberBLL = new Tunnel.BLL.Tunnel_menber(); Tunnel.Model.Tunnel_menber menberModel = menberBLL.GetModel(tmpId); tempName_TypeName = menberModel.m_name; typeId = 1; if (!string.IsNullOrEmpty(Request.QueryString["uid"])) { GetUserAllPermission(int.Parse(Request.QueryString["uid"])); } } if (!string.IsNullOrEmpty(Request.QueryString["jid"])) { tmpId = Convert.ToInt32(Request.QueryString["jid"].ToString()); tempName = "角色管理"; Tunnel.BLL.Tunnel_jiaose jiaoseBLL = new Tunnel.BLL.Tunnel_jiaose(); Tunnel.Model.Tunnel_jiaose jiaoseModel = jiaoseBLL.GetModel(tmpId); tempName_TypeName = jiaoseModel.j_name; this.tmpSet.Visible = false; typeId = 2; } if (!string.IsNullOrEmpty(Request.QueryString["did"])) { tmpId = Convert.ToInt32(Request.QueryString["did"].ToString()); tempName = "职位管理"; Tunnel.BLL.Tunnel_duty dutyBLL = new Tunnel.BLL.Tunnel_duty(); Tunnel.Model.Tunnel_duty dutyModel = dutyBLL.GetModel(tmpId); tempName_TypeName = dutyModel.d_name; this.tmpSet.Visible = false; typeId = 3; } if (!string.IsNullOrEmpty(Request.QueryString["bid"])) { tmpId = Convert.ToInt32(Request.QueryString["bid"].ToString()); Tunnel.BLL.Tunnel_bum bumBLL = new Tunnel.BLL.Tunnel_bum(); Tunnel.Model.Tunnel_bum bumModels = bumBLL.GetModel(tmpId); tempName_TypeName = bumModels.b_name; tempName = "部门管理"; this.tmpSet.Visible = false; typeId = 4; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (string.IsNullOrEmpty(Request.QueryString["id"])) { jid = Request.QueryString["id"].ToString(); Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose(); Tunnel.BLL.Tunnel_jiaose tj = new Tunnel.BLL.Tunnel_jiaose(); tjj = tj.GetModel(Convert.ToInt64(jid)); txtName.Text = tjj.j_name; txtfl.Text = tjj.j_flag; } else { Tunnel.Common.Message.Show("非法访问", "tunnel_jueseguanli.aspx"); } } }
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("不是有效的邮箱名"); //} }
/// <summary> /// 用户角色名称 /// </summary> public string JiaoSe(int userId) { Tunnel.BLL.Tunnel_menber tm = new Tunnel_menber(); Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber(); tmm = tm.GetModel(Convert.ToInt64(userId.ToString())); string jiaose = "无角色"; if (userId == 1) { jiaose = "系统管理员"; } if (tmm.m_jiao != 0) { Tunnel_jiaose tj = new Tunnel_jiaose(); Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose(); tjj = tj.GetModel(Convert.ToInt64(tmm.m_jiao.ToString())); if (tjj != null) { jiaose = tjj.j_name; } } return(jiaose); }
/// <summary> /// 查看是否有权限 /// </summary> /// <param name="userID">用户ID</param> /// <param name="XreqestStr">小类</param> /// <param name="BreqestStr">大类</param> /// <returns>true有权限</returns> public static bool IfHasPrimision(string userID, string XreqestStr, string BreqestStr, bool IfRead) { string tmpUid = string.Empty; string tmpBid = string.Empty; string tmpDid = string.Empty; string tmpJid = string.Empty; Tunnel.BLL.Tunnel_menber tm = new Tunnel_menber(); Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber(); List <Tunnel.Model.Tunnel_menber> tmlist = new List <Tunnel.Model.Tunnel_menber>(); Tunnel.BLL.Tunnel_jiaose tj = new Tunnel_jiaose(); Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose(); Tunnel.BLL.Tunnel_quanxian qx = new Tunnel_quanxian(); Tunnel.Model.Tunnel_quanxian qxx = new Tunnel.Model.Tunnel_quanxian(); List <Tunnel.Model.Tunnel_quanxian> qxlist = new List <Tunnel.Model.Tunnel_quanxian>(); Tunnel.BLL.Tunnel_yingshe tyj = new Tunnel_yingshe(); Tunnel.Model.Tunnel_yingshe tyjj = new Tunnel.Model.Tunnel_yingshe(); List <Tunnel.Model.Tunnel_yingshe> tyjlist = new List <Tunnel.Model.Tunnel_yingshe>(); Tunnel.BLL.Tunnel_uyingshe tyu = new Tunnel_uyingshe(); Tunnel.Model.Tunnel_uyingshe tyuu = new Tunnel.Model.Tunnel_uyingshe(); List <Tunnel.Model.Tunnel_uyingshe> tyulist = new List <Tunnel.Model.Tunnel_uyingshe>(); Tunnel.BLL.Tunnel_byingshe tyb = new Tunnel_byingshe(); Tunnel.Model.Tunnel_byingshe tybb = new Tunnel.Model.Tunnel_byingshe(); List <Tunnel.Model.Tunnel_byingshe> tyblist = new List <Tunnel.Model.Tunnel_byingshe>(); Tunnel.BLL.Tunnel_dyingshe tyd = new Tunnel_dyingshe(); Tunnel.Model.Tunnel_dyingshe tydd = new Tunnel.Model.Tunnel_dyingshe(); List <Tunnel.Model.Tunnel_dyingshe> tydlist = new List <Tunnel.Model.Tunnel_dyingshe>(); UserLogin ul = new UserLogin(); bool b = false; string qxStr = string.Empty; tmm = tm.GetModel(Convert.ToInt64(userID)); tmpBid = tmm.m_bum.ToString(); tmpJid = tmm.m_jiao.ToString(); tmpDid = tmm.m_duty.ToString(); tmpUid = userID; tyulist = tyu.GetModelList("uy_uid='" + tmpUid + "'"); if (tyulist.Count > 0) { if (tyulist[0].uy_list.Length > 0) { qxStr += tyulist[0].uy_list + "|"; } } tyjlist = tyj.GetModelList("y_jsid=" + tmpJid + ""); if (tyjlist.Count > 0) { if (tyjlist[0].y_qxlist.Length > 0) { qxStr += tyjlist[0].y_qxlist + "|"; } } tyblist = tyb.GetModelList("by_bid='" + tmpBid + "'"); if (tyblist.Count > 0) { if (tyblist[0].by_list.Length > 0) { qxStr += tyblist[0].by_list + "|"; } } tydlist = tyd.GetModelList("dy_did='" + tmpDid + "'"); if (tydlist.Count > 0) { if (tydlist[0].dy_list.Length > 0) { qxStr += tydlist[0].dy_list + "|"; } } if (qxStr.Length > 0) { qxStr = qxStr.Substring(0, qxStr.Length - 1); } if (userID != "1" && ul.JiaoSe(int.Parse(userID)) != "系统管理员") { if (IfRead) { if (tmpJid != "0") { if (ul.JiaoSe(int.Parse(userID)) == "总经理") { b = true; } } } if (!string.IsNullOrEmpty(qxStr)) { qxlist = qx.GetModelList("q_name='" + XreqestStr + "' and q_mark='" + BreqestStr + "'"); if (qxlist.Count > 0) { foreach (string item in qxStr.Split('|')) { if (qxlist[0].q_id.ToString().Equals(item.ToString())) { b = true; } } } } } else { b = true; } return(b); }