public static void UpdateWithValidation(tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row) { ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber); if (RowIsValid(row)) { Update(row); } }
public static void Update(tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row) { if (row.RowState == DataRowState.Detached) { ((tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetDataTable)row.Table).Addtui_ConfiguracionGrillaEstilosCondicionalesDetRow(row); } Update(row.Table); }
/// <summary> /// Establece los valores por defecto de tui_ConfiguracionGrillaEstilosCondicionalesDetRow. /// </summary> public static tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow SetRowDefaultValues(tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row) { row.IdConfiguracion = Util.NewLongId(); row.IdCondicion = Util.NewLongId(); row.Columna = string.Empty; row.Condicion = string.Empty; row.Valor = string.Empty; row.ValorColumna = 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> /// Obtiene un registro de la tabla tui_ConfiguracionGrillaEstilosCondicionalesDet que luego puede ser persistido en la base de datos. /// </summary> public static tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow GetByPk(long IdConfiguracion, long IdCondicion) { tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row = mz.erp.dataaccess.tui_ConfiguracionGrillaEstilosCondicionalesDet.GetByPk(IdConfiguracion, IdCondicion); if (row != null) { foreach (DataColumn dc in row.Table.Columns) { if (row[dc] == System.DBNull.Value) { row[dc] = Util.DefaultValue(dc.DataType); } } } return(row); }
/// <summary> /// Valida un tui_ConfiguracionGrillaEstilosCondicionalesDetRow. /// </summary> public static bool RowIsValid(tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row) { ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber); bool isValid = true; string mensaje; if (!IdConfiguracionIsValid(row.IdConfiguracion, out mensaje)) { row.SetColumnError("IdConfiguracion", mensaje); isValid = false; } if (!IdCondicionIsValid(row.IdCondicion, out mensaje)) { row.SetColumnError("IdCondicion", mensaje); isValid = false; } if (!ColumnaIsValid(row.Columna, out mensaje)) { row.SetColumnError("Columna", mensaje); isValid = false; } if (!CondicionIsValid(row.Condicion, out mensaje)) { row.SetColumnError("Condicion", mensaje); isValid = false; } if (!ValorIsValid(row.Valor, out mensaje)) { row.SetColumnError("Valor", mensaje); isValid = false; } if (!ValorColumnaIsValid(row.ValorColumna, out mensaje)) { row.SetColumnError("ValorColumna", 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 tui_ConfiguracionGrillaEstilosCondicionalesDetRow a la base de datos. /// </summary> public static void Update(tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row) { ApplicationAssert.Check(row != null, "El argumento row no debe ser nulo.", ApplicationAssert.LineNumber); mz.erp.dataaccess.tui_ConfiguracionGrillaEstilosCondicionalesDet.Update(row); }
public static long GetIdCondicion(tui_ConfiguracionGrillaEstilosAplicablesPerfilesExDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataTable table, long IdConfiguracion, string Columna, string Condicion, string Valor, string ValorColumna) { long IdCondicion = long.MinValue; bool existe = false; int i = 0; while (!existe && i < table.Rows.Count) { tui_ConfiguracionGrillaEstilosAplicablesPerfilesExDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesRow rowT = (tui_ConfiguracionGrillaEstilosAplicablesPerfilesExDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesRow)table.Rows[i]; existe = rowT.IdConfiguracion == IdConfiguracion && rowT.Columna.Equals(Columna) && rowT.Condicion.Equals(Condicion) && ((rowT["ValorColumna"] == System.DBNull.Value && rowT.Valor.Equals(Valor)) || (rowT["Valor"] == System.DBNull.Value && rowT.ValorColumna.Equals(ValorColumna))); if (existe) { IdCondicion = rowT.IdCondicion; } i++; } if (!existe) { tui_ConfiguracionGrillaEstilosCondicionalesDetDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetRow row = tui_ConfiguracionGrillaEstilosCondicionalesDet.GetCondicion(IdConfiguracion, Columna, Condicion, Valor, ValorColumna); if (row != null) { IdCondicion = row.IdCondicion; } else { tui_ConfiguracionGrillaEstilosCondicionalesDetUsuariosDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetUsuariosRow rowU = tui_ConfiguracionGrillaEstilosCondicionalesDetUsuarios.GetCondicion(IdConfiguracion, Columna, Condicion, Valor, ValorColumna); if (rowU != null) { IdCondicion = rowU.IdCondicion; } else { tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesRow rowP = tui_ConfiguracionGrillaEstilosCondicionalesDetPerfiles.GetCondicion(IdConfiguracion, Columna, Condicion, Valor, ValorColumna); if (rowP != null) { IdCondicion = rowP.IdCondicion; } } } } return(IdCondicion); }