public static void UpdateWithValidation(tpu_RetencionesDataset.tpu_RetencionesRow row) { ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber); if (RowIsValid(row)) { Update(row); } }
public static void Update(tpu_RetencionesDataset.tpu_RetencionesRow row) { if (row.RowState == DataRowState.Detached) { ((tpu_RetencionesDataset.tpu_RetencionesDataTable)row.Table).Addtpu_RetencionesRow(row); } Update(row.Table); }
/// <summary> /// Obtiene un registro de la tabla tpu_Retenciones que luego puede ser persistido en la base de datos. /// </summary> public static tpu_RetencionesDataset.tpu_RetencionesRow GetByPk(long IdRetencion) { tpu_RetencionesDataset.tpu_RetencionesRow row = mz.erp.dataaccess.tpu_Retenciones.GetByPk(IdRetencion); foreach (DataColumn dc in row.Table.Columns) { if (row[dc] == System.DBNull.Value) { row[dc] = Util.DefaultValue(dc.DataType); } } return(row); }
/// <summary> /// Establece los valores por defecto de tpu_RetencionesRow. /// </summary> public static tpu_RetencionesDataset.tpu_RetencionesRow SetRowDefaultValues(tpu_RetencionesDataset.tpu_RetencionesRow row) { row.IdRetencion = 0; row.IdTipoDeRetencion = string.Empty; row.MontoNeto = 0; row.MontoRetencion = 0; row.NumeroRetencion = string.Empty; row.FechaRetencion = DateTime.Now; row.NumeroRecibo = string.Empty; row.IdComprobante = string.Empty; row.IdProveedor = 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.IdEmpresa = 0; row.IdSucursal = 0; return(row); }
/// <summary> /// Valida un tpu_RetencionesRow. /// </summary> public static bool RowIsValid(tpu_RetencionesDataset.tpu_RetencionesRow 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 (!IdTipoDeRetencionIsValid(row.IdTipoDeRetencion, out mensaje)) { row.SetColumnError("IdTipoDeRetencion", mensaje); isValid = false; } if (!MontoNetoIsValid(row.MontoNeto, out mensaje)) { row.SetColumnError("MontoNeto", mensaje); isValid = false; } if (!MontoRetencionIsValid(row.MontoRetencion, out mensaje)) { row.SetColumnError("MontoRetencion", mensaje); isValid = false; } if (!NumeroRetencionIsValid(row.NumeroRetencion, out mensaje)) { row.SetColumnError("NumeroRetencion", mensaje); isValid = false; } if (!FechaRetencionIsValid(row.FechaRetencion, out mensaje)) { row.SetColumnError("FechaRetencion", mensaje); isValid = false; } if (!NumeroReciboIsValid(row.NumeroRecibo, out mensaje)) { row.SetColumnError("NumeroRecibo", mensaje); isValid = false; } if (!IdComprobanteIsValid(row.IdComprobante, out mensaje)) { row.SetColumnError("IdComprobante", mensaje); isValid = false; } if (!IdProveedorIsValid(row.IdProveedor, out mensaje)) { row.SetColumnError("IdProveedor", 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; } ; return(isValid); }
/// <summary> /// Envia los cambios del tpu_RetencionesRow a la base de datos. /// </summary> public static void Update(tpu_RetencionesDataset.tpu_RetencionesRow row) { ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tpu_Retenciones.Update(row); }