public User GetUesr8Openid(string openid, MODEL.OpenType opentype) { IQuery query = session.CreateQuery("select u from User u where u.Openid='" + openid + "' and u.Opentype=" + (int)opentype); MODEL.User user = query.FutureValue <MODEL.User>().Value; return(user); }
public User GetUser8Name(string username) { IQuery query = session.CreateQuery("select u from User u where u.Name='" + username + "'"); MODEL.User user = query.FutureValue <MODEL.User>().Value; return(user); }
public User GetUser8Email(string email) { IQuery query = session.CreateQuery("select u from User u where u.Email='" + email + "'"); MODEL.User user = query.FutureValue <MODEL.User>().Value; return(user); }
public User GetUser8Id(Guid providerUserKey) { IQuery query = session.CreateQuery("select u from User u where u.ID='" + providerUserKey.ToString() + "'"); MODEL.User user = query.FutureValue <MODEL.User>().Value; return(user); }
public bool ValidateUser(string username, string password) { MODEL.User user = GetUser8Name(username); if (user == null) { return(false); } return(password == user.Password ? true : false); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString.Count == 0) { //显示自己的信息 user = CurrentUser; } else { //显示他人的信息 user = blluser.GetUser8Id(Guid.Parse(Request.QueryString[0])); } if (!IsPostBack) { BindInfo(); } }
public void CreateUser(string username, string openid, MODEL.OpenType opentype) { MODEL.User user = GetUser8Name(username); while (user != null) { username += user + "0"; user = GetUser8Name(username); } MODEL.User newuser = new MODEL.User() { Name = username, Openid = openid, Opentype = opentype, Avatar = "/img/mavatar/M_001.jpg", CreateTime = DateTime.Now, LastLoginTime = DateTime.Now }; daluser.CreateUser(newuser); }