public static int Insert(TipoAlertaInfo _TipoAlertaInfo) { //Execute the query and return the new Guid object retval= _AdoHelper.ExecuteScalar(ConnectionString,"TipoAlertaInsert", new SqlParameter("@Descripcion", _TipoAlertaInfo.Descripcion), new SqlParameter("@ColorRojo", _TipoAlertaInfo.ColorRojo), new SqlParameter("@ColorVerde", _TipoAlertaInfo.ColorVerde), new SqlParameter("@ColorAzul", _TipoAlertaInfo.ColorAzul), new SqlParameter("@ColorAlfa", _TipoAlertaInfo.ColorAlfa) ); return Int32.Parse(retval.ToString()); }
public static void Update(TipoAlertaInfo _TipoAlertaInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "TipoAlertaUpdate", new SqlParameter("@TipoAlertaId", _TipoAlertaInfo.TipoAlertaId), new SqlParameter("@Descripcion", _TipoAlertaInfo.Descripcion), new SqlParameter("@ColorRojo", _TipoAlertaInfo.ColorRojo), new SqlParameter("@ColorVerde", _TipoAlertaInfo.ColorVerde), new SqlParameter("@ColorAzul", _TipoAlertaInfo.ColorAzul), new SqlParameter("@ColorAlfa", _TipoAlertaInfo.ColorAlfa) ); }
public static void Delete(TipoAlertaInfo _TipoAlertaInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "TipoAlertaDelete", new SqlParameter("@TipoAlertaId", _TipoAlertaInfo.TipoAlertaId) ); }
/// <summary> /// Creates a new instance of the TipoAlerta class and populates it with data from the specified SqlDataReader. /// </summary> private static TipoAlertaInfo MakeTipoAlerta(SqlDataReader dataReader) { TipoAlertaInfo tipoAlerta = new TipoAlertaInfo(); if (dataReader.IsDBNull(TipoAlertaId) == false) tipoAlerta.TipoAlertaId = dataReader.GetInt32(TipoAlertaId); if (dataReader.IsDBNull(Descripcion) == false) tipoAlerta.Descripcion = dataReader.GetString(Descripcion); if (dataReader.IsDBNull(ColorRojo) == false) tipoAlerta.ColorRojo = dataReader.GetByte(ColorRojo); if (dataReader.IsDBNull(ColorVerde) == false) tipoAlerta.ColorVerde = dataReader.GetByte(ColorVerde); if (dataReader.IsDBNull(ColorAzul) == false) tipoAlerta.ColorAzul = dataReader.GetByte(ColorAzul); if (dataReader.IsDBNull(ColorAlfa) == false) tipoAlerta.ColorAlfa = dataReader.GetByte(ColorAlfa); return tipoAlerta; }