private Boolean getCab()
        {
            try
            {
                Ensamblado.IdEmpresa      = param.IdEmpresa;
                Ensamblado.IdSucursal     = _sucursalInfo.IdSucursal;
                Ensamblado.IdEnsamblado   = 0;
                Ensamblado.IdBodega       = _bodegaInfo.IdBodega;
                Ensamblado.IdGrupoTrabajo = Convert.ToDecimal(gridLkUGrupoTrabajo.EditValue);
                Ensamblado.IdProducto     = OT.IdProducto;
                Ensamblado.CodObra        = UCObra.get_item();
                Ensamblado.IdOrdenTaller  = Convert.ToDecimal(gridLkUOrdenTaller.EditValue);
                Ensamblado.IdUsuario      = param.IdUsuario;
                Ensamblado.FechaTransac   = DateTime.Now;
                Ensamblado.Estado         = "A";
                var prod = busprod.Get_Info_BuscarProducto(Ensamblado.IdProducto, param.IdEmpresa);

                Ensamblado.Observacion = txtObservacion.Text +
                                         " Ens Prod " + prod.pr_descripcion +
                                         " x Ob " + UCObra.get_item() +
                                         " Ot " + gridLkUOrdenTaller.Text +
                                         " Gt " + gridLkUGrupoTrabajo.Text
                ;
                return(getDet());
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Ha ocurrido un error:" + ex.ToString());
                return(false);
            }
        }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
        private Boolean getDet()
        {
            int Sec = 0;

            try
            {
                DetalleEnsam = new List <prd_Ensamblado_Det_CusCider_Info>();
                string observacioncab = "";
                foreach (var item in ListaGrabar)
                {
                    prd_Ensamblado_Det_CusCider_Info info = new prd_Ensamblado_Det_CusCider_Info();
                    info.IdProducto = item.IdProducto;
                    var prod = busprod.Get_Info_BuscarProducto(info.IdProducto, param.IdEmpresa);
                    info.CodigoBarra = item.pr_codigo_barra;
                    info.Observacion = item.pr_observacion + " " +
                                       Ensamblado.Observacion +
                                       " con Prod " + prod.pr_descripcion +
                                       " CB " + item.pr_codigo_barra;
                    info.en_cantidad = 1;
                    observacioncab   = observacioncab +
                                       " con Prod " + prod.pr_descripcion +
                                       " CB " + item.pr_codigo_barra;
                    DetalleEnsam.Add(info);
                }

                Ensamblado.Observacion = Ensamblado.Observacion + observacioncab;

                return(true);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Ha ocurrido un error:" + ex.InnerException.ToString());
                return(false);
            }
        }
Esempio n. 4
0
        private void gridViewTransMoviInven_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                string mesn = "";

                vwin_movi_inve_x_cbteCble_Datos_Info infofila = new vwin_movi_inve_x_cbteCble_Datos_Info();
                infofila = (vwin_movi_inve_x_cbteCble_Datos_Info)gridViewTransMoviInven.GetFocusedRow();


                if (e.Column == col_modificar_contabilidad)
                {
                    if (infofila.IdCbteCble > 0)
                    {
                        frmCon_CbteCble_Mant frm      = new frmCon_CbteCble_Mant();
                        ct_Cbtecble_Info     InfoCbte = new ct_Cbtecble_Info();
                        ct_Cbtecble_Bus      BusCbte  = new ct_Cbtecble_Bus();
                        InfoCbte = BusCbte.Get_Info_CbteCble(Convert.ToInt32(infofila.IdEmpresa), Convert.ToInt32(infofila.IdTipoCbte), Convert.ToDecimal(infofila.IdCbteCble), ref mesn);
                        frm.event_frmCon_CbteCble_Mant_FormClosing += frm_event_frmCon_CbteCble_Mant_FormClosing;
                        frm.set_Info(InfoCbte);
                        frm.setAccion(Cl_Enumeradores.eTipo_action.actualizar);
                        frm.ShowDialog();
                    }
                }
                if (e.Column == col_modificar_producto)
                {
                    if (infofila.IdProducto > 0)
                    {
                        FrmIn_Producto_Mant frm           = new FrmIn_Producto_Mant();
                        in_Producto_Info    info_producto = new in_Producto_Info();
                        in_producto_Bus     bus_producto  = new in_producto_Bus();
                        info_producto = bus_producto.Get_Info_BuscarProducto(infofila.IdProducto, param.IdEmpresa);
                        frm.event_FrmIn_Producto_Mant_FormClosing += frm_event_FrmIn_Producto_Mant_FormClosing;
                        frm.set_Info_producto(info_producto);
                        frm.set_Accion(Cl_Enumeradores.eTipo_action.actualizar);
                        frm.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show("Error comunicarse con Sistemas " + ex.Message + " ", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //private void cmbMotivo_ValueChanged_1(object sender, EventArgs e) { }

        private void gridvwDetListMateriales_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
        {
            try
            {
                com_ListadoMateriales_Det_Info Info = new com_ListadoMateriales_Det_Info();
                int i = 0;
                //idprod
                //i = gridvwDetListMateriales.FocusedRowHandle;
                Info = (com_ListadoMateriales_Det_Info)gridvwDetListMateriales.GetFocusedRow();
                in_Producto_Info prod = new in_Producto_Info();
                if (Info != null)
                {
                    prod = BusProd.Get_Info_BuscarProducto(Info.IdProducto, param.IdEmpresa);
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 6
0
 private void CambioproductoAproductoXBodega(in_Producto_Info item, ref in_producto_x_tb_bodega_Info address)
 {
     try
     {
         in_producto_Bus  InProdxbod_bus = new in_producto_Bus();
         in_Producto_Info Oinfo          = new in_Producto_Info();
         Oinfo = InProdxbod_bus.Get_Info_BuscarProducto(item.IdProducto, param.IdEmpresa);
         address.IdSucursal        = Convert.ToInt32(cmbSucursal.EditValue);
         address.IdBodega          = Convert.ToInt32(cmbBodega.EditValue);
         address.IdEmpresa         = param.IdEmpresa;
         address.IdProducto        = item.IdProducto;
         address.pr_precio_publico = item.pr_precio_publico;
         address.pr_precio_mayor   = item.pr_precio_mayor;
         address.pr_precio_puerta  = 0;
         address.pr_precio_minimo  = item.pr_precio_minimo;
         address.pr_Por_descuento  = 0;
         //address.pr_stock = item.pr_stock;
         address.pr_stock_maximo      = 0;
         address.pr_stock_minimo      = 0;
         address.pr_costo_fob         = item.pr_costo_fob;
         address.pr_costo_CIF         = item.pr_costo_CIF;
         address.pr_costo_promedio    = item.pr_costo_promedio;
         address.Estado               = "A";
         address.IdCtaCble_CosBaseIva = Oinfo.IdCtaCble_CosBaseIva;
         address.IdCtaCble_CosBase0   = Oinfo.IdCtaCble_CosBase0;
         address.IdCtaCble_VenIva     = Oinfo.IdCtaCble_VenIva;
         address.IdCtaCble_Ven0       = Oinfo.IdCtaCble_Ven0;
         address.IdCtaCble_DesIva     = Oinfo.IdCtaCble_DesIva;
         address.IdCtaCble_Des0       = Oinfo.IdCtaCble_Des0;
         address.IdCtaCble_DevIva     = Oinfo.IdCtaCble_DevIva;
         address.IdCtaCble_Dev0       = Oinfo.IdCtaCble_Dev0;
         address.IdCtaCble_Inven      = Oinfo.IdCtaCble_Inventario;
         address.IdCtaCble_Costo      = Oinfo.IdCtaCble_Costo;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 8
0
        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());
            }
        }
        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 Get()
        {
            try
            {
                _Info = new prod_GestionProductivaAcero_CusTalme_Info();

                _Info.IdEmpresa  = param.IdEmpresa;
                _Info.IdSucursal = Convert.ToInt32(cmbSucursal.EditValue);
                _Info.Fecha      = Convert.ToDateTime(Convert.ToDateTime(dtpFecha.EditValue).ToShortDateString());


                _Info.IdHorno  = Convert.ToInt16(cmbHorno.EditValue);
                _Info.IdColada = Convert.ToDecimal(txtColada.EditValue);

                _Info.chat_En_Horno = Convert.ToDouble(txtChatarraHorno.EditValue);
                _Info.chat_Cargada  = Convert.ToDouble(txtchatarraCargada.EditValue);

                _Info.Vaci_TempC = Convert.ToDouble(txtVaciado.EditValue);
                _Info.Vaci_acero = Convert.ToDouble(txtVaciadoAcero.EditValue);

                _Info.EnHor_Acero   = Convert.ToDouble(TxtHornoAcero.EditValue);
                _Info.EnHor_Perdida = Convert.ToDouble(txtHornoPerdida.EditValue);

                _Info.Comps_C   = Convert.ToDouble(txtComposicionC.EditValue);
                _Info.Comps_Si  = Convert.ToDouble(txtComposicionSi.EditValue);
                _Info.Comps_Mn  = Convert.ToDouble(txtComposicionMn.EditValue);
                _Info.Comps_P   = Convert.ToDouble(txtComposicionP.EditValue);
                _Info.Comps_S   = Convert.ToDouble(txtComposicionS.EditValue);
                _Info.Comps_SAE = Convert.ToDouble(txtComposicionSAE.EditValue);

                _Info.AdiMet_Carburante    = Convert.ToDouble(txtAdicionalesCarburante.EditValue);
                _Info.AdiMet_Cal           = Convert.ToDouble(txtAdicionalesCal.EditValue);
                _Info.AdiMet_Desercoriante = Convert.ToDouble(txtAdicionalesDeserCoriante.EditValue);


                string[] tiempoEncendido = txtTiempoEncendido.Text.Split(':');
                string[] tiempoApagado   = txtTiempoApagado.Text.Split(':');
                string[] tiempoFundicion = txtTiempoFundicion.Text.Split(':');
                string[] tiempoVaciado   = txtTiempoVaciado.Text.Split(':');
                string[] tiempototal     = txtTiempoTotal.Text.Split(':');
                _Info.Tiem_Encendido = new TimeSpan(Convert.ToInt32(tiempoEncendido[0]), Convert.ToInt32(tiempoEncendido[1]), 0);
                _Info.Tiem_Apagado   = new TimeSpan(Convert.ToInt32(tiempoApagado[0]), Convert.ToInt32(tiempoApagado[1]), 0);
                _Info.Tiem_Fundicion = new TimeSpan(Convert.ToInt32(tiempoFundicion[0]), Convert.ToInt32(tiempoFundicion[1]), 0);
                _Info.Tiem_Vaciado   = new TimeSpan(Convert.ToInt32(tiempoVaciado[0]), Convert.ToInt32(tiempoVaciado[1]), 0);
                _Info.Tiem_Total     = new TimeSpan(Convert.ToInt32(tiempototal[0]), Convert.ToInt32(tiempototal[1]), 0);

                _Info.Ener_Ea    = Convert.ToDouble(txtEnergiaEa.EditValue);
                _Info.Ener_Er    = Convert.ToDouble(txtEnergiaEr.EditValue);
                _Info.Ener_Total = Convert.ToDouble(txtEnergiaTotal.EditValue);

                _Info.Ferroa_FeSi = Convert.ToDouble(txtFerroaleacionesFesi.EditValue);
                _Info.Ferroa_FeMn = Convert.ToDouble(txtFerroaleacionesFeMn.EditValue);

                _Info.IndiHor_Productividad = Convert.ToDouble(txtIndicadoresProductividad.EditValue);
                _Info.IndiHor_Rendimiento   = Convert.ToDouble(txtIndicadoresRendimiento.EditValue);

                _Info.Observacion = txtObservacion.Text;

                _Info.Tundish = Convert.ToDecimal(txtTundish.EditValue);

                string[] InicioCC = txtIncioCC.Text.Split(':');
                string[] FinCC    = txtFinCC.Text.Split(':');
                string[] Tiempo   = txtTiempo.Text.Split(':');
                _Info.InicioCC = new TimeSpan(Convert.ToInt32(InicioCC[0]), Convert.ToInt32(InicioCC[1]), 0);
                _Info.FinCC    = new TimeSpan(Convert.ToInt32(FinCC[0]), Convert.ToInt32(FinCC[1]), 0);
                _Info.Tiempo   = new TimeSpan(Convert.ToInt32(Tiempo[0]), Convert.ToInt32(Tiempo[1]), 0);


                _Info.AceroCldo   = Convert.ToDouble(txtAceroCldo.EditValue);
                _Info.Palanquilla = Convert.ToDouble(txtPalanquilla.EditValue);
                _Info.Marrano     = Convert.ToDouble(txtMarrano.EditValue);
                _Info.Escoria     = Convert.ToDouble(txtEscoria.EditValue);
                _Info.PerdidaCC   = Convert.ToDouble(txtPerdidaCC.EditValue);
                _Info.RendtCC     = Convert.ToDouble(txtRendtCC.EditValue);
                _Info.ProductivCC = Convert.ToDouble(txtProductvCC.EditValue);
                _Info.IdProducto_TipoPalanquilla = Convert.ToDouble(cmbTipo.EditValue);
                _Info.Unidades     = Convert.ToDouble(txtUnidades.EditValue);
                _Info.Longitud     = Convert.ToDouble(txtLongitud.EditValue);
                _Info.PesoUnitario = Convert.ToDouble(txtPesoUnitario.EditValue);
                _Info.PesoMetro    = Convert.ToDouble(txtPesoMetro.EditValue);
                _Info.Perdida      = Convert.ToDouble(txtPerdida.EditValue);
                _Info.ProdRend     = Convert.ToDouble(txtProdRendt.EditValue);
                _Info.ProdProduct  = Convert.ToDouble(txtPrdoProducto.EditValue);

                _Info.IdGestionAceria = Convert.ToDecimal(txtIdGestion.EditValue);


                _Info.FeSiMn     = Convert.ToDouble(txtFESIMN.EditValue);
                _Info.Termopares = Convert.ToDouble(txtTermoPares.EditValue);



                prod_ParametrosPorCampos_Bus BusParamentroscampos = new prod_ParametrosPorCampos_Bus();
                in_movi_inve_Info            MovimientoCabecera   = new in_movi_inve_Info();
                in_producto_Bus BusProducto = new in_producto_Bus();
                List <in_movi_inve_detalle_Info> MovimientoDetalle = new List <in_movi_inve_detalle_Info>();
                MovimientoCabecera.IdEmpresa = param.IdEmpresa;

                foreach (var item in BusParamentroscampos.Consulta(param.IdEmpresa))
                {
                    foreach (Control control in panel.Controls)
                    {
                        if (control.HasChildren)
                        {
                            foreach (Control textbox in control.Controls)
                            {
                                if (item.NompreCampo == textbox.Name)
                                {
                                    in_movi_inve_detalle_Info obj = new in_movi_inve_detalle_Info();
                                    obj.IdEmpresa = param.IdEmpresa;
                                    in_Producto_Info Producto = BusProducto.Get_Info_BuscarProducto(Convert.ToDecimal(item.IdProducto), param.IdEmpresa);
                                    obj.IdProducto   = Convert.ToInt32(item.IdProducto);
                                    obj.IdSucursal   = Convert.ToInt32(cmbSucursal.EditValue);
                                    obj.dm_cantidad  = Convert.ToDouble(textbox.Text);
                                    obj.mv_costo     = Producto.pr_costo_promedio;
                                    obj.mv_tipo_movi = "-";
                                    //obj.dm_stock_ante = Producto.kr_stockActual;
                                    obj.dm_stock_actu = obj.dm_stock_ante - obj.dm_cantidad;
                                    obj.dm_precio     = obj.dm_precio;
                                    obj.peso          = obj.peso;

                                    MovimientoDetalle.Add(obj);
                                }
                            }
                        }
                    }
                }
                MovimientoCabecera.listmovi_inve_detalle_Info = MovimientoDetalle;

                foreach (Control item in this.Controls)
                {
                    if (item.Name == "")
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }