Ejemplo n.º 1
0
        private void TicketUIForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Por posibles fallos en medio no llega a limpiar la cache, aqui eliminamos la sesion y la cache
            Expedients exps = Cache.Instance.Get(typeof(Expedients)) as Expedients;

            if ((exps != null) && (exps.Session() != null))
            {
                exps.CloseSession();
            }
            Cache.Instance.Remove(typeof(Expedients));
            Cache.Instance.Remove(typeof(ProductList));
        }
        public override void DisposeForm()
        {
            Expedients exps = (Expedients)Cache.Instance.Get(typeof(Expedients));

            Cache.Instance.Remove(typeof(Expedients));
            Cache.Instance.Remove(typeof(BatchList));
            Cache.Instance.Remove(typeof(ProductList));

            if (exps != null)
            {
                exps.CloseSession();
            }
        }
        protected override void CleanCache()
        {
            //Por posibles fallos en medio no llega a limpiar la cache, aqui eliminamos la sesion y la cache
            Expedients exps = Cache.Instance.Get(typeof(Expedients)) as Expedients;

            if ((exps != null) && (exps.Session() != null))
            {
                exps.CloseSession();
            }

            Cache.Instance.Remove(typeof(Expedients));
            Cache.Instance.Remove(typeof(BatchList));
            Cache.Instance.Remove(typeof(ProductList));
            Cache.Instance.Remove(typeof(ClienteList));
        }
        protected override void CleanCache()
        {
            Stores almacenes = (Stores)Cache.Instance.Get(typeof(Stores));

            if (almacenes != null)
            {
                almacenes.CloseSession();
            }

            Expedients expedientes = (Expedients)Cache.Instance.Get(typeof(Expedients));

            if (expedientes != null)
            {
                expedientes.CloseSession();
            }

            Cache.Instance.Remove(typeof(Stores));
            Cache.Instance.Remove(typeof(Expedients));
            Cache.Instance.Remove(typeof(ProductList));
            Cache.Instance.Remove(typeof(ClienteList));
        }