Пример #1
0
 private HttpCookie SetCookies(BaWuClub.Web.Dal.User u) {
     System.Web.Security.FormsAuthentication.SetAuthCookie(u.NickName, true);
     HttpCookie cookie = new HttpCookie("bwusers");
     cookie.Values["id"] = u.Id.ToString();
     cookie.Values["user"] = HttpUtility.UrlEncode(u.NickName.ToString());
     cookie.Values["avatar"] = u.Cover;
     return cookie;
 }
Пример #2
0
 private bool UserReg(BaWuClub.Web.Dal.User user,ClubEntities c) {
     this.user = user;
     c.Users.Add(user);
     if(c.SaveChanges()<0)
         return false;
     return true;
 }