Exemple #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);
 }
Exemple #2
0
        public static string getXiangUser(string p)
        {
            string list = "";

            try
            {
                Tunnel.BLL.Tunnel_menber TmModel = new Tunnel.BLL.Tunnel_menber();
                DataSet ds = TmModel.GetList("m_name like '%" + p + "%'");
                list = "<table>";
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    list += "<tr><td onclick='showname(" + dr["m_id"].ToString() + ",'" + dr["m_name"].ToString() + "')'>" + dr["m_name"].ToString() + "</td>";
                }
                list += "</table>";
            }
            catch
            {
                list = "";
            }

            return(list);
        }