Exemple #1
0
        //设置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]);
            }
        }
Exemple #2
0
 public void Update(ID_Admin admin)
 {
     session.Update(admin);
     session.Flush();
 }
Exemple #3
0
 public void CreateAdmin(ID_Admin admin)
 {
     session.Save(admin);
     session.Flush();
 }