Esempio n. 1
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);
     }
 }
Esempio n. 2
0
        public static void UpdateWithValidation(tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
        public static void Update(tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoDataTable)row.Table).Addtpu_ComprobantesPagoRow(row);
            }

            Update(row.Table);
        }
Esempio n. 4
0
 /// <summary>
 /// Obtiene un registro de la tabla tpu_ComprobantesPago que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow GetByPk(string IdComprobantePago)
 {
     tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row = mz.erp.dataaccess.tpu_ComprobantesPago.GetByPk(IdComprobantePago);
     if (row != null)
     {
         foreach (DataColumn dc in row.Table.Columns)
         {
             if (row[dc] == System.DBNull.Value)
             {
                 row[dc] = Util.DefaultValue(dc.DataType);
             }
         }
     }
     return(row);
 }
Esempio n. 5
0
        /// <summary>
        /// Establece los valores por defecto de tpu_ComprobantesPagoRow.
        /// </summary>
        public static tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow SetRowDefaultValues(tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row)
        {
            row.IdComprobantePago  = Util.NewStringId();
            row.IdResponsable      = string.Empty;
            row.IdAutorizacion     = string.Empty;
            row.FechaCreacion      = mz.erp.businessrules.Sistema.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.IdInstanciaCaja = string.Empty;

            return(row);
        }
Esempio n. 6
0
        /// <summary>
        /// Valida un tpu_ComprobantesPagoRow.
        /// </summary>
        public static bool RowIsValid(tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


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

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

            if (!IdAutorizacionIsValid(row.IdAutorizacion, out mensaje))
            {
                row.SetColumnError("IdAutorizacion", 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;
            }
            ;

            return(isValid);
        }
Esempio n. 7
0
        /// <summary>
        /// Envia los cambios del tpu_ComprobantesPagoRow a la base de datos.
        /// </summary>
        public static void Update(tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.tpu_ComprobantesPago.Update(row);
        }