protected void Application_EndRequest(Object sender, EventArgs e)
        {
            IStoreDB db = DependencyResolver.Current.GetService <IStoreDB>();

            db.SaveChanges();
            db.Dispose();
        }
Exemple #2
0
        public void Start(HttpContext context, IStoreDB db)
        {
            this._db          = db;
            this._httpContext = context;
            HttpCookie cookie = context.Request.Cookies[COOKIE_NAME];

            if (cookie != null && !string.IsNullOrEmpty(cookie.Value))
            {
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value);
                this._user = db.GetUser(ticket.Name);

                if (this.User != null)
                {
                    this.IsAuthentication = true;
                }
                else
                {
                    this.DeleteCookies();
                    this.IsAuthentication = false;
                }
            }
        }
Exemple #3
0
 public ProductService(IStoreDB db)
 {
     _db=db;
 }
Exemple #4
0
        public void Start(HttpContext context, IStoreDB db)
        {
            this._db = db;
            this._httpContext = context;
            HttpCookie cookie = context.Request.Cookies[COOKIE_NAME];

            if (cookie != null && !string.IsNullOrEmpty(cookie.Value))
            {
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value);
                this._user = db.GetUser(ticket.Name);

                if (this.User != null)
                    this.IsAuthentication = true;
                else
                {
                    this.DeleteCookies();
                    this.IsAuthentication = false;
                }
            }
        }
 public PictureService(IStoreDB db)
 {
     _db = db;
 }
 public ProducerService(IStoreDB db)
 {
     _db = db;
 }
Exemple #7
0
 public PictureService(IStoreDB db)
 {
     _db = db;
 }
Exemple #8
0
 public GetOrdersController(IStoreDB storeDBParam)
 {
     istoreDB = storeDBParam;
 }