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; }
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; }