コード例 #1
0
        public static void UpdateWithValidation(tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
コード例 #2
0
        public static void Update(tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresDataTable)row.Table).Addtpu_ComprobanteDetalleDeValoresRow(row);
            }

            Update(row.Table);
        }
コード例 #3
0
        /// <summary>
        /// Establece los valores por defecto de tpu_ComprobanteDetalleDeValoresRow.
        /// </summary>
        public static tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow SetRowDefaultValues(tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row)
        {
            row.IdComprobante       = Util.NewStringId();
            row.IdValor             = Util.NewStringId();
            row.IdTipoDeComprobante = string.Empty;
            row.Numero             = string.Empty;
            row.Monto              = 0;
            row.IdMoneda           = string.Empty;
            row.IdCotizaicon       = string.Empty;
            row.FechaCreacion      = DateTime.Now;
            row.IdConexionCreacion = Security.IdConexion;
            //row.UltimaModificacion = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.IdReservado       = 0;
            row.RowId             = Guid.Empty;
            row.IdSucursal        = Security.IdSucursal;
            row.IdEmpresa         = Security.IdEmpresa;
            row.MontoSinRecargos  = 0;
            row.IdFormaDePago     = string.Empty;
            row.IdResponsable     = Security.IdPersona;
            row.IdInstanciaCaja   = string.Empty;
            row.IdAutorizacion    = string.Empty;
            row.IdComprobantePago = string.Empty;


            return(row);
        }
コード例 #4
0
 /// <summary>
 /// Obtiene un registro de la tabla tpu_ComprobanteDetalleDeValores que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow GetByPk(string IdComprobante, string IdValor)
 {
     tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row = mz.erp.dataaccess.tpu_ComprobanteDetalleDeValores.GetByPk(IdComprobante, IdValor);
     foreach (DataColumn dc in row.Table.Columns)
     {
         if (row[dc] == System.DBNull.Value)
         {
             row[dc] = Util.DefaultValue(dc.DataType);
         }
     }
     return(row);
 }
コード例 #5
0
        /// <summary>
        /// Valida un tpu_ComprobanteDetalleDeValoresRow.
        /// </summary>
        public static bool RowIsValid(tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


            if (!IdTipoDeComprobanteIsValid(row.IdTipoDeComprobante, out mensaje))
            {
                row.SetColumnError("IdTipoDeComprobante", mensaje);
                isValid = false;
            }

            if (!NumeroIsValid(row.Numero, out mensaje))
            {
                row.SetColumnError("Numero", mensaje);
                isValid = false;
            }

            if (!IdComprobanteIsValid(row.IdComprobante, out mensaje))
            {
                row.SetColumnError("IdComprobante", mensaje);
                isValid = false;
            }

            if (!IdValorIsValid(row.IdValor, out mensaje))
            {
                row.SetColumnError("IdValor", mensaje);
                isValid = false;
            }

            if (!MontoIsValid(row.Monto, out mensaje))
            {
                row.SetColumnError("Monto", mensaje);
                isValid = false;
            }

            if (!IdMonedaIsValid(row.IdMoneda, out mensaje))
            {
                row.SetColumnError("IdMoneda", mensaje);
                isValid = false;
            }

            if (!IdCotizaiconIsValid(row.IdCotizaicon, out mensaje))
            {
                row.SetColumnError("IdCotizaicon", mensaje);
                isValid = false;
            }

            if (!FechaCreacionIsValid(row.FechaCreacion, out mensaje))
            {
                row.SetColumnError("FechaCreacion", mensaje);
                isValid = false;
            }

            if (!IdConexionCreacionIsValid(row.IdConexionCreacion, out mensaje))
            {
                row.SetColumnError("IdConexionCreacion", mensaje);
                isValid = false;
            }

            if (!UltimaModificacionIsValid(row.UltimaModificacion, out mensaje))
            {
                row.SetColumnError("UltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdConexionUltimaModificacionIsValid(row.IdConexionUltimaModificacion, out mensaje))
            {
                row.SetColumnError("IdConexionUltimaModificacion", mensaje);
                isValid = false;
            }

            if (!IdReservadoIsValid(row.IdReservado, out mensaje))
            {
                row.SetColumnError("IdReservado", mensaje);
                isValid = false;
            }

            if (!RowIdIsValid(row.RowId, out mensaje))
            {
                row.SetColumnError("RowId", mensaje);
                isValid = false;
            }

            if (!IdSucursalIsValid(row.IdSucursal, out mensaje))
            {
                row.SetColumnError("IdSucursal", mensaje);
                isValid = false;
            }

            if (!IdEmpresaIsValid(row.IdEmpresa, out mensaje))
            {
                row.SetColumnError("IdEmpresa", mensaje);
                isValid = false;
            }

            if (!MontoSinRecargosIsValid(row.MontoSinRecargos, out mensaje))
            {
                row.SetColumnError("MontoSinRecargos", mensaje);
                isValid = false;
            }

            if (!IdFormaDePagoIsValid(row.IdFormaDePago, out mensaje))
            {
                row.SetColumnError("IdFormaDePago", mensaje);
                isValid = false;
            }
            ;

            return(isValid);
        }
コード例 #6
0
        /// <summary>
        /// Envia los cambios del tpu_ComprobanteDetalleDeValoresRow a la base de datos.
        /// </summary>
        public static void Update(tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tpu_ComprobanteDetalleDeValores.Update(row);
        }
コード例 #7
0
 private void CommitCabecera()
 {
     tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow rowC = _dataCabecera.tpu_ComprobantesPago.Newtpu_ComprobantesPagoRow();
     mz.erp.businessrules.tpu_ComprobantesPago.SetRowDefaultValues(rowC);
     rowC.IdAutorizacion  = _idAutorizacion;
     rowC.IdResponsable   = this._idResponsable;
     rowC.IdInstanciaCaja = this._idInstanciaCaja;
     _dataCabecera.tpu_ComprobantesPago.Addtpu_ComprobantesPagoRow(rowC);
     foreach (ItemComprobanteDeCompraView item in this._comprobantes)
     {
         foreach (RealcionItemComprobanteDeCompraValor rel in item.RealcionesItemComprobanteDeCompraValor)
         {
             tpu_ComprobanteDetalleDeValoresDataset.tpu_ComprobanteDetalleDeValoresRow row = _dataComprobantesValores.tpu_ComprobanteDetalleDeValores.Newtpu_ComprobanteDetalleDeValoresRow();
             mz.erp.businessrules.tpu_ComprobanteDetalleDeValores.SetRowDefaultValues(row);
             row.IdComprobante       = item.IdComprobante;
             row.IdValor             = rel.MiValor.IdValor;
             row.IdTipoDeComprobante = item.IdTipoDeComprobante;
             row.Numero           = item.Numero;
             row.Monto            = rel.MontoAbonado;
             row.IdMoneda         = ComprobantesRules.Contabilidad_MonedaReferencia;
             row.IdCotizaicon     = ComprobantesRules.Contabilidad_CotizacionReferencia;
             row.MontoSinRecargos = rel.MontoAbonado;
             row.IdResponsable    = this._idResponsable;
             row.IdInstanciaCaja  = this._idInstanciaCaja;
             row.IdAutorizacion   = _idAutorizacion;
             _dataComprobantesValores.tpu_ComprobanteDetalleDeValores.Addtpu_ComprobanteDetalleDeValoresRow(row);
         }
         DataRow rowCompDD = mz.erp.businessrules.tpu_ComprobanteDetalleDeuda.GetByPk(item.IdComprobante, 1);
         rowCompDD["Saldo"] = item.Saldo * item.Signo;
         _dataComprobanteDetalleDeuda.tpu_ComprobanteDetalleDeuda.ImportRow(rowCompDD);
     }
 }