Exemple #1
0
        public static void UpdateWithValidation(tpu_RetencionesDetDataset.tpu_RetencionesDetRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);

            if (RowIsValid(row))
            {
                Update(row);
            }
        }
Exemple #2
0
        public static void Update(tpu_RetencionesDetDataset.tpu_RetencionesDetRow row)
        {
            if (row.RowState == DataRowState.Detached)
            {
                ((tpu_RetencionesDetDataset.tpu_RetencionesDetDataTable)row.Table).Addtpu_RetencionesDetRow(row);
            }

            Update(row.Table);
        }
Exemple #3
0
 /// <summary>
 /// Obtiene un registro de la tabla tpu_RetencionesDet que luego puede ser persistido en la base de datos.
 /// </summary>
 public static tpu_RetencionesDetDataset.tpu_RetencionesDetRow GetByPk(long IdRetencion, string IdComprobante, string IdConcepto)
 {
     tpu_RetencionesDetDataset.tpu_RetencionesDetRow row = mz.erp.dataaccess.tpu_RetencionesDet.GetByPk(IdRetencion, IdComprobante, IdConcepto);
     foreach (DataColumn dc in row.Table.Columns)
     {
         if (row[dc] == System.DBNull.Value)
         {
             row[dc] = Util.DefaultValue(dc.DataType);
         }
     }
     return(row);
 }
Exemple #4
0
        /// <summary>
        /// Establece los valores por defecto de tpu_RetencionesDetRow.
        /// </summary>
        public static tpu_RetencionesDetDataset.tpu_RetencionesDetRow SetRowDefaultValues(tpu_RetencionesDetDataset.tpu_RetencionesDetRow row)
        {
            row.IdRetencion                  = 0;
            row.IdComprobante                = Util.NewStringId();
            row.IdConcepto                   = Util.NewStringId();
            row.MontoNeto                    = 0;
            row.FechaCreacion                = DateTime.Now;
            row.IdConexionCreacion           = Security.IdConexion;
            row.UltimaModificacion           = null;
            row.IdConexionUltimaModificacion = Security.IdConexion;
            row.IdReservado                  = 0;
            row.RowId            = Guid.Empty;
            row.IdEmpresa        = 0;
            row.IdSucursal       = 0;
            row.AlicuotaAplicada = 0;
            row.MontoRetencion   = 0;

            return(row);
        }
Exemple #5
0
        /// <summary>
        /// Valida un tpu_RetencionesDetRow.
        /// </summary>
        public static bool RowIsValid(tpu_RetencionesDetDataset.tpu_RetencionesDetRow row)
        {
            ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber);
            bool   isValid = true;
            string mensaje;


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

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

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

            if (!MontoNetoIsValid(row.MontoNeto, out mensaje))
            {
                row.SetColumnError("MontoNeto", 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 (!IdEmpresaIsValid(row.IdEmpresa, out mensaje))
            {
                row.SetColumnError("IdEmpresa", mensaje);
                isValid = false;
            }

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

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

            ;

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

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