//设置cookies public void setcookie(ID_Admin entity) { string _domain = ConfigurationManager.AppSettings["WebDomain"]; HttpCookieCollection cookiecollect = new HttpCookieCollection(); HttpCookie Account = null; HttpCookie Username = null; if (!string.IsNullOrEmpty(entity.Ad_AdminName)) { Account = new HttpCookie("SuperAccount", Encrypt.DESEncrypt(entity.Ad_AdminName + System.Configuration.ConfigurationManager.AppSettings["AccountKey"])); Username = new HttpCookie("Superusername", entity.Ad_AdminName); } cookiecollect.Add(Account); cookiecollect.Add(Username); for (int i = 0; i < cookiecollect.Count; i++) { if (!_domain.Equals("localhost")) cookiecollect[i].Domain = _domain; System.Web.HttpContext.Current.Response.Cookies.Add(cookiecollect[i]); } }
public void Update(ID_Admin admin) { session.Update(admin); session.Flush(); }
public void CreateAdmin(ID_Admin admin) { session.Save(admin); session.Flush(); }