private void LoadFromSeleccionarInstanciaOrdenReparacionNS(RegistrarNumerosDeSerie rns) { this._items.Clear(); foreach (RegistrarNumerosDeSerie.ItemNumeroDeSerie itemNS in rns.Detalle) { //if (itemNS.NumeroDeSerie.CompareTo( string.Empty ) != 0 && itemNS.Seleccion == true) if (itemNS.Seleccion == true) { ItemAjuste item = new ItemAjuste(); item.IdProducto = itemNS.IdProducto; item.Codigo = itemNS.Codigo; item.Descripcion = itemNS.Descripcion; item.CantidadPendiente = 1; item.CantidadPedida = 1; item.Cantidad = 1; DataRow row = mz.erp.businessrules.tsh_ProductosSucursales.GetByPk(item.IdProducto, Security.IdSucursal, Security.IdEmpresa); if (row != null) { item.StockDisponible = Convert.ToDecimal(row["StockDisponible"]); } else { item.StockDisponible = 0; } this._items.Add(item); } } if (this._items.Count > 0) { if (ObjectHasChanged != null) { ObjectHasChanged(this, new EventArgs()); } } }
public virtual void ListenerAfterExecuteDependentTask(object sender) { if (sender.GetType() == typeof(mz.erp.businessrules.SeleccionReparacionAjustes)) { SeleccionReparacionAjustes comprobantesAjustes = (SeleccionReparacionAjustes)sender; if (this._processParent.Process.ProcessName.Equals("ProcesoTransferenciaMercaderiaAST")) { this._ordenReparacion = comprobantesAjustes.ArrayIdComporbantesPendientes[0].ToString(); } //this._ordenesReparacion = comprobantesAjustes.ArrayIdComporbantesPendientes; /* * if(comprobantesPendientes.RelacionesComprobanteOrigenDestino != null && comprobantesPendientes.RelacionesComprobanteOrigenDestino.Count > 0) * { * this.Step(comprobantesPendientes.RelacionesComprobanteOrigenDestino); * //this.OnRecalcularComprobante(this, new EventArgs()); * } */ } if (sender.GetType().Equals(typeof(mz.erp.businessrules.ComprobantesPendientes))) { ComprobantesPendientes ins = (ComprobantesPendientes)sender; LoadFromComprobantesPendientes(ins); } if (sender.GetType().Equals(typeof(mz.erp.businessrules.SeleccionarInstanciaOrdenReparacion))) { SeleccionarInstanciaOrdenReparacion ins = (SeleccionarInstanciaOrdenReparacion)sender; LoadFromSeleccionarInstanciaOrdenReparacion(ins); } if (sender.GetType().Equals(typeof(mz.erp.businessrules.RegistrarNumerosDeSerie))) { if (this._processParent.Process.ProcessName.Equals("ProcesoDevolucionMercaderiaAST")) { RegistrarNumerosDeSerie rns = (RegistrarNumerosDeSerie)sender; LoadFromSeleccionarInstanciaOrdenReparacionNS(rns); } } if (sender.GetType().Equals(typeof(mz.erp.businessrules.AjustarStock))) { if (sender != this) { AjustarStock aj = (AjustarStock)sender; LoadFromAjustarStock(aj); } } }