protected override void RefreshMainData() { if (_entity == null) { return; } Datos.DataSource = _entity; _product = ProductInfo.Get(_entity.OidProducto, false); PgMng.Grow(); switch (_product_type) { case ETipoProducto.Almacen: { BatchList lista; if (_delivery.Rectificativo) { lista = BatchList.GetListBySerie(_serie.Oid, false, true); } else { lista = BatchList.GetListBySerieAndStock(_serie.Oid, false, true); } _batch = lista.GetItem(_entity.OidPartida); //Caso extraño de que se vaya a modificar un concepto de un producto con stock 0 if (_batch == null) { _batch = BatchInfo.Get(_entity.OidPartida, false); } Batch_BS.DataSource = _batch; _batch.StockBultos += _entity.CantidadBultos; _batch.StockKilos += _entity.CantidadKilos; PgMng.Grow(); } break; case ETipoProducto.Libres: { _batch = null; Products_BS.DataSource = _product; PgMng.Grow(); } break; } base.RefreshMainData(); EnableKilos(); }
protected override void SelectPartidaAction() { BatchList lista; if (_delivery.Rectificativo) { lista = BatchList.GetListBySerie(_serie.Oid, false, true); } else { lista = BatchList.GetListBySerieAndStock(_serie.Oid, true, false, true); } BatchSelectForm form = new BatchSelectForm(this, _serie, lista); if (form.ShowDialog(this) == DialogResult.OK) { _batch = form.Selected as BatchInfo; _product = ProductInfo.Get(_batch.OidProducto, false, true); _entity.CopyFrom(_delivery, _batch, _product); _entity.SetTaxes(_client, _product, _serie); AsignaPrecio(); Batch_BS.DataSource = _batch; EnableKilos(); if (_entity.FacturacionBulto) { Pieces_NTB.Focus(); } else { Kilos_NTB.Focus(); } } ShowLineGrid(ETipoProducto.Almacen); }