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; }
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)); }
public static string SELECT(IStockable item) { string query = SELECT(new QueryConditions { IStockable = item }); query += " ORDER BY ST.\"OID_BATCH\", ST.\"OID\""; return(query); }
public static string SELECT(IStockable item) { string query = SELECT(new QueryConditions { IStockable = item }) + @" ORDER BY ST.""OID_BATCH"", ST.""OID"""; return(query); }
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)); }
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())); } }
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); }
public Stock NewItem(IStockable parent) { this.NewItem(Stock.NewChild(parent)); return(this[Count - 1]); }
public int AddStock(IStockable stock) { _currentStock.Add(stock); return(_currentStock.Count); }