示例#1
0
        public Batch NewItem(Almacen parent, Expedient expediente, ETipoStock tipo)
        {
            Batch item = Batch.NewChild(expediente);

            this.AddItem(item);
            SetNextCode(item);

            Stock stock = parent.Stocks.NewItem(item, tipo);

            stock.Inicial = true;
            //expediente.UpdateTotalesProductos();
            return(item);
        }
示例#2
0
        public static Stocks GetChildList(Almacen parent, bool childs, bool throwStockException)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Query  = Stocks.SELECT(parent);
            criteria.Childs = childs;

            Stocks list = DataPortal.Fetch <Stocks>(criteria);

            parent.UpdateStocks(throwStockException);

            return(list);
        }
示例#3
0
        public static Batchs GetChildListByAlbaranRecibido(Almacen parent, long oidDelivery, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Almacen       = parent.GetInfo(false),
                InputDelivery = InputDeliveryInfo.New(oidDelivery)
            };

            criteria.Query = Batchs.SELECT(conditions);

            return(DataPortal.Fetch <Batchs>(criteria));
        }
示例#4
0
        public static Batchs GetChildListByExpediente(Almacen parent, long oidExpedient, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Almacen   = parent.GetInfo(false),
                Expedient = ExpedientInfo.New(oidExpedient)
            };

            criteria.Query = Batchs.SELECT(conditions);

            return(DataPortal.Fetch <Batchs>(criteria));
        }
        public static ProductList GetListByAlmacen(long oid, bool childs)
        {
            CriteriaEx criteria = Product.GetCriteria(Product.OpenSession());

            criteria.Childs = childs;

            StoreInfo item = Almacen.New().GetInfo();

            item.Oid       = oid;
            criteria.Query = ProductList.SELECT(item);

            ProductList list = DataPortal.Fetch <ProductList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
示例#6
0
        public static Stocks GetChildListByProducto(Almacen parent, long oidPartida, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                Almacen  = parent.GetInfo(false),
                Producto = Product.New().GetInfo(false)
            };

            conditions.Producto.Oid = oidPartida;
            criteria.Query          = Stocks.SELECT(conditions);

            return(DataPortal.Fetch <Stocks>(criteria));
        }
        public static StoreList GetList(bool retrieve_childs)
        {
            CriteriaEx criteria = Almacen.GetCriteria(Almacen.OpenSession());

            criteria.Childs = retrieve_childs;

            //No criteria. Retrieve all de List

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = StoreList.SELECT();
            }

            StoreList list = DataPortal.Fetch <StoreList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
示例#8
0
        /// <summary>
        /// Actualiza un registro en la base de datos
        /// </summary>
        /// <param name="parent">Objeto padre</param>
        internal void Update(Almacen parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            //Debe obtener la sesion del padre pq el objeto es padre a su vez
            SessionCode = parent.SessionCode;

            OidAlmacen = parent.Oid;

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                InventarioAlmacenRecord obj = parent.Session().Get <InventarioAlmacenRecord>(Oid);
                obj.CopyValues(this._base.Record);
                parent.Session().Update(obj);


                _lineainventarios.Update(this);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
示例#9
0
 public static string SELECT(Almacen item, bool get_kit_components)
 {
     return(Batch.SELECT(item, get_kit_components, true));
 }
示例#10
0
 public void Remove(Almacen almacen, long oid)
 {
     base.Remove(oid);
 }
示例#11
0
 public Batch NewItem(Almacen parent, Expedient expediente)
 {
     return(NewItem(parent, expediente, ETipoStock.Compra));
 }
示例#12
0
 public void CopyFrom(Almacen source)
 {
     _base.CopyValues(source);
 }
示例#13
0
 public static string SELECT(QueryConditions conditions)
 {
     return(Almacen.SELECT(conditions, false));
 }
 /// <summary>
 /// Crea un nuevo elemento y lo añade a la lista
 /// </summary>
 /// <returns>Nuevo item</returns>
 public InventarioAlmacen NewItem(Almacen parent)
 {
     this.NewItem(InventarioAlmacen.NewChild(parent));
     return(this[Count - 1]);
 }
 public static string SELECT(Almacen item)
 {
     return(SELECT(new QueryConditions {
         Almacen = item.GetInfo()
     }));
 }
示例#16
0
 /// <summary>
 /// NO UTILIZAR DIRECTAMENTE. LO UTILIZA LA FUNCION DE CREACION DE LA LISTA DEL PADRE
 /// </summary>
 private InventarioAlmacen(Almacen parent)
 {
     OidAlmacen = parent.Oid;
     MarkAsChild();
 }