public static Message GetExternalMessageWithJoin(string WebMessageID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetExternalMessageWithJoin"); db.AddInParameter(dbCommand, "WebMessageID", DbType.String, WebMessageID); List <Message> messages = new List <Message>(); using (IDataReader dr = db.ExecuteReader(dbCommand)) { messages = Message.PopulateMessageWithJoin(dr); dr.Close(); } if (messages.Count > 0) { return(messages[0]); } else { return(null); } }
public static Message[] GetNewMessages(int MemberID) { List <Message> messages = new List <Message>(); try { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetNewMessages"); db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID); using (IDataReader dr = db.ExecuteReader(dbCommand)) { messages = Message.PopulateMessageWithJoin(dr); dr.Close(); } } catch (Exception ex) { throw ex; } return(messages.ToArray()); }
/// <summary> /// /// </summary> /// <param name="MemberID"></param> /// <param name="Page">Zero based Page indexer</param> /// <returns></returns> public static Message[] GetTrash(int MemberID, int Page, int PageSize) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetTrashMessages"); db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID); db.AddInParameter(dbCommand, "Page", DbType.Int32, Page); db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize); List <Message> messages = new List <Message>(); using (IDataReader dr = db.ExecuteReader(dbCommand)) { messages = Message.PopulateMessageWithJoin(dr); dr.Close(); } return(messages.ToArray()); }
public static Message[] GetSentMessageHeaderWithReply(string WebMessageID, int MemberID) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetSentMessageHeaderWithReply"); db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID); db.AddInParameter(dbCommand, "WebMessageID", DbType.String, WebMessageID); List <Message> messages = new List <Message>(); using (IDataReader dr = db.ExecuteReader(dbCommand)) { messages = Message.PopulateMessageWithJoin(dr); dr.Close(); } return(messages.ToArray()); }
public static Message[] GetExternalMessageHeader(string WebMessageID, string PassKey) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("HG_GetExternalMessageHeader"); db.AddInParameter(dbCommand, "WebMessageID", DbType.String, WebMessageID); db.AddInParameter(dbCommand, "PassKey", DbType.String, PassKey); List <Message> messages = new List <Message>(); using (IDataReader dr = db.ExecuteReader(dbCommand)) { messages = Message.PopulateMessageWithJoin(dr); dr.Close(); } return(messages.ToArray()); }