public int VoicingMessageCount(string id) { Message message = new Message(); try { using (MySqlConnection db = new MySqlConnection(Database.ReminderConnection)) { string query = "select id from messages " + " where id = @id"; message = db.Query<Message>(query, new { @id = id }).SingleOrDefault(); //message = db.Query<Message>(query, new { @id = 25 }).SingleOrDefault(); if (message != null) { return message.ID; } else { return 0; } } } catch (Exception er) { Log.LogMessage(er.ToString()); return 0; } }
public Message GetMessage(string id) { Message message = new Message(); try { using (MySqlConnection db = new MySqlConnection(Database.ReminderConnection)) { //Select records that have not been completed string query = " select message_id as MessageID,message_name as MessageName," + " message as MessageText" + " from messages" + " where id = @id"; message = db.Query<Message>(query, new { @id = id }).Single(); return message; } } catch (Exception er) { Log.LogMessage(er.ToString()); return message; } }
public Message Get(string id) { Message message = new Message(); message = messaging.GetMessage(id); return message; }