public static int Insert(AlertaInfo _AlertaInfo) { //Execute the query and return the new Guid object retval= _AdoHelper.ExecuteScalar(ConnectionString,"AlertaInsert", new SqlParameter("@Descripcion", _AlertaInfo.Descripcion), new SqlParameter("@TipoAlertaId", _AlertaInfo.TipoAlertaId) ); return Int32.Parse(retval.ToString()); }
/// <summary> /// Creates a new instance of the Alerta class and populates it with data from the specified SqlDataReader. /// </summary> private static AlertaInfo MakeAlerta(SqlDataReader dataReader) { AlertaInfo alerta = new AlertaInfo(); if (dataReader.IsDBNull(AlertaId) == false) alerta.AlertaId = dataReader.GetInt32(AlertaId); if (dataReader.IsDBNull(Descripcion) == false) alerta.Descripcion = dataReader.GetString(Descripcion); if (dataReader.IsDBNull(TipoAlertaId) == false) alerta.TipoAlertaId = dataReader.GetInt32(TipoAlertaId); return alerta; }
public static void Delete(AlertaInfo _AlertaInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "AlertaDelete", new SqlParameter("@AlertaId", _AlertaInfo.AlertaId) ); }
public static void Update(AlertaInfo _AlertaInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "AlertaUpdate", new SqlParameter("@AlertaId", _AlertaInfo.AlertaId), new SqlParameter("@Descripcion", _AlertaInfo.Descripcion), new SqlParameter("@TipoAlertaId", _AlertaInfo.TipoAlertaId) ); }