Ejemplo n.º 1
0
 /// <summary>
 /// 用户登陆
 /// </summary>
 /// <param name="userName">用户信息</param>
 /// <param name="userPass">用户密码</param>
 /// <param name="userId">返回用户Id</param>
 /// <returns>返回登陆成功或失败</returns>
 public int UserLoginCheck(string userName, string userPass, string m_ip, ref int userId)
 {
     try
     {
         Tunnel.BLL.Tunnel_menber tBll = new Tunnel.BLL.Tunnel_menber();
         tBll.Exists(userName, userPass, m_ip, ref userId);
         if (userId > 0)
         {
             HttpCookie newCookie = new HttpCookie("userId");
             newCookie.Value = userId.ToString();
             Tunnel.Model.Tunnel_menber model = new Tunnel.Model.Tunnel_menber();
             model     = getUserModel(userId);
             UsbnLogin = model;
             if (model != null)
             {
                 CreateCache(model);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(userId);
 }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取管理员信息
 /// </summary>
 /// <param name="userId">管理员ID</param>
 /// <returns>返回管理员信息</returns>
 public Tunnel.Model.Tunnel_menber GetUserBean(int userId)
 {
     Tunnel.Model.Tunnel_menber tempModel = new Tunnel.Model.Tunnel_menber();
     if (userId > 0)
     {
         string acheKey = string.Format("{0}-CacheKey-{1}", CacheKey, userId);
         if (batmanCache[acheKey] != null)
         {
             tempModel = (Tunnel.Model.Tunnel_menber)batmanCache[acheKey];
         }
         else
         {
             tempModel = getUserModel(Convert.ToInt64(userId));
         }
     }
     else
     {
         if (HttpContext.Current != null && userId == 0)
         {
             HttpCookie newCookie = HttpContext.Current.Request.Cookies["userId"];
             userId = Convert.ToInt32(newCookie.Value);
         }
         tempModel = getUserModel(Convert.ToInt64(userId));
     }
     return(tempModel);
 }
Ejemplo n.º 4
0
    public bool Save()
    {
        bool b = false;

        try
        {
            tmm          = tm.GetModel(Convert.ToInt64(ul.LoginID));
            tmm.m_id     = Convert.ToInt64(ul.LoginID);
            tmm.m_idcard = txtIdKard.Text.Trim();
            tmm.m_mail   = txtMail.Text.Trim();
            tmm.m_name   = txtName.Text.Trim();
            tmm.m_mobile = txtTel.Text.Trim();
            tmm.m_login  = txtUserName.Text.Trim();
            if (!string.IsNullOrEmpty(txtBirth.Text))
            {
                tmm.m_birth = Convert.ToDateTime(txtBirth.Text);
            }
            tm.Update(tmm);
            b = true;
        }
        catch (Exception)
        {
            b = false;
            throw;
        }
        return(b);
    }
Ejemplo n.º 5
0
    public string ShowName(object o, int i)
    {
        string temp = string.Empty;
        string uid  = o.ToString().Split('-')[2].ToString();

        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(uid));
        if (tmm != null)
        {
            switch (i)
            {
            case 1:
                temp = tmm.m_login;
                break;

            case 2:
                temp = tmm.m_name;
                break;

            case 3:
                temp = Tunnel.Data.DESEncrypt.Decrypt(tmm.m_password);
                break;

            default:
                break;
            }
        }
        return(temp);
    }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Tunnel.Model.Tunnel_menber menber = ul.GetUserBean(ul.LoginID);
         this.txtAuthor.Text = menber.m_name;
     }
 }
Ejemplo n.º 7
0
 protected void Button4_Click(object sender, EventArgs e)
 {
     Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
     if (!Tunnel.Data.DESEncrypt.Encrypt(spPassword.Text.Trim()).Equals(tm.m_spassword))
     {
         Tunnel.Common.Message.back("审批密码错误"); return;
     }
     else
     {
         //这里为存储当前步骤
         mtb = btb.GetModel(int.Parse(Request.Params["bid"]));
         mf  = bf.GetModel(mtb.b_sort);
         if (mtb.b_state == 3)
         {
             Tunnel.Common.Message.back("此流程己审批结束,请勿重复审批!"); return;
         }
         else
         {
             //将当前步骤存入数据库表: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       = Convert.ToInt32(Request.Params["bid"]);
             mte.e_user      = ul.LoginID;
             mte.e_nextbuser = m_value.Value;
             string lastendtime = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_endtime", "e_gid=" + Request.Params["bid"] + " order by e_id desc");
             if (!string.IsNullOrEmpty(lastendtime))
             {
                 mte.e_time = Convert.ToDateTime(lastendtime);//取得上一步的最后执行时间
             }
             else
             {
                 mte.e_time = mtb.b_time;
             }
             mte.e_nextbid = 1;
             bte.Add(mte);
             string contents = FCKeditor1.Value;
             //添加审批意见
             if (!string.IsNullOrEmpty(contents))
             {
                 Tunnel.BLL.Tunnel_Advice   ta = new Tunnel.BLL.Tunnel_Advice();
                 Tunnel.Model.Tunnel_Advice ma = new Tunnel.Model.Tunnel_Advice();
                 ma.a_content = contents;
                 ma.a_bid     = Convert.ToInt32(mts.s_id);
                 ma.a_gid     = Convert.ToInt32(mtb.b_id);
                 ma.a_time    = DateTime.Now;
                 ma.a_user    = ul.LoginID;
                 string count = Tunnel.Common.GetValue.getDataValue("Tunnel_Advice", "count(*)", "a_bid=1024 and a_gid=" + Request.Params["bid"]);
                 ta.Add(ma);
             }
             Tunnel.Data.DbHelperSQL.ExecuteSql("UPDATE TUNNEL_BUMF SET B_STATE=3 WHERE B_ID=" + Request.Params["bid"]);                                     //改变公文状态
             Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE TUNNEL_REMIND WHERE m_type=1 and m_bid=1 and m_touser="******" and m_typeid=" + mtb.b_id); //删除待办事项
             Tunnel.Common.Message.Show("流程结束成功!", "../MyApply/Apply_Sp.aspx");
         }
     }
 }
Ejemplo n.º 8
0
        /// <summary>
        /// 创建缓存
        /// </summary>
        /// <param name="ub">管理员信息</param>
        public void CreateCache(Tunnel.Model.Tunnel_menber ub)
        {
            string acheKey = string.Format("{0}-CacheKey-{1}", CacheKey, ub.m_id);

            onRemove = new CacheItemRemovedCallback(this.RemovedCallback);
            //batmanCache.Add(acheKey, ub, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 10), CacheItemPriority.Normal, onRemove);
            batmanCache.Insert(acheKey, ub, null, DateTime.Now.AddMinutes(40), TimeSpan.Zero, CacheItemPriority.High, onRemove);
            CreateTicket(Convert.ToInt32(ub.m_id), ub.m_jiao);
        }
Ejemplo n.º 9
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         Tunnel.Model.Tunnel_menber tm = ul.GetUserBean(ul.LoginID);
         mtb = btb.GetModel(int.Parse(Request.Params["bid"]));
         //下一步骤ID
         string currbid  = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + mtb.b_sort + " and s_num=1");
         string curruser = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_zid", "s_lid=" + mtb.b_sort + " and s_num=1");
         //如果流程没有预设步骤
         if ("".Equals(currbid))
         {
             Tunnel.Common.Message.back("本流程未预设步骤,请与管理员联系!"); return;
         }
         //将当前步骤存入数据库表: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       = Convert.ToInt32(mtb.b_id);
         mte.e_user      = ul.LoginID;
         mte.e_time      = DateTime.Now;
         mte.e_nextbuser = "";
         mte.e_nextbid   = Convert.ToInt32(currbid);
         bte.Add(mte);
         if (!string.IsNullOrEmpty(curruser))
         {
             Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
             Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
             string[] users = curruser.Split(',');
             foreach (string user in users)
             {
                 if (!string.IsNullOrEmpty(user))
                 {
                     tr.m_title    = mtb.b_title + "<font color=red>(待审批)</font>";
                     tr.m_url      = "N_WorkFlow/MyApply/Apply_zSp.aspx?bid=" + mtb.b_id;
                     tr.m_touser   = Convert.ToInt32(user);
                     tr.m_time     = DateTime.Now;
                     tr.m_type     = 1;
                     tr.m_typeid   = Convert.ToInt32(mtb.b_id);
                     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);
                 }
             }
         }
         Tunnel.Data.DbHelperSQL.ExecuteSql("UPDATE TUNNEL_BUMF SET B_STATE=2 WHERE B_ID=" + mtb.b_id);                  //改变公文状态
         Tunnel.Data.DbHelperSQL.ExecuteSql("DELETE TUNNEL_REMIND WHERE m_type=1 and m_bid=0 and m_typeid=" + mtb.b_id); //删除待办事项
         Tunnel.Common.Message.Show("操作成功,审核通过!", "Apply_SP.aspx");
     }
     catch
     {
         Tunnel.Common.Message.back("流程审核错误,请与管理员联系!");
     }
 }
Ejemplo n.º 10
0
 public Tunnel.Model.Tunnel_menber GetUserInfo()
 {
     Tunnel.BLL.UserLogin       ul    = new Tunnel.BLL.UserLogin();
     Tunnel.Model.Tunnel_menber model = new Tunnel.Model.Tunnel_menber();
     if (ul.LoginID > 0)
     {
         model = ul.GetUserBean(ul.LoginID);
     }
     return(model);
 }
Ejemplo n.º 11
0
 public void PageBind()
 {
     Tunnel.Model.Tunnel_menber model = GetUserInfo();
     if (model != null)
     {
         // Label1.Text = model.m_login + " [" + model.m_name + "]";
         Label1.Text = model.m_name;
     }
     //else
     //    Response.Write("<script>window.parent.location.href='Default.aspx?ReturnUrl=err'</script>");
 }
Ejemplo n.º 12
0
 public string GetUser(string str)
 {
     if (!string.IsNullOrEmpty(str))
     {
         Tunnel.Model.Tunnel_menber men = ulBLL.GetUserBean(ulBLL.LoginID);
         return(men.m_name.ToString());
     }
     else
     {
         return("");
     }
 }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Response.Buffer          = true;
         Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
         Response.Expires         = 0;
         Response.CacheControl    = "no-cache";
         tmm = tm.GetModel(Convert.ToInt64(ul.LoginID));
         bind();
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_menber> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_menber> modelList = new List <Tunnel.Model.Tunnel_menber>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_menber model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model            = new Tunnel.Model.Tunnel_menber();
                    model.m_id       = Convert.ToInt64(dt.Rows[n]["m_id"].ToString());
                    model.m_login    = dt.Rows[n]["m_login"].ToString();
                    model.m_name     = dt.Rows[n]["m_name"].ToString();
                    model.m_password = dt.Rows[n]["m_password"].ToString();
                    model.m_mobile   = dt.Rows[n]["m_mobile"].ToString();
                    if (dt.Rows[n]["m_mail"].ToString() != "")
                    {
                        model.m_mail = dt.Rows[n]["m_mail"].ToString();
                    }
                    model.m_idcard    = dt.Rows[n]["m_idcard"].ToString();
                    model.m_spassword = dt.Rows[n]["m_spassword"].ToString();
                    if (dt.Rows[n]["m_jiao"].ToString() != "")
                    {
                        model.m_jiao = int.Parse(dt.Rows[n]["m_jiao"].ToString());
                    }
                    if (dt.Rows[n]["m_bum"].ToString() != "")
                    {
                        model.m_bum = Convert.ToInt32(dt.Rows[n]["m_bum"].ToString());
                    }
                    if (dt.Rows[n]["m_duty"].ToString() != "")
                    {
                        model.m_duty = Convert.ToInt32(dt.Rows[n]["m_duty"].ToString());
                    }
                    if (dt.Rows[n]["m_xjb"].ToString() != "")
                    {
                        model.m_xjb = dt.Rows[n]["m_xjb"].ToString();
                    }
                    if (dt.Rows[n]["m_state"].ToString() != "")
                    {
                        model.m_state = int.Parse(dt.Rows[n]["m_state"].ToString());
                    }
                    model.m_flag = dt.Rows[n]["m_flag"].ToString();
                    if (!string.IsNullOrEmpty(dt.Rows[n]["m_birth"].ToString()))
                    {
                        model.m_birth = Convert.ToDateTime(dt.Rows[n]["m_birth"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 15
0
    /// <summary>
    /// 显示用户真实姓名
    /// </summary>
    /// <param name="Id">用户Id</param>
    /// <returns></returns>
    public string ShowUserName(string UserId)
    {
        Tunnel.BLL.Tunnel_menber   mbll  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber model = new Tunnel.Model.Tunnel_menber();
        model = mbll.GetModel(Convert.ToInt64(UserId));
        string strTemp = string.Empty;

        if (model != null)
        {
            strTemp = model.m_name;
        }
        return(strTemp);
    }
Ejemplo n.º 16
0
    public string ShowName(object o)
    {
        string a = string.Empty;

        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
        if (tmm != null)
        {
            a = tmm.m_name;
        }
        return(a);
    }
Ejemplo n.º 17
0
    public static string GetName(object o)
    {
        string temp = "";

        Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
        if (!string.IsNullOrEmpty(Convert.ToString(o)))
        {
            Tunnel.Model.Tunnel_menber tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
            if (tmm != null)
            {
                temp = tmm.m_name;
            }
        }
        return(temp);
    }
Ejemplo n.º 18
0
    /// <summary>
    /// 得到所有权限
    /// </summary>
    public Dictionary <int, string> getAllPermission()
    {
        Dictionary <int, string> allDic = new Dictionary <int, string>();

        Tunnel.BLL.Tunnel_quanxian          tq     = new Tunnel.BLL.Tunnel_quanxian();
        List <Tunnel.Model.Tunnel_quanxian> tqList = new List <Tunnel.Model.Tunnel_quanxian>();

        if (ul.JiaoSe(ul.LoginID) == "系统管理员")
        {
            tqList = tq.GetModelList("1=1 order by q_rId asc ");
            foreach (Tunnel.Model.Tunnel_quanxian item in tqList)
            {
                allDic.Add(item.q_id, item.q_mark + "-->>" + item.q_name);
            }
        }
        else
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(ul.LoginID);
            if (!string.IsNullOrEmpty(Convert.ToString(tmm.m_bum)))
            {
                Tunnel.BLL.Tunnel_byingshe          tb     = new Tunnel.BLL.Tunnel_byingshe();
                Tunnel.Model.Tunnel_byingshe        tbb    = new Tunnel.Model.Tunnel_byingshe();
                List <Tunnel.Model.Tunnel_byingshe> tbList = new List <Tunnel.Model.Tunnel_byingshe>();
                tbList = tb.GetModelList("by_bid = " + tmm.m_bum + "");
                if (tbList.Count > 0)
                {
                    tbb = tbList[0];
                    string byList = tbb.by_list;
                    if (byList.Length > 0)
                    {
                        string[] temp = byList.Split('|');
                        foreach (string item in temp)
                        {
                            Tunnel.Model.Tunnel_quanxian tqq = new Tunnel.Model.Tunnel_quanxian();
                            tqq = tq.GetModel(int.Parse(item));
                            if (tqq != null)
                            {
                                allDic.Add(tqq.q_id, tqq.q_mark + "-->>" + tqq.q_name);
                            }
                        }
                    }
                }
            }
        }
        return(allDic);
    }
Ejemplo n.º 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             uid = Request.QueryString["id"].ToString();
             tmm = tm.GetModel(int.Parse(uid));
             bind();
         }
         else
         {
             Tunnel.Common.Message.Show("非法访问", "tunnel_userlist.aspx");
         }
     }
 }
Ejemplo n.º 20
0
    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();
        }
    }
Ejemplo n.º 21
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(Tunnel.Model.Tunnel_menber model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@m_id",        SqlDbType.Int,         8),
                new SqlParameter("@m_login",     SqlDbType.VarChar,    50),
                new SqlParameter("@m_name",      SqlDbType.VarChar,    50),
                new SqlParameter("@m_password",  SqlDbType.VarChar,    50),
                new SqlParameter("@m_mobile",    SqlDbType.VarChar,    50),
                new SqlParameter("@m_mail",      SqlDbType.VarChar,    50),
                new SqlParameter("@m_idcard",    SqlDbType.VarChar,    50),
                new SqlParameter("@m_spassword", SqlDbType.VarChar,    50),
                new SqlParameter("@m_jiao",      SqlDbType.Int,         4),
                new SqlParameter("@m_bum",       SqlDbType.Int,         4),
                new SqlParameter("@m_duty",      SqlDbType.Int,         4),
                new SqlParameter("@m_xjb",       SqlDbType.VarChar,   200),
                new SqlParameter("@m_state",     SqlDbType.Int,         4),
                new SqlParameter("@m_flag",      SqlDbType.VarChar,  2000),
                new SqlParameter("@m_zdyqx",     SqlDbType.Int,         4),
                new SqlParameter("@m_birth",     SqlDbType.DateTime,    8),
                new SqlParameter("@m_KSID",      SqlDbType.VarChar, 200)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.m_login;
            parameters[2].Value     = model.m_name;
            parameters[3].Value     = model.m_password;
            parameters[4].Value     = model.m_mobile;
            parameters[5].Value     = model.m_mail;
            parameters[6].Value     = model.m_idcard;
            parameters[7].Value     = model.m_spassword;
            parameters[8].Value     = model.m_jiao;
            parameters[9].Value     = model.m_bum;
            parameters[10].Value    = model.m_duty;
            parameters[11].Value    = model.m_xjb;
            parameters[12].Value    = model.m_state;
            parameters[13].Value    = model.m_flag;
            parameters[14].Value    = model.m_zdyqx;
            parameters[15].Value    = model.m_birth;
            parameters[16].Value    = model.m_KSID;

            DbHelperSQL.RunProcedure("Tunnel_menber_ADD", parameters, out rowsAffected);
            int relt = Convert.ToInt32(parameters[0].Value);

            return(relt);
        }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List <CacheItems> cList = new List <CacheItems>();

        cList.Clear();
        IDictionaryEnumerator dic = Cache.GetEnumerator();

        while (dic.MoveNext())
        {
            if (dic.Value.GetType().ToString() == "Tunnel.Model.Tunnel_menber")
            {
                cList.Add(new CacheItems(dic.Key.ToString(), dic.Value.GetType().ToString()));
            }
        }
        onLineUser = cList.Count;
        //string aaa=Cache["TunnelLogin-CacheKey-409"].ToString();
        //string strsql = "select count(m_id) as onlineuser from tunnel_menber where m_online = 1";
        //DataSet das = Tunnel.Data.DbHelperSQL.Query(strsql);
        //onLineUser = Convert.ToInt32(das.Tables[0].Rows[0]["onlineuser"]);
        if (!IsPostBack)
        {
            PageBind();
            uid = ul.LoginID.ToString();
            if (ul.LoginID > 0)
            {
                Tunnel.Model.Tunnel_menber model = ul.GetUserBean(ul.LoginID);
                Tunnel.BLL.Tunnel_bum      bm    = new Tunnel.BLL.Tunnel_bum();
                if (model != null)
                {
                    userbum = model.m_login + " | ";
                }
                if (model != null && model.m_bum > 0)
                {
                    if (bm.GetModel(model.m_bum) != null)
                    {
                        userbum += bm.GetModel(model.m_bum).b_name;
                    }
                }
                else
                {
                    userbum += "部门未分组";
                }
            }
            Label1.ToolTip = userbum;
        }
    }
Ejemplo n.º 23
0
    public void bind()
    {
        tmm = tm.GetModel(Convert.ToInt64(Request.QueryString["updid"]));
        ddlBum.SelectedIndex = -1;
        ddlBum.Items.FindByValue(tmm.m_bum.ToString()).Selected = true;
        ddlDuty.SelectedIndex = -1;
        ddlDuty.Items.FindByValue(tmm.m_duty.ToString()).Selected = true;

        foreach (string item in tmm.m_xjb.ToString().Split('|'))
        {
            foreach (ListItem item1 in CheckBoxList3.Items)
            {
                if (item1.Value == item)
                {
                    item1.Selected = true;
                }
            }
        }
        foreach (string item in tmm.m_KSID.ToString().Trim().Split(','))
        {
            foreach (ListItem item1 in cbListKS.Items)
            {
                if (item1.Value == item)
                {
                    item1.Selected = true;
                }
            }
        }

        if (tj.GetModelList("j_id=" + tmm.m_jiao + "").Count != 0)
        {
            DropDownList1.Items.FindByValue(tmm.m_jiao.ToString()).Selected = true;
        }


        txtPwd.Attributes["value"]  = tmm.m_password;
        txtsPwd.Attributes["value"] = tmm.m_spassword;

        txtIdKard.Text   = tmm.m_idcard;
        txtUserName.Text = tmm.m_login;
        txtMail.Text     = tmm.m_mail;
        txtTel.Text      = tmm.m_mobile;
        txtName.Text     = tmm.m_name;
        rbState.Items.FindByValue(tmm.m_state.ToString()).Selected = true;
        txtBirth.Text = tmm.m_birth.ToShortDateString() == "1800-1-1" ? "" : tmm.m_birth.ToShortDateString();
    }
Ejemplo n.º 24
0
 /// <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;
     }
 }
Ejemplo n.º 25
0
    private void PageBind(int mailId)
    {
        Tunnel.BLL.Tunnel_mail   mail  = new Tunnel.BLL.Tunnel_mail();
        Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
        model           = mail.GetModel(mailId);
        tb_Title.Text   = "回复:" + model.m_title;
        tb_content.Text = "原信息内容:\n" + model.m_content.Replace(@"<br \>", "\n") + "\n" + model.m_time.ToString() + "\n-------------------------------\n";
        Tunnel.BLL.Tunnel_menber   menb = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber mmol = new Tunnel.Model.Tunnel_menber();
        mmol             = menb.GetModel(model.m_from);
        tb_toname.Text   = mmol.m_name + ",";
        id_toValue.Value = model.m_from.ToString() + ",";
        string priv_name = mmol.m_name;
        long   priv_id   = mmol.m_id;
        char   d         = '"';

        td_tomail.InnerHtml = priv_name + "<IMG id=" + priv_name + priv_id + " onclick=" + "'" + "removeimg(" + d + priv_name + d + "," + d + priv_id + d + ");" + "'" + " src=" + d + "../../image/remove.png" + d + ">,";
    }
Ejemplo n.º 26
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(Tunnel.Model.Tunnel_menber model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@m_id",        SqlDbType.BigInt,      8),
                new SqlParameter("@m_login",     SqlDbType.VarChar,    50),
                new SqlParameter("@m_name",      SqlDbType.VarChar,    50),
                new SqlParameter("@m_password",  SqlDbType.VarChar,    50),
                new SqlParameter("@m_mobile",    SqlDbType.VarChar,    50),
                new SqlParameter("@m_mail",      SqlDbType.VarChar,    50),
                new SqlParameter("@m_idcard",    SqlDbType.VarChar,    50),
                new SqlParameter("@m_spassword", SqlDbType.VarChar,    50),
                new SqlParameter("@m_jiao",      SqlDbType.Int,         4),
                new SqlParameter("@m_bum",       SqlDbType.Int,         4),
                new SqlParameter("@m_duty",      SqlDbType.Int,         4),
                new SqlParameter("@m_xjb",       SqlDbType.VarChar,   200),
                new SqlParameter("@m_state",     SqlDbType.Int,         4),
                new SqlParameter("@m_flag",      SqlDbType.VarChar,  2000),
                new SqlParameter("@m_zdyqx",     SqlDbType.Int,         4),
                new SqlParameter("@m_birth",     SqlDbType.DateTime,    8),
                new SqlParameter("@m_KSID",      SqlDbType.VarChar, 200)
            };
            parameters[0].Value  = model.m_id;
            parameters[1].Value  = model.m_login;
            parameters[2].Value  = model.m_name;
            parameters[3].Value  = model.m_password;
            parameters[4].Value  = model.m_mobile;
            parameters[5].Value  = model.m_mail;
            parameters[6].Value  = model.m_idcard;
            parameters[7].Value  = model.m_spassword;
            parameters[8].Value  = model.m_jiao;
            parameters[9].Value  = model.m_bum;
            parameters[10].Value = model.m_duty;
            parameters[11].Value = model.m_xjb;
            parameters[12].Value = model.m_state;
            parameters[13].Value = model.m_flag;
            parameters[14].Value = model.m_zdyqx;
            parameters[15].Value = model.m_birth;
            parameters[16].Value = model.m_KSID;

            DbHelperSQL.RunProcedure("Tunnel_menber_Update", parameters, out rowsAffected);
        }
Ejemplo n.º 27
0
    public string GetBum(object o)
    {
        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
        string strTemp = string.Empty;

        if (tmm != null)
        {
            Tunnel_bum            tbb = new Tunnel_bum();
            Tunnel.BLL.Tunnel_bum tb  = new Tunnel.BLL.Tunnel_bum();
            tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum.ToString()));
            if (tbb != null)
            {
                strTemp = tbb.b_name;
            }
        }
        return(strTemp);
    }
Ejemplo n.º 28
0
    public bool Save()
    {
        bool b = false;

        try
        {
            tmm             = tm.GetModel(Convert.ToInt64(ul.LoginID));
            tmm.m_id        = Convert.ToInt64(ul.LoginID);
            tmm.m_spassword = Tunnel.Data.DESEncrypt.Encrypt(TextBox3.Text.Trim());
            tm.Update(tmm);
            b = true;
        }
        catch (Exception)
        {
            b = false;
            throw;
        }
        return(b);
    }
Ejemplo n.º 29
0
    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("不是有效的邮箱名");
        //}
    }
Ejemplo n.º 30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Response.Buffer          = true;
         Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
         Response.Expires         = 0;
         Response.CacheControl    = "no-cache";
         DropBind();
         if (!string.IsNullOrEmpty(Request.QueryString["updid"]))
         {
             tmm = tm.GetModel(Convert.ToInt64(Request.QueryString["updid"].ToString()));
             bind();
         }
         else
         {
             Tunnel.Common.Message.Show("用户不存在");
         }
     }
 }