예제 #1
0
        /// <summary>
        /// Retorna una ENTIDAD de registro de la Entidad GestionComercial.DocumentoMovDetalle
        /// En la BASE de DATO la Tabla : [Importaciones.OIDUACosto]
        /// </summary>
        /// <param name="pFiltro"></param>
        /// <returns></returns>
        public DTOCostoDetalle FindDetalleGasto(int pcodDocumRegDetalle)
        {
            DTOCostoDetalle costoDetalle = null;

            try
            {
                oIDUACostoData = new OIDUACostoData();
                costoDetalle   = oOIDUAData.FindDetalleGasto(pcodDocumRegDetalle);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(costoDetalle);
        }
예제 #2
0
 public ReturnValor UpdateDetalleGasto(DTOCostoDetalle pCostoDetalle)
 {
     try
     {
         using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required))
         {
             oReturnValor.Exitosa = oOIDUAData.UpdateDetalleGasto(pCostoDetalle);
             if (oReturnValor.Exitosa)
             {
                 oReturnValor.Message = HelpMessages.Evento_EDIT;
                 tx.Complete();
             }
         }
     }
     catch (Exception ex)
     {
         oReturnValor = HelpException.mTraerMensaje(ex);
     }
     return(oReturnValor);
 }
예제 #3
0
        /// <summary>
        /// Permite actualizar el detalle del gasto que se detalla en la DUA
        /// </summary>
        /// <param name="pCostoDetalle"></param>
        /// <returns></returns>
        public bool UpdateDetalleGasto(DTOCostoDetalle pCostoDetalle)
        {
            int codigoRetorno = -1;

            try
            {
                using (_ImportacionesDataContext SQLDC = new _ImportacionesDataContext(conexion))
                {
                    SQLDC.omgc_U_DocumRegDetaGasto(pCostoDetalle.codDocumRegDetalle,
                                                   pCostoDetalle.codOIDUA,
                                                   pCostoDetalle.codRegResumenCosto,
                                                   pCostoDetalle.editUsuario);
                    codigoRetorno = codigoRetorno = 0;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(codigoRetorno == 0 ? true : false);
        }
예제 #4
0
        /// <summary>
        /// Retorna una ENTIDAD de registro de la Entidad GestionComercial.DocumentoMovDetalle
        /// En la BASE de DATO la Tabla : [Importaciones.OIDUACosto]
        /// </summary>
        /// <param name="pcodDocumRegDetalle"></param>
        /// <returns></returns>
        public DTOCostoDetalle FindDetalleGasto(int pcodDocumRegDetalle)
        {
            DTOCostoDetalle costoDetalle = null;

            try
            {
                using (_ImportacionesDataContext SQLDC = new _ImportacionesDataContext(conexion))
                {
                    var resul = SQLDC.omgc_S_DocumRegDetaGasto(pcodDocumRegDetalle);
                    foreach (var item in resul)
                    {
                        costoDetalle = new DTOCostoDetalle()
                        {
                            codOIDUA                = item.codOIDUA == null ? 0 : item.codOIDUA.Value,
                            codDocumRegDetalle      = item.codDocumRegDetalle,
                            numItem                 = item.CodigoItemDetalle,
                            codRegResumenCosto      = item.codRegResumenCosto,
                            codRegResumenCostoPadre = item.codRegResumenCostoPadre,
                            numOIDUA                = item.numOIDUA,
                            monCostoDolar           = item.monCostoDolar,
                            monDolar                = item.monDolar == null ? 0 : item.monDolar.Value,
                            monSoles                = item.monSoles == null ? 0 : item.monSoles.Value,
                            desProveedor            = item.nomProveedor,
                            numDocumento            = item.numDocumento,
                            editUsuario             = item.SegUsuarioEdita,
                            editFecha               = item.SegFechaEdita == null ? string.Empty : item.SegFechaEdita.Value.ToString()
                        };
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(costoDetalle);
        }
예제 #5
0
        private List <RowData> CrearFilaExcelDetalleCosto(int posicionColumna, uint posicionFila, DTOCostoDetalle costoDetalle)
        {
            ExcelUtil       documento   = new ExcelUtil();
            List <CellData> celdasExcel = new List <CellData>();
            List <RowData>  filasExcel  = new List <RowData>();
            CellData        celda;
            string          fondoEstiloDetalle = Convert.ToString(EstilosReporteDUA.FondoDefecto);

            celda = documento.CreateCell(string.Empty, posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);

            posicionColumna = posicionColumna + 1;
            celda           = documento.CreateCell(costoDetalle.codProductoNombre, posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);

            posicionColumna = posicionColumna + 1;

            celda = documento.CreateCell(costoDetalle.monTipoCambioVta.ToString("N3"), posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);
            posicionColumna = posicionColumna + 1;

            celda = documento.CreateCell(costoDetalle.monUnitPrecioVenta.ToString("N2"), posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);

            posicionColumna = posicionColumna + 1;
            celda           = documento.CreateCell("US $", posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);


            posicionColumna = posicionColumna + 1;
            celda           = documento.CreateCell(costoDetalle.monTotalDocumento.ToString("N2"), posicionColumna, posicionFila, fondoEstiloDetalle);
            celdasExcel.Add(celda);

            filasExcel.Add(documento.CreateRow(celdasExcel, posicionFila));
            return(filasExcel);
        }