Ejemplo n.º 1
0
        //设置cookies
        public void setcookie(Ba_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]);
            }
        }
Ejemplo n.º 2
0
 public void Update(Ba_Admin admin)
 {
     session.Update(admin);
     session.Flush();
 }
Ejemplo n.º 3
0
 public void CreateAdmin(Ba_Admin admin)
 {
     session.Save(admin);
     session.Flush();
 }