Exemplo n.º 1
0
        public prod_Parametros_x_MoviInven_x_ModeloProduccion_Info ObtenerObjeto(int IdEmpresa, int IdModeloProd)
        {
            EntitiesProduccion oEnti = new EntitiesProduccion();
            prod_Parametros_x_MoviInven_x_ModeloProduccion_Info Info = new prod_Parametros_x_MoviInven_x_ModeloProduccion_Info();

            try
            {
                var Objeto = oEnti.prod_Parametros_x_MoviInven_x_ModeloProduccion.First(var => var.IdEmpresa == IdEmpresa && var.IdModeloProd == IdModeloProd);
                Info.IdEmpresa    = Objeto.IdEmpresa;
                Info.IdModeloProd = Objeto.IdModeloProd;
                Info.Secuencia    = Objeto.Secuencia;
                Info.IdSucursal_IngxProducTermi = Objeto.IdSucursal_IngxProducTermi;
                Info.IdBodega_IngxProducTermi   = Objeto.IdBodega_IngxProducTermi;
                Info.IdMovi_inven_tipo_x_IngxProduc_ProdTermi = Objeto.IdMovi_inven_tipo_x_IngxProduc_ProdTermi;
                Info.IdSucursal_EgrxMateriaPrima           = Objeto.IdSucursal_EgrxMateriaPrima;
                Info.IdBodega_EgrxMateriaPrima             = Objeto.IdBodega_EgrxMateriaPrima;
                Info.IdMovi_inven_tipo_x_EgrxProduc_MatPri = Objeto.IdMovi_inven_tipo_x_EgrxProduc_MatPri;
                Info.IdProducto_ParaIngreso = Objeto.IdProducto_ParaIngreso;
                Info.IdProducto_ParaEgreso  = Objeto.IdProducto_ParaEgreso;
                return(Info);
            }
            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());
            }
        }
Exemplo n.º 2
0
        public List <prod_Parametros_x_MoviInven_x_ModeloProduccion_Info> ConsultaGeneral(int IdEmpresa)
        {
            List <prod_Parametros_x_MoviInven_x_ModeloProduccion_Info> Lst = new List <prod_Parametros_x_MoviInven_x_ModeloProduccion_Info>();
            EntitiesProduccion oEnti = new EntitiesProduccion();

            try
            {
                var Query = from q in oEnti.prod_Parametros_x_MoviInven_x_ModeloProduccion
                            where q.IdEmpresa == IdEmpresa
                            select q;
                foreach (var item in Query)
                {
                    prod_Parametros_x_MoviInven_x_ModeloProduccion_Info Obj = new prod_Parametros_x_MoviInven_x_ModeloProduccion_Info();
                    Obj.IdEmpresa    = item.IdEmpresa;
                    Obj.IdModeloProd = item.IdModeloProd;
                    Obj.Secuencia    = item.Secuencia;
                    Obj.IdSucursal_IngxProducTermi = item.IdSucursal_IngxProducTermi;
                    Obj.IdBodega_IngxProducTermi   = item.IdBodega_IngxProducTermi;
                    Obj.IdMovi_inven_tipo_x_IngxProduc_ProdTermi = item.IdMovi_inven_tipo_x_IngxProduc_ProdTermi;
                    Obj.IdSucursal_EgrxMateriaPrima           = item.IdSucursal_EgrxMateriaPrima;
                    Obj.IdBodega_EgrxMateriaPrima             = item.IdBodega_EgrxMateriaPrima;
                    Obj.IdMovi_inven_tipo_x_EgrxProduc_MatPri = item.IdMovi_inven_tipo_x_EgrxProduc_MatPri;
                    Obj.IdProducto_ParaIngreso = item.IdProducto_ParaIngreso;
                    Obj.IdProducto_ParaEgreso  = item.IdProducto_ParaEgreso;
                    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());
            }
        }
Exemplo n.º 3
0
        void GenerarMOvimientoInventario(decimal IdLiquidacion)
        {
            try
            {
                string mensaje_cbte_cble = "";

                prod_Parametros_x_MoviInven_x_ModeloProduccion_Bus parametrosBus = new prod_Parametros_x_MoviInven_x_ModeloProduccion_Bus();
                in_producto_x_tb_bodega_Bus _Prod_B      = new in_producto_x_tb_bodega_Bus();
                in_movi_inve_Bus            _MoviInven_B = new in_movi_inve_Bus();
                prod_Parametros_x_MoviInven_x_ModeloProduccion_Info _parametrosProduccion_I = parametrosBus.ObtenerObjeto(param.IdEmpresa, 4);
                var _Produ_I = _Prod_B.Get_Info_Producto_x_Producto(param.IdEmpresa, Convert.ToInt32(_parametrosProduccion_I.IdSucursal_IngxProducTermi), Convert.ToInt32(_parametrosProduccion_I.IdBodega_IngxProducTermi), Convert.ToDecimal(_parametrosProduccion_I.IdProducto_ParaIngreso));
                in_movi_inve_Info _InMovi_I = new in_movi_inve_Info();
                _InMovi_I.IdBodega          = Convert.ToInt32(_parametrosProduccion_I.IdBodega_IngxProducTermi);
                _InMovi_I.IdEmpresa         = param.IdEmpresa;
                _InMovi_I.IdSucursal        = Convert.ToInt32(_parametrosProduccion_I.IdSucursal_IngxProducTermi);
                _InMovi_I.IdMovi_inven_tipo = Convert.ToInt32(_parametrosProduccion_I.IdMovi_inven_tipo_x_IngxProduc_ProdTermi);
                _InMovi_I.cm_observacion    = "Movimiento inventario por Compra de chatarra # " + IdLiquidacion;
                _InMovi_I.cm_tipo           = "+";
                _InMovi_I.cm_fecha          = Convert.ToDateTime(((DateTime)(dtpFecha.EditValue)).ToShortDateString());
                in_movi_inve_detalle_Info _MoviDetalle_i = new in_movi_inve_detalle_Info();
                _MoviDetalle_i.IdEmpresa         = param.IdEmpresa;
                _MoviDetalle_i.IdBodega          = _InMovi_I.IdBodega;
                _MoviDetalle_i.IdSucursal        = _InMovi_I.IdSucursal;
                _MoviDetalle_i.dm_observacion    = _InMovi_I.cm_observacion;
                _MoviDetalle_i.mv_tipo_movi      = _InMovi_I.cm_tipo;
                _MoviDetalle_i.IdMovi_inven_tipo = _InMovi_I.IdMovi_inven_tipo;
                _MoviDetalle_i.IdProducto        = Convert.ToDecimal(_parametrosProduccion_I.IdProducto_ParaIngreso);
                _MoviDetalle_i.dm_cantidad       = Convert.ToDouble(txtNeto.EditValue);
                _MoviDetalle_i.dm_stock_actu     = _Produ_I.pr_stock + _MoviDetalle_i.dm_cantidad;
                _MoviDetalle_i.dm_stock_ante     = _Produ_I.pr_stock;
                _MoviDetalle_i.dm_precio         = _Produ_I.pr_precio_publico;
                _MoviDetalle_i.mv_costo          = _Produ_I.pr_costo_promedio;
                _InMovi_I.listmovi_inve_detalle_Info.Add(_MoviDetalle_i);

                decimal IdMovimiento = 0;
                string  Mensaje      = "";
                if (_MoviInven_B.GrabarDB(_InMovi_I, ref IdMovimiento, ref mensaje_cbte_cble, ref Mensaje) == false)
                {
                    MessageBox.Show(Mensaje, "Error Al Guardar Movimiento Inventario");
                }

                prod_CompraChatarra_CusTalme_x__in_movi_inven_Bus  Comp_X_Movi_B = new prod_CompraChatarra_CusTalme_x__in_movi_inven_Bus();
                prod_CompraChatarra_CusTalme_x__in_movi_inven_Info Comp_X_Movi_I = new prod_CompraChatarra_CusTalme_x__in_movi_inven_Info();
                Comp_X_Movi_I.IdEmpresa            = param.IdEmpresa;
                Comp_X_Movi_I.IdLiquidacion        = IdLiquidacion;
                Comp_X_Movi_I.mv_IdBodega          = _InMovi_I.IdBodega;
                Comp_X_Movi_I.mv_IdEmpresa         = _InMovi_I.IdEmpresa;
                Comp_X_Movi_I.mv_IdMovi_inven_tipo = _InMovi_I.IdMovi_inven_tipo;
                Comp_X_Movi_I.mv_IdNumMovi         = IdMovimiento;
                Comp_X_Movi_I.mv_IdSucursal        = _InMovi_I.IdSucursal;

                if (Comp_X_Movi_B.GuardarDB(Comp_X_Movi_I) == false)
                {
                    MessageBox.Show("Error al Guardar Movimiento Inventario X Compra ", "Tabla Intermedia0");
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }