Exemple #1
0
 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());
 }
Exemple #2
0
        /// <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;
        }
Exemple #3
0
 public static void Delete(AlertaInfo _AlertaInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "AlertaDelete",
         new SqlParameter("@AlertaId", _AlertaInfo.AlertaId)
     );
 }
Exemple #4
0
 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)
     );
 }