public void AddReplyTo(ClassifiedMessage oMessageReply) { ClassifiedMessage oMessage = this.oMessages.Find(msg => msg.Id == oMessageReply.ReplyTo); if (oMessage != null) { oMessage.AddReply(oMessageReply); } }
public async Task NotifyMessage(ClassifiedMessage message) { if (this.isValid) { var user = new User(this.CreatedBy); if (user.oDetails.ConsentToContact) { //Send mail } } }
public void LoadMessages(string cFrom = "", string cTo = "") { string cProcedure = ""; ClassifiedMessage oMessage; DataTable oMessagesDB; Dictionary <string, object> infoParameters = new Dictionary <string, object>(); infoParameters.Add("cClassifiedId", this.Id); if (cFrom.Length == 0 && cTo.Length == 0) { cProcedure = "sp_Messages_GetAll"; } else if (cFrom.Length == 0 && cTo.Length > 0) { cProcedure = "sp_Messages_GetClsTo"; infoParameters.Add("cTo", cTo); } else if (cFrom.Length > 0 && cTo.Length == 0) { cProcedure = "sp_Messages_GetClsFrom"; infoParameters.Add("cFrom", cFrom); } else { cProcedure = "sp_Messages_GetClsFromTo"; infoParameters.Add("cFrom", cFrom); infoParameters.Add("cTo", cTo); } try { oMessagesDB = DBConn.ExecuteCommand(cProcedure, infoParameters).Tables[0]; if (!oMessagesDB.HasErrors) { foreach (DataRow oRow in oMessagesDB.Rows) { oMessage = new ClassifiedMessage(); oMessage.MapFromTableRow(oRow); if (oMessage.isValid) { this.oMessages.Add(oMessage); } } } } catch (Exception e) { this.sMsgError.Add("Error getting messages."); this.sMsgError.Add(e.Message); } }
public void LoadMessagesFrom(string cFrom) { ClassifiedMessage oMessage; DataTable oMessagesDB; Dictionary <string, object> infoParameters = new Dictionary <string, object>(); infoParameters.Add("cClassifiedId", this.Id); infoParameters.Add("cFrom", cFrom); try { oMessagesDB = DBConn.ExecuteCommand("sp_Messages_GetClsFrom", infoParameters).Tables[0]; if (!oMessagesDB.HasErrors) { foreach (DataRow oRow in oMessagesDB.Rows) { oMessage = new ClassifiedMessage(); oMessage.MapFromTableRow(oRow); if (oMessage.isValid) { if (oMessage.ReplyTo > 0) { this.oMessages.AddReplyTo(oMessage); } else { this.oMessages.Add(oMessage); } } } } } catch (Exception e) { this.sMsgError.Add("Error getting messages."); this.sMsgError.Add(e.Message); } }
public void Add(ClassifiedMessage oMessage) { this.oMessages.Add(oMessage); }
public SecureClassifiedMessage(ClassifiedMessage fromMessage) { this.Id = fromMessage.Id; this.Date = fromMessage.Date; this.Message = fromMessage.Message; }
public void AddReply(ClassifiedMessage oMessage) { this.oReply.Add(oMessage); }