public Boolean GuardarTIMovim_EgresoConsumo(in_movi_inve_detalle_x_Producto_CusCider_Info Info) { try { using (EntitiesProduccion_Cidersus Context = new EntitiesProduccion_Cidersus()) { var Address = new in_movi_inve_detalle_x_Producto_CusCider(); Address.IdEmpresa = Info.IdEmpresa; Address.IdSucursal = Info.IdSucursal; Address.IdBodega = Info.IdBodega; Address.IdMovi_inven_tipo = Info.IdMovi_inven_tipo; Address.IdNumMovi = Info.IdNumMovi; Address.IdEmpresa = Info.IdEmpresa; Address.IdSucursal = Info.IdSucursal; Address.IdBodega = Info.IdBodega; Address.IdMovi_inven_tipo = Info.IdMovi_inven_tipo; Address.IdNumMovi = Info.IdNumMovi; Address.ot_CodObra = Info.ot_CodObra; Address.ot_IdOrdenTaller = Info.ot_IdOrdenTaller; Context.in_movi_inve_detalle_x_Producto_CusCider.Add(Address); Context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString() + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
void funcion(in_movi_inve_detalle_x_Producto_CusCider_Info CBar) { try { //int fila = ultraGridMinvDetalle.ActiveRow.Index; //if (fila != -1) //{ // //in_Producto_Info tmp = new in_Producto_Info(); // //DataRowView tb; // //tb = (DataRowView)ucmb_productos.SelectedRow.ListObject; // //tmp = (in_Producto_Info)tb.Row.ItemArray[9]; // CargaDatosAgrid(CBar, fila); // if (getrows_data() == getrows_grid()) // { // Nueva_fila(); // } //} } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
private void cmbGrupoAsignado_EditValueChanged(object sender, EventArgs e) { try { Etapa = new prd_EtapaProduccion_Info(); EtapaAnterior = new prd_EtapaProduccion_Info(); var Grupo = ((List <prd_SubGrupoTrabajo_Info>)(cmbGrupoAsignado.Properties.DataSource)).First(V => V.IdGrupoTrabajo == Convert.ToDecimal(cmbGrupoAsignado.EditValue)); Etapa = Etapa_B.ObtenerEtapa(param.IdEmpresa, Grupo.IdEtapa, Grupo.IdProcesoProductivo); txtEtapa.Text = Etapa.NombreEtapa; EtapaAnterior = Etapa_B.ObtenerEtapaAnterior(param.IdEmpresa, (Etapa.Posicion - 1), Etapa.IdProcesoProductivo); txtEtapaAnterior.Text = EtapaAnterior.NombreEtapa; in_movi_inve_detalle_x_Producto_CusCider_Info Info = new in_movi_inve_detalle_x_Producto_CusCider_Info(); var OrdenTaller = ((List <prd_OrdenTaller_Info>)(cmbOrdenTaller.Properties.DataSource)).First(v => v.IdOrdenTaller == Convert.ToDecimal(cmbOrdenTaller.EditValue)); Info.ot_IdOrdenTaller = OrdenTaller.IdOrdenTaller; Info.ot_IdEmpresa = OrdenTaller.IdEmpresa; Info.ot_IdSucursal = OrdenTaller.IdSucursal; Info.et_IdEtapa = EtapaAnterior.IdEtapa; Info.et_IdEmpresa = EtapaAnterior.IdEmpresa; Info.et_IdProcesoProductivo = EtapaAnterior.IdProcesoProductivo; Info.IdEmpresa = param.IdEmpresa; Info.IdSucursal = Convert.ToInt32(ctrl_Sucbod.cmb_sucursal.EditValue); Info.IdBodega = Convert.ToInt32(ctrl_Sucbod.cmb_bodega.EditValue); ProductosXEtapa = BusInve.ConsultaSaldosxCtrlProd(Convert.ToInt32(Info.ot_IdEmpresa), Convert.ToInt32(Info.et_IdEmpresa), Convert.ToInt32(Info.et_IdEtapa), Convert.ToInt32(Info.et_IdProcesoProductivo), Convert.ToInt32(Info.ot_IdEmpresa), Info.IdSucursal, cmbObra.EditValue.ToString(), Convert.ToDecimal(Info.ot_IdOrdenTaller)).FindAll(v => v.dm_cantidad > 0); ListadoDisponible = new BindingList <prd_ControlProduccionObreroDetalle_Info>(); foreach (var item in ProductosXEtapa) { prd_ControlProduccionObreroDetalle_Info info = new prd_ControlProduccionObreroDetalle_Info(); info.CodBarraMaestro = item.CodigoBarra; info.Cantidad = 1; var Producto = Prod_b.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); info.pr_descripcion = Producto.pr_descripcion; info.IdProducto = item.IdProducto; info.IdEmpresa = param.IdEmpresa; ListadoDisponible.Add(info); } gridControlDisponible.DataSource = ListadoDisponible; gridControlDisponible.RefreshDataSource(); txtCantDisponible.Text = ProductosXEtapa.ToList().Count.ToString(); List <prd_ControlProduccionObreroDetalle_Info> LstDet = new List <prd_ControlProduccionObreroDetalle_Info>(); foreach (var item in ProductosXEtapa) { prd_ControlProduccionObreroDetalle_Info Ob = new prd_ControlProduccionObreroDetalle_Info(); LstDet.Add(Ob); } ListadoDisponible = new BindingList <prd_ControlProduccionObreroDetalle_Info>(); gridControlDisponible.DataSource = ListadoDisponible; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public void BuscarProducto(int codAscii) { try { if (txtCodigoBarra.Text == "") { MessageBox.Show("Ingrese Codigo Barra", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } InfoProducto = BusTablaIntermedia.TraeProductoxCodigoBarra(txtCodigoBarra.Text, param.IdEmpresa); if (InfoProducto.IdProducto == 0) { MessageBox.Show("El Codigo Barra no Esta Asignado a un Producto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { txtdescripcion.Text = InfoProducto.pr_descripcion; txttoneladas.Text = Convert.ToString(InfoProducto.pr_peso); txtObservacion.Text = InfoProducto.pr_Observacion; } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show("Error " + ex.Message); } }
private Boolean getegresomov() { try { //obtengo el Lst_mv_detalle_eg Detalle del movimiento de egreso int sec = 0; foreach (var item in DetalleEnsam) { in_movi_inve_detalle_Info info = new in_movi_inve_detalle_Info(); in_movi_inve_detalle_x_Producto_CusCider_Info infoxprod = new in_movi_inve_detalle_x_Producto_CusCider_Info(); info.IdEmpresa = infoxprod.IdEmpresa = Convert.ToInt32(param.IdEmpresa); infoxprod.ot_IdEmpresa = Convert.ToInt32(param.IdEmpresa); info.IdSucursal = infoxprod.IdSucursal = _sucursalInfo.IdSucursal; infoxprod.ot_IdSucursal = _sucursalInfo.IdSucursal; info.IdBodega = infoxprod.IdBodega = _bodegaInfo.IdBodega; info.IdProducto = infoxprod.IdProducto = item.IdProducto; infoxprod.CodigoBarra = item.CodigoBarra; info.Secuencia = infoxprod.mv_Secuencia = ++sec; info.IdMovi_inven_tipo = infoxprod.IdMovi_inven_tipo = Convert.ToInt32(paramCidersus.IdMovi_inven_tipo_egr_Ensamblado); info.mv_tipo_movi = infoxprod.mv_tipo_movi = "-"; info.dm_cantidad = infoxprod.dm_cantidad = -1; var saldo = Bus_prodxbod.Get_Info_Producto_x_Producto(param.IdEmpresa, _sucursalInfo.IdSucursal, _bodegaInfo.IdBodega, item.IdProducto); info.dm_stock_ante = saldo.pr_stock; info.dm_stock_actu = info.dm_stock_ante + info.dm_cantidad; in_Producto_Info prodtemp = new in_Producto_Info(); prodtemp = busprod.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); info.dm_precio = infoxprod.dm_precio = prodtemp.pr_precio_publico == null ? 0 : Convert.ToDouble(prodtemp.pr_precio_publico); info.mv_costo = info.dm_precio; infoxprod.mv_costo = infoxprod.mv_costo = prodtemp.pr_costo_promedio == null ? 0 : Convert.ToDouble(prodtemp.pr_precio_publico); info.dm_observacion = infoxprod.dm_observacion = " Egr Suc " + UCSuc_Bod.cmb_sucursal.Text + " Bod " + UCSuc_Bod.cmb_bodega.Text + " " + item.Observacion; infoxprod.ot_CodObra = UCObra.get_item(); infoxprod.ot_IdOrdenTaller = OT.IdOrdenTaller; Lst_mv_detalleXprod_eg.Add(infoxprod); Lst_mv_detalle_eg.Add(info); } return(true); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show("Ha ocurrido un error:" + ex.InnerException.ToString()); return(false); } }
public void GenerarSuPiezas() { try { Int32 cont = Convert.ToInt32(txtUnidadesCortadas.Text); //Int32 Sec = 0; while (cont > 0) { Sec++; cont--; // generacion de datos para tabla in_movi_inve_detalle_x_Producto_CusCider InfoSubPiezasTablaIntermedia = new in_movi_inve_detalle_x_Producto_CusCider_Info(); InfoSubPiezasTablaIntermedia.IdEmpresa = param.IdEmpresa; InfoSubPiezasTablaIntermedia.IdSucursal = param.IdSucursal; InfoSubPiezasTablaIntermedia.IdBodega = InfoProductoAcortar.IdBodega; InfoSubPiezasTablaIntermedia.IdMovi_inven_tipo = 3;// ING X CONV A PROD //InfoDetalleSubPieza.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_egr_Conversion); InfoSubPiezasTablaIntermedia.IdNumMovi = 0; InfoSubPiezasTablaIntermedia.mv_Secuencia = 1; InfoSubPiezasTablaIntermedia.Secuencia = Sec; InfoSubPiezasTablaIntermedia.IdProducto = InfoProductoAcortar.IdProducto; InfoSubPiezasTablaIntermedia.CodigoBarra = CodigoBarra + "-" + "C" + "-" + Sec + "-" + Convert.ToDouble(txtalturaCortar.Text) + "X" + Convert.ToDouble(txtLargoCortar.Text); InfoSubPiezasTablaIntermedia.mv_tipo_movi = "-"; InfoSubPiezasTablaIntermedia.dm_cantidad = 1; InfoSubPiezasTablaIntermedia.dm_observacion = txtObserva.Text; InfoSubPiezasTablaIntermedia.dm_precio = InfoProductoAcortar.dm_precio; InfoSubPiezasTablaIntermedia.mv_costo = InfoProductoAcortar.mv_costo; InfoSubPiezasTablaIntermedia.pr_Descripcion = "CORTE PROD" + InfoProductoAcortar.IdProducto + InfoProductoAcortar.pr_Descripcion + "PARA" + cmbOrdenTaller.Text; InfoSubPiezasTablaIntermedia.pr_alto = Convert.ToDouble(txtalturaCortar.Text); InfoSubPiezasTablaIntermedia.pr_largo = Convert.ToDouble(txtLargoCortar.Text); InfoSubPiezasTablaIntermedia.ot_CodObra = cmbObra.EditValue.ToString(); InfoSubPiezasTablaIntermedia.ot_IdOrdenTaller = Convert.ToDecimal(cmbOrdenTaller.EditValue); InfoSubPiezasTablaIntermedia.et_IdProcesoProductivo = InfoProductoAcortar.et_IdProcesoProductivo; InfoSubPiezasTablaIntermedia.pr_peso = PesoSubPieza; InfoSubPiezasTablaIntermedia.ocd_IdOrdenCompra = InfoProductoAcortar.ocd_IdOrdenCompra; InfoSubPiezasTablaIntermedia.NumDocumentoRelacionadoProveedor = InfoProductoAcortar.NumDocumentoRelacionadoProveedor; InfoSubPiezasTablaIntermedia.NumFacturaProveedor = InfoProductoAcortar.NumFacturaProveedor; ListaSubPiezas.Add(InfoSubPiezasTablaIntermedia); } gridControlSubPiezas.DataSource = ListaSubPiezas; gridControlSubPiezas.RefreshDataSource(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message); } }
private void _cmbProducto_EditValueChanged(object sender, EventArgs e) { try { if (_cmbProducto.EditValue != null) { int sec = 0; Producto.IdProducto = Convert.ToDecimal(_cmbProducto.EditValue); LStCodBarra = BusCodBarra.TraeCodBarraxProd(param.IdEmpresa, Producto.IdProducto); var select2 = from C in LStCodBarra join B in SaldosCBarra on new { C.IdEmpresa, C.IdSucursal, C.IdBodega, C.IdProducto, C.CodigoBarra } equals new { B.IdEmpresa, B.IdSucursal, B.IdBodega, B.IdProducto, B.CodigoBarra } where B.dm_cantidad > 0 && B.IdBodega == IdBodega && B.IdEmpresa == param.IdEmpresa && B.IdSucursal == IdSucursal select new { C.IdEmpresa, C.IdSucursal, C.IdBodega, C.IdProducto, C.CodigoBarra, B.dm_cantidad }; LStCodBarra = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); foreach (var item in select2) { in_movi_inve_detalle_x_Producto_CusCider_Info info = new in_movi_inve_detalle_x_Producto_CusCider_Info(); info.IdEmpresa = item.IdEmpresa; info.IdSucursal = item.IdSucursal; info.IdBodega = item.IdBodega; info.CodigoBarra = item.CodigoBarra; info.IdProducto = item.IdProducto; info.dm_cantidad = (double)item.dm_cantidad; LStCodBarra.Add(info); } LStCodBarra.ForEach(var => var.Secuencia = ++sec); gridCtrlCodBarra.DataSource = LStCodBarra; } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
private void gridVwCodBarra_DoubleClick(object sender, EventArgs e) { try { info = (in_movi_inve_detalle_x_Producto_CusCider_Info)gridVwCodBarra.GetFocusedRow(); Prod_CB = info; Event_gridVwCodBarra_DoubleClick(info, e); Close(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
void obtieneinfo() { try { in_movi_inve_detalle_x_Producto_CusCider_Info Info = null; Info = (in_movi_inve_detalle_x_Producto_CusCider_Info)gridVwCodigoBarraDisp.GetFocusedRow(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.InnerException.ToString()); } }
public Boolean GuardarTIMovim_EgresoConsumo(in_movi_inve_detalle_x_Producto_CusCider_Info Info) { try { return(Data.GuardarTIMovim_EgresoConsumo(Info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarTIMovim_EgresoConsumo", ex.Message), ex) { EntityType = typeof(in_movi_inven_x_in_movi_inven_CusCidersus_Bus) }; } }
public Boolean LiberarMP_de_Obra_preasignada(in_movi_inve_detalle_x_Producto_CusCider_Info Info) { try { return(Data.LiberarMP_de_Obra_preasignada(Info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ActualizarEstadoAprob", ex.Message), ex) { EntityType = typeof(in_movi_inve_detalle_x_Producto_CusCider_Bus) }; } }
private void gridViewElementosRestantes_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { in_movi_inve_detalle_x_Producto_CusCider_Info Infocorte = new in_movi_inve_detalle_x_Producto_CusCider_Info(); Infocorte = (in_movi_inve_detalle_x_Producto_CusCider_Info)gridViewElementosRestantes.GetFocusedRow(); txtAncho.Focus(); if (e.Column.Name == "CooCollpr_largo" || e.Column.Name == "Collpr_alto") { if (Infocorte.pr_alto != null && Infocorte.pr_largo != null) { pr_PesoMpSobrante = Convert.ToDouble(Infocorte.pr_alto) * Convert.ToDouble(Infocorte.pr_largo) * PesoPorDimensiopn; gridViewElementosRestantes.SetFocusedRowCellValue(ColCodBarra, CodigoBarra); gridViewElementosRestantes.SetFocusedRowCellValue(pr_pesoR, pr_PesoMpSobrante); } } //if (Infocorte != null) //{ // if (Infocorte.pr_alto != null) // { // pr_altoMpSobrante = (double)Infocorte.pr_alto; // } // else // { // pr_altoMpSobrante = 1; // } // if (Infocorte.pr_largo != null) // { // pr_largoMpSobrante = (double)Infocorte.pr_largo; // } // else // { // pr_largoMpSobrante = 1; // } // pr_PesoMpSobrante = pr_largoMpSobrante * pr_altoMpSobrante * PesoSubPieza; // } } catch (Exception ex) { } }
private void txtCodigoBarra_KeyPress(object sender, KeyPressEventArgs e) { try { string sTipoMovimiento = "-"; if (e.KeyChar == 13) { InfoProductoAcortar = BusInve.TraeProductoxCodigoBarra_UltMov(txtCodigoBarra.Text, param.IdEmpresa, sTipoMovimiento); if (InfoProductoAcortar.CodigoBarra != null) { InfoProductoDimensiones = BusProductoDimensiones.Get_Info_BuscarProducto_Dimensiones(param.IdEmpresa, InfoProductoAcortar.IdProducto); txtProducto.Text = InfoProductoAcortar.pr_descripcion; //txtProfundidad.Text =Convert.ToString( InfoProductoAcortar.pr_profundidad); //txtaltura.Text = Convert.ToString(InfoProductoAcortar.pr_alto); //txtAncho.Text = Convert.ToString(InfoProductoAcortar.pr_largo); txtProfundidad.Text = Convert.ToString(InfoProductoAcortar.pr_profundidad); txtaltura.Text = Convert.ToString(InfoProductoDimensiones.alto); txtAncho.Text = Convert.ToString(InfoProductoDimensiones.longitud); CodigoBarra = txtCodigoBarra.Text; TxtPeso.Text = InfoProductoAcortar.pr_peso.ToString(); //cmbObra.EditValue = InfoProductoAcortar.ot_CodObra; //cmbOrdenTaller.EditValue = InfoProductoAcortar.ot_IdOrdenTaller; txtCodigoBarra.Text = ""; //txtProfundidad.Text = ""; //TxtPeso.Text = ""; //txtaltura.Text = ""; //txtAncho.Text = ""; //txtProducto.Text = ""; } else { MessageBox.Show("El Producto con CB:" + txtCodigoBarra.Text + "No registra Egreso"); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message); } }
public List <in_movi_inve_detalle_x_Producto_CusCider_Info> ConsultaTIMovim_EgresoConsumo(in_movi_inve_Info MovimientoPrinc) { try { List <in_movi_inve_detalle_x_Producto_CusCider_Info> Lst = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); EntitiesProduccion_Cidersus oEnti = new EntitiesProduccion_Cidersus(); var Query = from q in oEnti.in_movi_inve_detalle_x_Producto_CusCider where (q.IdEmpresa == MovimientoPrinc.IdEmpresa && q.IdSucursal == MovimientoPrinc.IdSucursal && q.IdMovi_inven_tipo == MovimientoPrinc.IdMovi_inven_tipo && q.IdBodega == MovimientoPrinc.IdBodega && q.IdNumMovi == MovimientoPrinc.IdNumMovi) select q; foreach (var item in Query) { in_movi_inve_detalle_x_Producto_CusCider_Info Obj = new in_movi_inve_detalle_x_Producto_CusCider_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdSucursal = item.IdSucursal; Obj.IdBodega = item.IdBodega; Obj.IdMovi_inven_tipo = item.IdMovi_inven_tipo; Obj.IdNumMovi = item.IdNumMovi; Obj.IdEmpresa = item.IdEmpresa; Obj.IdSucursal = item.IdSucursal; Obj.IdBodega = item.IdBodega; Obj.IdMovi_inven_tipo = item.IdMovi_inven_tipo; Obj.IdNumMovi = item.IdNumMovi; Obj.CodigoBarra = item.CodigoBarra; Lst.Add(Obj); } return(Lst); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.ToString() + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
//private void cmbProducto_SelectedValueChanged(object sender, EventArgs e) //{ // try // { // if (cmbProducto.Value != null) // { // int sec=0; // Producto.IdProducto = (decimal)cmbProducto.Value; // LStCodBarra = BusCodBarra.TraeCodBarraxProd(param.IdEmpresa, Producto.IdProducto); // var select2 = from C in LStCodBarra // join B in SaldosCBarra // on new { C.IdEmpresa, C.IdSucursal, C.IdBodega, C.IdProducto, C.CodigoBarra} // equals new { B.IdEmpresa, B.IdSucursal, B.IdBodega, B.IdProducto ,B.CodigoBarra} // where B.dm_cantidad >0 // && B.IdBodega == IdBodega // && B.IdEmpresa == param.IdEmpresa // && B.IdSucursal == IdSucursal // select new { C.IdEmpresa, C.IdSucursal, C.IdBodega, C.IdProducto, C.CodigoBarra, // B.dm_cantidad}; // LStCodBarra = new List<in_movi_inve_detalle_x_Producto_CusCider_Info>(); // foreach (var item in select2) // { // in_movi_inve_detalle_x_Producto_CusCider_Info info = new in_movi_inve_detalle_x_Producto_CusCider_Info(); // info.IdEmpresa = item.IdEmpresa; // info.IdSucursal = item.IdSucursal; // info.IdBodega = item.IdBodega; // info.CodigoBarra = item.CodigoBarra; // info.IdProducto = item.IdProducto; // info.dm_cantidad = (double)item.dm_cantidad; // LStCodBarra.Add(info); // } // LStCodBarra.ForEach(var => var.Secuencia = ++sec); // gridCtrlCodBarra.DataSource = LStCodBarra; // } // } // catch (Exception ex) // { // Log_Error_bus.Log_Error(ex.ToString()); // } //} //private void cmbProducto_Validating(object sender, CancelEventArgs e) //{ // try // { // if (cmbProducto.Value == null) // { // cmbProducto.Text = ""; // } // } // catch (Exception ex) // { // Log_Error_bus.Log_Error(ex.ToString()); // } //} //private void btnSalir_Click(object sender, EventArgs e) //{ //} private void BtnSeleccionar_Click(object sender, EventArgs e) { try { info = new in_movi_inve_detalle_x_Producto_CusCider_Info(); info = (in_movi_inve_detalle_x_Producto_CusCider_Info)gridVwCodBarra.GetFocusedRow(); if (info == null) { MessageBox.Show("Seleccione un item para agregar", "Sistema"); } else { Prod_CB = info; this.Close(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
//CellValueChanged private void gridViewElementosRestantes_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { try { in_movi_inve_detalle_x_Producto_CusCider_Info Infocorte = new in_movi_inve_detalle_x_Producto_CusCider_Info(); Infocorte = (in_movi_inve_detalle_x_Producto_CusCider_Info)gridViewElementosRestantes.GetFocusedRow(); txtAncho.Focus(); gridViewElementosRestantes.SetFocusedRowCellValue(ColCodBarra, CodigoBarra); if (Infocorte != null) { if (Infocorte.pr_alto != null) { pr_altoMpSobrante = (double)Infocorte.pr_alto; } else { pr_altoMpSobrante = 1; } if (Infocorte.pr_largo != null) { pr_largoMpSobrante = (double)Infocorte.pr_largo; } else { pr_largoMpSobrante = 1; } pr_PesoMpSobrante = pr_largoMpSobrante * pr_altoMpSobrante * PesoPorDimensiopn; // pr_PesoMpSobrante = pr_largoMpSobrante * pr_altoMpSobrante * PesoSubPieza; } gridViewElementosRestantes.SetFocusedRowCellValue(pr_pesoR, pr_PesoMpSobrante); } catch (Exception ex) { } }
private List <in_movi_inve_detalle_x_Producto_CusCider_Info> agregarsaldoskardex(int tipo, List <in_movi_inve_detalle_x_Producto_CusCider_Info> kardex) { try { in_movi_inve_detalle_x_Producto_CusCider_Info saldo = new in_movi_inve_detalle_x_Producto_CusCider_Info(); if (tipo == 0)//saldo inicial { List <in_movi_inve_detalle_x_Producto_CusCider_Info> temporalkardex = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); temporalkardex = kardex; kardex = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); saldo.dm_observacion = "Saldo Inicial"; saldo.cm_fecha = dtpFechaIni.Value; saldo.existencia = existencia; saldo.mv_tipo_movi = ""; kardex.Add(saldo); foreach (var item in temporalkardex) { kardex.Add(item); } } else //saldo final { saldo.dm_observacion = "Saldo Final"; saldo.cm_fecha = dtpFechaFin.Value; saldo.existencia = existencia; saldo.mv_tipo_movi = ""; kardex.Add(saldo); } return(kardex); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); return(new List <in_movi_inve_detalle_x_Producto_CusCider_Info>()); } }
private Boolean getInfo() { try { InfoCabMovInv = new in_movi_inve_Info(); //datos de la cabecera InfoCabMovInv.IdEmpresa = param.IdEmpresa; InfoCabMovInv.IdSucursal = UCSuc_Bod.get_sucursal().IdSucursal; InfoCabMovInv.IdBodega = UCSuc_Bod.get_bodega().IdBodega; InfoCabMovInv.Fecha_Transac = param.Fecha_Transac; InfoCabMovInv.IdProvedor = ucCp_Proveedor.get_ProveedorInfo().IdProveedor; InfoCabMovInv.IdMovi_inven_tipo = Convert.ToInt32(paramCus.IdMovi_inven_tipo_ing_suc_princ); InfoCabMovInv.cm_observacion = txtObservacion.Text + " Ing Bod FAC.#" + txtFact.Text; InfoCabMovInv.NumDocumentoRelacionado = txtGuiaDesp.Text; InfoCabMovInv.NumFactura = txtFact.Text; InfoCabMovInv.cm_anio = InfoCabMovInv.Fecha_Transac.Value.Year; InfoCabMovInv.cm_fecha = dtPfecha.Value; InfoCabMovInv.cm_mes = InfoCabMovInv.Fecha_Transac.Value.Month; InfoCabMovInv.cm_tipo = "+"; InfoCabMovInv.IdUsuario = param.IdUsuario; InfoCabMovInv.Estado = "A"; //datos del detalle List <com_ordencompra_local_det_Info> TempLstDetOC = new List <com_ordencompra_local_det_Info>(); LstDetOC = new List <com_ordencompra_local_det_Info>(); TempLstDetOC = (List <com_ordencompra_local_det_Info>)gridCtrlMoviInvDet.DataSource; int sec = 0; //los datos de la grilla lo pasamos a la Lista del Detalle de O/C foreach (var item in TempLstDetOC) { if (item.dm_cantidad > 0) { item.mv_sec = ++sec; LstDetOC.Add(item); } } sec = 0; //los datos de la Lista del Detalle de O/C lo pasamos al Detalle del Movi Inventario LStDet = new List <in_movi_inve_detalle_Info>(); foreach (var item in LstDetOC) { in_movi_inve_detalle_Info info = new in_movi_inve_detalle_Info(); info.IdEmpresa = InfoCabMovInv.IdEmpresa; info.IdSucursal = InfoCabMovInv.IdSucursal; info.IdBodega = InfoCabMovInv.IdBodega; info.IdMovi_inven_tipo = Convert.ToInt32(paramCus.IdMovi_inven_tipo_ing_suc_princ); info.Secuencia = item.mv_sec; info.oc_IdEmpresa = item.IdEmpresa; info.oc_IdOrdenCompra = item.IdOrdenCompra; info.oc_IdSucursal = item.IdSucursal; info.oc_Secuencial = item.Secuencia; info.oc_NumDocumento = item.oc_NumDocumento; info.mv_tipo_movi = "+"; info.IdProducto = item.IdProducto; info.dm_cantidad = item.dm_cantidad; var prodxbod = BusProdxBod.Get_Info_Producto_x_Producto(param.IdEmpresa, InfoCabMovInv.IdSucursal, InfoCabMovInv.IdBodega, item.IdProducto); info.dm_stock_ante = prodxbod.pr_stock; info.dm_stock_actu = prodxbod.pr_stock + item.dm_cantidad; var prod = Busprod.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); InfoCabMovInv.cm_observacion = txtObservacion.Text + " Ing Bod FAC.#" + txtFact.Text; info.dm_precio = prod.pr_precio_publico; info.mv_costo = prod.pr_costo_promedio; info.CodObra_preasignada = item.CodObra_preasignada; info.IdOrdenTaller_preasignada = item.IdOrdenTaller_preasignada; LStDet.Add(info); } InfoCabMovInv.listmovi_inve_detalle_Info = LStDet; //los datos del Detalle del Movi Inventario lo pasamos a la Lista de Detalle x items LstDetMovi = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); foreach (var item in LStDet) { sec = 0; for (int i = 0; i < item.dm_cantidad; i++) { in_Producto_Info infoSle = new in_Producto_Info(); infoSle = ListadoProductos.FirstOrDefault(V => V.IdProducto == item.IdProducto); if (infoSle.pr_ManejaSeries == "S") { sec = sec + 1; in_movi_inve_detalle_x_Producto_CusCider_Info info = new in_movi_inve_detalle_x_Producto_CusCider_Info(); info.IdEmpresa = InfoCabMovInv.IdEmpresa; info.IdSucursal = InfoCabMovInv.IdSucursal; info.IdBodega = InfoCabMovInv.IdBodega; info.IdMovi_inven_tipo = Convert.ToInt32(paramCus.IdMovi_inven_tipo_ing_suc_princ); info.mv_tipo_movi = "+"; info.mv_Secuencia = item.Secuencia; info.Secuencia = sec; if (txtID.Text != "") { info.IdNumMovi = Convert.ToUInt32(txtID.Text); } else { info.IdNumMovi = 0; } info.IdProducto = item.IdProducto; info.dm_cantidad = 1; info.dm_observacion = item.dm_observacion; info.dm_precio = infoSle.pr_precio_publico == null ? 0 : Convert.ToDouble(infoSle.pr_precio_publico); info.mv_costo = infoSle.pr_costo_promedio == null ? 0 : Convert.ToDouble(infoSle.pr_costo_promedio); info.CodObra_preasignada = item.CodObra_preasignada; info.IdOrdenTaller_preasignada = item.IdOrdenTaller_preasignada; LstDetMovi.Add(info); } } } return(true); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); return(false); } }
public void Get() { try { gridControlSubPiezas.DataSource = ListaSubPiezas; ListaMP_SobranteTablaIntermedia = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); //**************** generar datos para las piezas cortadas********************************* int sec = 0; foreach (var item in ListaSubPiezas) { InfoDetalleSubPieza = new in_movi_inve_detalle_Info(); InfoDetalleSubPieza.IdEmpresa = item.IdEmpresa; InfoDetalleSubPieza.IdSucursal = item.IdSucursal; InfoDetalleSubPieza.IdBodega = item.IdBodega; InfoDetalleSubPieza.IdMovi_inven_tipo = 3; //InfoDetalleSubPieza.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_egr_Conversion); InfoDetalleSubPieza.IdNumMovi = 0; InfoDetalleSubPieza.Secuencia = item.Secuencia; InfoDetalleSubPieza.mv_tipo_movi = "+"; InfoDetalleSubPieza.IdProducto = InfoProductoAcortar.IdProducto; InfoDetalleSubPieza.dm_cantidad = 1; InfoDetalleSubPieza.dm_stock_actu = 1; InfoDetalleSubPieza.dm_stock_ante = 1; InfoProductoAcortar.dm_observacion = "SUBPIEZA " + InfoProductoAcortar.IdProducto + "-" + txtCodigoBarra.Text; InfoDetalleSubPieza.dm_precio = 0; InfoDetalleSubPieza.mv_costo = 0; InfoDetalleSubPieza.oc_IdOrdenCompra = Convert.ToDecimal(item.ocd_IdOrdenCompra); InfoDetalleSubPieza.NumDocumentoRelacionadoProveedor = item.NumDocumentoRelacionadoProveedor; InfoDetalleSubPieza.NumFacturaProveedor = item.NumFacturaProveedor; ListaDetalle_SubProductos.Add(InfoDetalleSubPieza); } // generacion de datos para in_movi_inve InfoSubPiezaCab = new in_movi_inve_Info(); InfoSubPiezaCab.IdEmpresa = param.IdEmpresa; InfoSubPiezaCab.IdSucursal = param.IdSucursal; InfoSubPiezaCab.IdBodega = InfoProductoAcortar.IdBodega; InfoSubPiezaCab.IdNumMovi = 0; InfoSubPiezaCab.CodMoviInven = "MOVCP"; InfoSubPiezaCab.cm_tipo = "-"; InfoSubPiezaCab.cm_observacion = cmbObra.Text + " " + txtObserva.Text; InfoSubPiezaCab.cm_fecha = DateTime.Now; InfoSubPiezaCab.cm_anio = DateTime.Now.Year; InfoSubPiezaCab.cm_mes = DateTime.Now.Month; InfoSubPiezaCab.IdUsuario = param.IdUsuario; InfoSubPiezaCab.Estado = "A"; InfoSubPiezaCab.Fecha_Transac = DateTime.Now; InfoSubPiezaCab.IdMovi_inven_tipo = 3; //InfoDetalleSubPieza.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_egr_Conversion); InfoSubPiezaCab.listmovi_inve_detalle_Info = ListaDetalle_SubProductos; //*****************LISTADOS DE MATERIA PRIMA SOBRANDE O RESIDUO DE LA PIEZA CORTADA*********************** foreach (var item in ListaRetazoTmp) {// generacion de datos para tabla in_movi_inve_detalle_x_Producto_CusCider sec = sec + 1; InfoMP_SobranteTablaIntermedia = new in_movi_inve_detalle_x_Producto_CusCider_Info(); InfoMP_SobranteTablaIntermedia.IdEmpresa = param.IdEmpresa; InfoMP_SobranteTablaIntermedia.IdSucursal = param.IdSucursal; InfoMP_SobranteTablaIntermedia.IdBodega = InfoProductoAcortar.IdBodega; InfoMP_SobranteTablaIntermedia.IdMovi_inven_tipo = 5;//ING X CONV A MP X RESIDUO //InfoMP_SobranteTablaIntermedia.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_ing_Conversion); InfoMP_SobranteTablaIntermedia.IdNumMovi = 0; InfoMP_SobranteTablaIntermedia.mv_Secuencia = 1; InfoMP_SobranteTablaIntermedia.Secuencia = sec; InfoMP_SobranteTablaIntermedia.IdProducto = InfoProductoAcortar.IdProducto; InfoMP_SobranteTablaIntermedia.CodigoBarra = item.CodigoBarra + "-" + "R" + "-" + sec + "-" + item.pr_alto + "X" + item.pr_largo; InfoMP_SobranteTablaIntermedia.mv_tipo_movi = "+"; InfoMP_SobranteTablaIntermedia.dm_cantidad = 1; InfoMP_SobranteTablaIntermedia.dm_observacion = txtObserva.Text; InfoMP_SobranteTablaIntermedia.dm_precio = InfoProductoAcortar.dm_precio; InfoMP_SobranteTablaIntermedia.mv_costo = InfoProductoAcortar.mv_costo; InfoMP_SobranteTablaIntermedia.pr_Descripcion = "RESIDUO MP PRODUCTO CO " + InfoProductoAcortar.IdProducto + " DESC" + InfoProductoAcortar.pr_Descripcion + "PARA" + cmbOrdenTaller.Text; InfoMP_SobranteTablaIntermedia.pr_alto = item.pr_alto; InfoMP_SobranteTablaIntermedia.pr_largo = item.pr_largo; InfoMP_SobranteTablaIntermedia.ot_CodObra = cmbObra.EditValue.ToString(); InfoMP_SobranteTablaIntermedia.ot_IdOrdenTaller = Convert.ToDecimal(cmbOrdenTaller.EditValue); InfoMP_SobranteTablaIntermedia.pr_peso = item.pr_peso; InfoMP_SobranteTablaIntermedia.et_IdProcesoProductivo = InfoProductoAcortar.et_IdProcesoProductivo; InfoMP_SobranteTablaIntermedia.ocd_IdOrdenCompra = Convert.ToDecimal(InfoProductoAcortar.ocd_IdOrdenCompra); InfoMP_SobranteTablaIntermedia.NumDocumentoRelacionadoProveedor = InfoProductoAcortar.NumDocumentoRelacionadoProveedor; InfoMP_SobranteTablaIntermedia.NumFacturaProveedor = InfoProductoAcortar.NumFacturaProveedor; ListaMP_SobranteTablaIntermedia.Add(InfoMP_SobranteTablaIntermedia); // llenar lista de detalle de MP sobrante para la tabla in_movi_inve_detalle InfoDetalleMPSobrante = new in_movi_inve_detalle_Info(); InfoDetalleMPSobrante.IdEmpresa = item.IdEmpresa; InfoDetalleMPSobrante.IdSucursal = item.IdSucursal; InfoDetalleMPSobrante.IdBodega = item.IdBodega; InfoDetalleMPSobrante.IdMovi_inven_tipo = 5; //InfoMP_SobranteTablaIntermedia.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_ing_Conversion); InfoDetalleMPSobrante.IdNumMovi = 0; InfoDetalleMPSobrante.Secuencia = item.Secuencia; InfoDetalleMPSobrante.mv_tipo_movi = "+"; InfoDetalleMPSobrante.IdProducto = InfoProductoAcortar.IdProducto; InfoDetalleMPSobrante.dm_cantidad = 1; InfoDetalleMPSobrante.dm_stock_actu = 1; InfoDetalleMPSobrante.dm_stock_ante = 1; InfoDetalleMPSobrante.dm_observacion = "MP SOBRANTE PROD. COD. " + item.IdProducto + item.CodigoBarra; InfoDetalleMPSobrante.dm_precio = 0; InfoDetalleMPSobrante.mv_costo = 0; InfoDetalleMPSobrante.oc_IdOrdenCompra = Convert.ToDecimal(InfoProductoAcortar.ocd_IdOrdenCompra); InfoDetalleMPSobrante.NumDocumentoRelacionadoProveedor = InfoProductoAcortar.NumDocumentoRelacionadoProveedor; InfoDetalleMPSobrante.NumFacturaProveedor = InfoProductoAcortar.NumFacturaProveedor; ListaDetalle_MP_Sobrante_POrCorteMP.Add(InfoDetalleMPSobrante); } // generacion de datos para in_movi_inve de mp sobrante InfoMP_Sobrante_CAB = new in_movi_inve_Info(); InfoMP_Sobrante_CAB.IdEmpresa = param.IdEmpresa; InfoMP_Sobrante_CAB.IdSucursal = param.IdSucursal; InfoMP_Sobrante_CAB.IdBodega = InfoProductoAcortar.IdBodega; InfoMP_Sobrante_CAB.IdMovi_inven_tipo = 5; //InfoMP_SobranteTablaIntermedia.IdMovi_inven_tipo = Convert.ToInt16(_Parametros_Info.IdMovi_inven_tipo_ing_Conversion); InfoMP_Sobrante_CAB.IdNumMovi = 0; InfoMP_Sobrante_CAB.CodMoviInven = "MOVCP"; InfoMP_Sobrante_CAB.cm_tipo = "+"; InfoMP_Sobrante_CAB.cm_observacion = cmbObra.Text + " " + txtObserva.Text; InfoMP_Sobrante_CAB.cm_fecha = DateTime.Now; InfoMP_Sobrante_CAB.cm_anio = DateTime.Now.Year; InfoMP_Sobrante_CAB.cm_mes = DateTime.Now.Month; InfoMP_Sobrante_CAB.IdUsuario = param.IdUsuario; InfoMP_Sobrante_CAB.Estado = "A"; InfoMP_Sobrante_CAB.Fecha_Transac = DateTime.Now; InfoMP_Sobrante_CAB.listmovi_inve_detalle_Info = ListaDetalle_MP_Sobrante_POrCorteMP; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); } }
void frm_Event_FrmIn_CodigoBarra_Busqueda_FormClosing(object sender, FormClosingEventArgs e, in_movi_inve_detalle_x_Producto_CusCider_Info Info) { try { if (Info != null && Info.CodigoBarra != "") { funcion(Info); } //validarepetidos(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public List <in_movi_inve_detalle_x_Producto_CusCider_Info> ObtenerProductosxEtapa(in_movi_inve_detalle_x_Producto_CusCider_Info Item) { try { return(Data.ObtenerProductosxEtapa(Item)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ObtenerProductosxEtapa", ex.Message), ex) { EntityType = typeof(in_movi_inve_detalle_x_Producto_CusCider_Bus) }; } }
public vwin_movi_inve_detalle_x_Producto_CusCider_Saldos_Info SaldosxItemsxCodBarra(in_movi_inve_detalle_x_Producto_CusCider_Info Info) { try { return(Data.SaldosxItemsxCodBarra(Info)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "SaldosxItemsxCodBarra", ex.Message), ex) { EntityType = typeof(in_movi_inve_detalle_x_Producto_CusCider_Bus) }; } }
private Boolean getCab() { try { MovEgreso = new in_movi_inve_Info(); MovEgreso.Idobra = UCObra.get_item_info().CodObra; MovEgreso.IdordenTaller = Convert.ToInt32(CmbOrdenTaller.EditValue); MovIngreso.IdEmpresa = MovEgreso.IdEmpresa = param.IdEmpresa; MovEgreso.IdSucursal = _sucursalInfo.IdSucursal; MovIngreso.IdSucursal = paramCidersus.IdSucursal_Produccion; MovEgreso.IdBodega = _bodegaInfo.IdBodega; MovIngreso.IdBodega = paramCidersus.IdBodega_Produccion; MovIngreso.cm_anio = MovEgreso.cm_anio = dtpFecha.Value.Year; MovIngreso.cm_fecha = MovEgreso.cm_fecha = dtpFecha.Value; MovIngreso.cm_mes = MovEgreso.cm_mes = dtpFecha.Value.Month; MovEgreso.cm_tipo = "-"; MovIngreso.cm_tipo = "+"; MovIngreso.Estado = MovEgreso.Estado = "A"; MovEgreso.IdMovi_inven_tipo = Convert.ToInt32(paramCidersus.IdMovi_inven_tipo_egr_consumoprod); MovIngreso.IdMovi_inven_tipo = Convert.ToInt32(paramCidersus.IdMovi_inven_tipo_ing_consumoprod); var bod = busbod.Get_Info_Bodega(param.IdEmpresa, paramCidersus.IdSucursal_Produccion, paramCidersus.IdBodega_Produccion); MovEgreso.IdUsuario = MovIngreso.IdUsuario = param.IdUsuario; MovEgreso.nom_pc = MovIngreso.nom_pc = param.nom_pc; MovEgreso.ip = MovIngreso.ip = param.ip; MovEgreso.Fecha_Transac = MovIngreso.Fecha_Transac = param.Fecha_Transac; int sec = 0; LstProdGrid = new List <in_movi_inve_detalle_Info>(); foreach (var item in ListadoDisponible) { LstProdGrid.Add(item); } foreach (var item in LstProdGrid) { in_movi_inve_detalle_Info ing = new in_movi_inve_detalle_Info(); in_movi_inve_detalle_Info egr = new in_movi_inve_detalle_Info(); in_movi_inve_detalle_x_Producto_CusCider_Info ItemCodBarIng = new in_movi_inve_detalle_x_Producto_CusCider_Info(); in_movi_inve_detalle_x_Producto_CusCider_Info ItemCodBarEgr = new in_movi_inve_detalle_x_Producto_CusCider_Info(); ItemCodBarIng.IdEmpresa = ItemCodBarEgr.IdEmpresa = ing.IdEmpresa = egr.IdEmpresa = param.IdEmpresa; ItemCodBarIng.IdSucursal = ing.IdSucursal = MovIngreso.IdSucursal; ItemCodBarEgr.IdSucursal = egr.IdSucursal = MovEgreso.IdSucursal; ItemCodBarIng.IdBodega = ing.IdBodega = MovIngreso.IdBodega; ItemCodBarEgr.IdBodega = egr.IdBodega = MovEgreso.IdBodega; ing.dm_cantidad = ItemCodBarIng.dm_cantidad = 1; egr.dm_cantidad = ItemCodBarEgr.dm_cantidad = -1; ing.IdMovi_inven_tipo = ItemCodBarIng.IdMovi_inven_tipo = MovIngreso.IdMovi_inven_tipo; egr.IdMovi_inven_tipo = ItemCodBarEgr.IdMovi_inven_tipo = MovEgreso.IdMovi_inven_tipo; egr.Secuencia = ing.Secuencia = ItemCodBarEgr.mv_Secuencia = ItemCodBarIng.mv_Secuencia = ++sec; var saldoing = Bus_prodxbod.Get_Info_Producto_x_Producto(param.IdEmpresa, MovIngreso.IdSucursal, MovIngreso.IdBodega, item.IdProducto); var saldoegr = Bus_prodxbod.Get_Info_Producto_x_Producto(param.IdEmpresa, MovEgreso.IdSucursal, MovEgreso.IdBodega, item.IdProducto); ing.dm_stock_ante = saldoing.pr_stock; ing.dm_stock_actu = saldoing.pr_stock + ing.dm_cantidad; egr.dm_stock_ante = saldoegr.pr_stock; egr.dm_stock_actu = saldoegr.pr_stock - egr.dm_cantidad; ItemCodBarIng.ot_IdEmpresa = param.IdEmpresa; ItemCodBarIng.ot_IdSucursal = OT.IdSucursal; ItemCodBarIng.ot_IdOrdenTaller = OT.IdOrdenTaller; ItemCodBarIng.ot_CodObra = OT.CodObra; ing.IdProducto = egr.IdProducto = ItemCodBarEgr.IdProducto = ItemCodBarIng.IdProducto = item.IdProducto; ItemCodBarEgr.CodigoBarra = ItemCodBarIng.CodigoBarra = item.CodBarra; ing.mv_tipo_movi = ItemCodBarIng.mv_tipo_movi = MovIngreso.cm_tipo; egr.mv_tipo_movi = ItemCodBarEgr.mv_tipo_movi = MovEgreso.cm_tipo; in_Producto_Info prod = new in_Producto_Info(); prod = busProducto.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); ItemCodBarEgr.dm_observacion = egr.dm_observacion = item.dm_observacion + " Eg Prod " + prod.pr_descripcion; ItemCodBarIng.dm_observacion = ing.dm_observacion = item.dm_observacion + " Ing Prod " + prod.pr_descripcion; if (item.valida == true) { ItemCodBarEgr.dm_observacion = egr.dm_observacion = "Aut x: " + item.oc_observacion + "-" + egr.dm_observacion; ItemCodBarIng.dm_observacion = ing.dm_observacion = "Aut x: " + item.oc_observacion + "-" + ing.dm_observacion; } MovEgreso.cm_observacion = MovEgreso.cm_observacion + egr.dm_observacion; MovIngreso.cm_observacion = MovIngreso.cm_observacion + ing.dm_observacion; ItemCodBarEgr.dm_observacion = egr.dm_observacion = "Eg Suc " + ctrl_Sucbod.cmb_sucursal.Text.Trim() + " Bod " + ctrl_Sucbod.cmb_bodega.Text.Trim() + " Egr x Cons Prod -" + MovEgreso.cm_observacion + " " + txtObservacion.Text + egr.dm_observacion; ItemCodBarIng.dm_observacion = ing.dm_observacion = "Ing Suc " + bod.NomSucursal.Trim() + " Bod " + bod.bo_Descripcion.Trim() + " Ing x Cons Prod -" + MovIngreso.cm_observacion + " " + txtObservacion.Text + ing.dm_observacion; egr.dm_precio = item.dm_precio; egr.mv_costo = item.dm_precio; ing.dm_precio = item.dm_precio; ing.mv_costo = item.dm_precio; ItemCodBarEgr.et_IdProcesoProductivo = (Int32)CmbProcesoProductivo.EditValue; ItemCodBarIng.et_IdProcesoProductivo = (Int32)CmbProcesoProductivo.EditValue; LstDetMovEgreso.Add(egr); LstDetMovIngreso.Add(ing); LstDetxItemsEgr.Add(ItemCodBarEgr); LstDetxItemsIng.Add(ItemCodBarIng); } MovEgreso.cm_observacion = txtObservacion.Text + "Eg Suc " + ctrl_Sucbod.cmb_sucursal.Text.Trim() + " Bod " + ctrl_Sucbod.cmb_bodega.Text.Trim() + " Egr x Cons Prod -" + MovEgreso.cm_observacion; MovIngreso.cm_observacion = txtObservacion.Text + "Ing Suc " + bod.NomSucursal.Trim() + " Bod " + bod.bo_Descripcion.Trim() + " Ing x Cons Prod -" + MovIngreso.cm_observacion; MovEgreso.listmovi_inve_detalle_Info = LstDetMovEgreso; MovIngreso.listmovi_inve_detalle_Info = LstDetMovIngreso; return(true); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); return(false); } }
void cargacodbarra(in_movi_inve_detalle_x_Producto_CusCider_Info info) { }
void GenerarMovimientoInvenario() { try { decimal IdMoviInvenIngres = 0; string mensaje_cbte_cble = ""; in_producto_x_tb_bodega_Bus prod_B = new in_producto_x_tb_bodega_Bus(); in_movi_inve_detalle_x_Producto_CusCider_Bus CusCidersus_B = new in_movi_inve_detalle_x_Producto_CusCider_Bus(); in_movi_inve_Bus in_Movi_B = new in_movi_inve_Bus(); in_movi_inve_detalle_x_Producto_CusCider_Bus BusCusCidersu = new in_movi_inve_detalle_x_Producto_CusCider_Bus(); var OrdenTaller = ((List <prd_OrdenTaller_Info>)(cmbOrdenTaller.Properties.DataSource)).First(v => v.IdOrdenTaller == Convert.ToDecimal(cmbOrdenTaller.EditValue)); var Parametros = BusParmetros.ObtenerObjeto(param.IdEmpresa); prd_ControlProduccion_Obrero_x_in_movi_inve_Info MoviXcConv; in_movi_inve_Info MoviInfo = new in_movi_inve_Info(); MoviInfo.IdEmpresa = param.IdEmpresa; MoviInfo.cm_fecha = Convert.ToDateTime(dtpFecha.Value); MoviInfo.cm_observacion = txtObservacion.Text + " Eg x Prd x Ob" + cmbObra.Text + " Ot " + cmbOrdenTaller.Text + " Gt " + cmbGrupoAsignado.Text + " Et I " + txtEtapaAnterior.Text + " Et F " + txtEtapa.Text ; MoviInfo.cm_tipo = "-"; MoviInfo.IdBodega = Convert.ToInt32(ctrl_Sucbod.cmb_bodega.EditValue); MoviInfo.IdSucursal = Convert.ToInt32(ctrl_Sucbod.cmb_sucursal.EditValue); MoviInfo.IdMovi_inven_tipo = Convert.ToInt32(Parametros.IdMovi_inven_tipo_egr_ContrlProduccion); in_producto_Bus busprod = new in_producto_Bus(); List <in_movi_inve_detalle_Info> Listdetalle = new List <in_movi_inve_detalle_Info>(); foreach (var item in _ListDetalle) { in_movi_inve_detalle_Info Obj = new in_movi_inve_detalle_Info(); var Producto = prod_B.Get_Info_Producto_x_Producto(param.IdEmpresa, MoviInfo.IdSucursal, MoviInfo.IdBodega, item.IdProducto); Obj.IdProducto = item.IdProducto; Obj.IdSucursal = MoviInfo.IdSucursal; Obj.IdBodega = MoviInfo.IdBodega; Obj.IdEmpresa = param.IdEmpresa; Obj.IdMovi_inven_tipo = MoviInfo.IdMovi_inven_tipo; Obj.IdProducto = item.IdProducto; Obj.mv_costo = ProductosXEtapa.First(v => v.IdProducto == item.IdProducto).mv_costo; Obj.dm_precio = ProductosXEtapa.First(v => v.IdProducto == item.IdProducto).dm_precio; Obj.mv_tipo_movi = "-"; Obj.dm_stock_actu = Producto.pr_stock - 1; Obj.dm_stock_ante = Producto.pr_stock; var prod = busprod.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); Obj.dm_observacion = " Prod " + prod.pr_descripcion; Obj.dm_observacion = MoviInfo.cm_observacion + Obj.dm_observacion; Obj.dm_cantidad = -1; MoviInfo.listmovi_inve_detalle_Info.Add(Obj); } decimal IdMoviInven = 0; string Msj = ""; int c = 1; //MoviInfo.listmovi_inve_detalle_Info.ForEach(var => var.dm_cantidad = var.dm_cantidad * -1); if (in_Movi_B.GrabarDB(MoviInfo, ref IdMoviInven, ref mensaje_cbte_cble, ref Msj) == false) { MessageBox.Show(Msj, "Movimiento Egreso"); } else { MoviXcConv = new prd_ControlProduccion_Obrero_x_in_movi_inve_Info(); MoviXcConv.mv_IdBodega = MoviInfo.IdBodega; MoviXcConv.mv_IdEmpresa = MoviInfo.IdEmpresa; MoviXcConv.mv_IdMovi_inven_tipo = MoviInfo.IdMovi_inven_tipo; MoviXcConv.mv_IdNumMovi = IdMoviInven; MoviXcConv.mv_IdSucursal = MoviInfo.IdSucursal; listMovi.Add(MoviXcConv); MoviInfo.cm_tipo = "+"; MoviInfo.IdNumMovi = 0; MoviInfo.IdMovi_inven_tipo = Convert.ToInt32(Parametros.IdMovi_inven_tipo_ing_ContrlProduccion); MoviInfo.cm_observacion = txtObservacion.Text + " Ing x Prd x Ob" + cmbObra.Text + " Ot " + cmbOrdenTaller.Text + " Gt " + cmbGrupoAsignado.Text + " Et I " + txtEtapaAnterior.Text + " Et F " + txtEtapa.Text ; foreach (var v in MoviInfo.listmovi_inve_detalle_Info) { v.mv_tipo_movi = "+"; v.IdMovi_inven_tipo = MoviInfo.IdMovi_inven_tipo; v.dm_cantidad = 1; v.dm_stock_actu = v.dm_stock_actu + 1; v.dm_stock_ante = v.dm_stock_actu; var prod = busprod.Get_Info_BuscarProducto(v.IdProducto, param.IdEmpresa); v.dm_observacion = " Prod " + prod.pr_descripcion; v.dm_observacion = MoviInfo.cm_observacion + v.dm_observacion; } if (in_Movi_B.GrabarDB(MoviInfo, ref IdMoviInvenIngres, ref mensaje_cbte_cble, ref Msj) == false) { MessageBox.Show(Msj, "Movimiento Ingreso"); } MoviXcConv = new prd_ControlProduccion_Obrero_x_in_movi_inve_Info(); MoviXcConv.mv_IdBodega = MoviInfo.IdBodega; MoviXcConv.mv_IdEmpresa = MoviInfo.IdEmpresa; MoviXcConv.mv_IdMovi_inven_tipo = MoviInfo.IdMovi_inven_tipo; MoviXcConv.mv_IdNumMovi = IdMoviInvenIngres; MoviXcConv.mv_IdSucursal = MoviInfo.IdSucursal; listMovi.Add(MoviXcConv); } List <in_movi_inve_detalle_x_Producto_CusCider_Info> ListCidersusInfo = new List <in_movi_inve_detalle_x_Producto_CusCider_Info>(); foreach (var item in _ListDetalle) { in_movi_inve_detalle_x_Producto_CusCider_Info CusCidersusInfo = new in_movi_inve_detalle_x_Producto_CusCider_Info(); CusCidersusInfo.IdEmpresa = param.IdEmpresa; CusCidersusInfo.CodigoBarra = item.CodBarraMaestro; CusCidersusInfo.dm_cantidad = -1; var prod = busprod.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa); CusCidersusInfo.dm_observacion = txtObservacion.Text + " Eg x Prd x Ob" + cmbObra.Text + " Ot " + cmbOrdenTaller.Text + " Gt " + cmbGrupoAsignado.Text + " Et I " + txtEtapaAnterior.Text + " Et F " + txtEtapa.Text + " Prod " + prod.pr_descripcion ; CusCidersusInfo.dm_precio = ProductosXEtapa.First(v => v.IdProducto == item.IdProducto).dm_precio; CusCidersusInfo.et_IdEmpresa = param.IdEmpresa; CusCidersusInfo.et_IdEtapa = EtapaAnterior.IdEtapa; CusCidersusInfo.et_IdProcesoProductivo = EtapaAnterior.IdProcesoProductivo; CusCidersusInfo.IdBodega = MoviInfo.IdBodega; CusCidersusInfo.IdSucursal = MoviInfo.IdSucursal; CusCidersusInfo.IdMovi_inven_tipo = Convert.ToInt32(Parametros.IdMovi_inven_tipo_egr_ContrlProduccion); CusCidersusInfo.IdNumMovi = IdMoviInven; CusCidersusInfo.IdProducto = item.IdProducto; CusCidersusInfo.mv_costo = ProductosXEtapa.First(v => v.IdProducto == item.IdProducto).mv_costo; CusCidersusInfo.ot_CodObra = OrdenTaller.CodObra; CusCidersusInfo.ot_IdEmpresa = OrdenTaller.IdEmpresa; CusCidersusInfo.ot_IdOrdenTaller = OrdenTaller.IdOrdenTaller; CusCidersusInfo.ot_IdSucursal = OrdenTaller.IdSucursal; CusCidersusInfo.mv_Secuencia = c; CusCidersusInfo.mv_tipo_movi = "-"; c++; ListCidersusInfo.Add(CusCidersusInfo); } if (BusCusCidersu.GuardarDB(ListCidersusInfo, ref Msj) == false) { MessageBox.Show(Msj, "Cus Cidersus Egreso"); } else { foreach (var v in ListCidersusInfo) { v.dm_cantidad = 1; v.et_IdEtapa = Etapa.IdEtapa; v.et_IdProcesoProductivo = Etapa.IdProcesoProductivo; v.IdMovi_inven_tipo = Convert.ToInt32(Parametros.IdMovi_inven_tipo_ing_ContrlProduccion); v.IdNumMovi = IdMoviInvenIngres; v.mv_tipo_movi = "+"; var prod = busprod.Get_Info_BuscarProducto(v.IdProducto, param.IdEmpresa); v.dm_observacion = txtObservacion.Text + " Ing x Prd x Ob" + cmbObra.Text + " Ot " + cmbOrdenTaller.Text + " Gt " + cmbGrupoAsignado.Text + " Et I " + txtEtapaAnterior.Text + " Et F " + txtEtapa.Text + " Prod " + prod.pr_descripcion ; } if (BusCusCidersu.GuardarDB(ListCidersusInfo, ref Msj) == false) { MessageBox.Show(Msj, "Cus Cidersus Ingreso"); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString()); } }