예제 #1
0
        internal void Update(IStockable parent)
        {
            this.RaiseListChangedEvents = false;

            // update (thus deleting) any deleted child objects
            foreach (Stock obj in DeletedList)
            {
                obj.DeleteSelf(parent);
            }

            // now that they are deleted, remove them from memory too
            DeletedList.Clear();

            // add/update any current child objects
            foreach (Stock obj in this)
            {
                if (obj.IsNew)
                {
                    obj.Insert(parent);
                }
                else
                {
                    obj.Update(parent);
                }
            }

            this.RaiseListChangedEvents = true;
        }
예제 #2
0
        public static Batchs GetChildList(IStockable parent, bool childs)
        {
            CriteriaEx criteria = Batch.GetCriteria(parent.SessionCode);

            criteria.Query  = Batch.SELECT(parent.OidBatch);
            criteria.Childs = childs;

            return(DataPortal.Fetch <Batchs>(criteria));
        }
        public static ExpedienteList GetListByStockProducto(IStockable line)
        {
            QueryConditions conditions = new QueryConditions
            {
                IStockable = line
            };

            return(GetList(SELECT_BY_STOCK_PRODUCTO(conditions), false));
        }
예제 #4
0
        public static string SELECT(IStockable item)
        {
            string query = SELECT(new QueryConditions {
                IStockable = item
            });

            query += " ORDER BY ST.\"OID_BATCH\", ST.\"OID\"";
            return(query);
        }
예제 #5
0
        public static string SELECT(IStockable item)
        {
            string query =
                SELECT(new QueryConditions {
                IStockable = item
            }) + @"
            ORDER BY ST.""OID_BATCH"", ST.""OID""";

            return(query);
        }
예제 #6
0
        public static Stocks GetChildList(IStockable parent, bool childs)
        {
            CriteriaEx criteria = Stock.GetCriteria(parent.SessionCode);

            criteria.Childs = childs;

            criteria.Query = Stocks.SELECT(parent);

            return(DataPortal.Fetch <Stocks>(criteria));
        }
예제 #7
0
        public bool CheckStock(IStockable source, ProductInfo product)
        {
            switch (source.EEntityType)
            {
            case moleQule.Common.Structs.ETipoEntidad.OutputDeliveryLine:
                return(CheckStockOutputDeliveryLine(source, product));

            default:
                throw new iQImplementationException(string.Format("CheckStock para {0}", source.EEntityType.ToString()));
            }
        }
예제 #8
0
 public bool CheckStockOutputDeliveryLine(IStockable source, ProductInfo product)
 {
     //Si es un componente de kit no controlamos el stock porque ya lo hace el
     //concepto asociado al kit
     if (!IsKitComponent)
     {
         if (source.InvoicingMode == ETipoFacturacion.Peso)
         {
             if (StockKilos - product.StockMinimo - source.Kilos < 0)
             {
                 return(false);
             }
         }
         else
         {
             //stock.Bultos es negativo por eso se resta para calcular si hay suficiente
             if (StockBultos - product.StockMinimo - source.Pieces < 0)
             {
                 return(false);
             }
         }
     }
     return(true);
 }
예제 #9
0
 public Stock NewItem(IStockable parent)
 {
     this.NewItem(Stock.NewChild(parent));
     return(this[Count - 1]);
 }
예제 #10
0
 public int AddStock(IStockable stock)
 {
     _currentStock.Add(stock);
     return(_currentStock.Count);
 }