public IEnumerable<Message> GetListByUserId(Guid id) { //ICMS_spGetMessagesById IList<Message> list = new List<Message>(); SqlService sql = new SqlService(_sqlConnection); sql.AddParameter("@pId", System.Data.SqlDbType.UniqueIdentifier, id); using (SqlDataReader reader = sql.ExecuteSPReader("ICMS_spGetMessagesById")) { if (reader.HasRows) { while (reader.Read()) { Message message = new Message(); message.Id = reader.SafeGetGuid(reader.GetOrdinal("Id")); message.MessageText = reader.SafeGetString(reader.GetOrdinal("Message")); message.SendDate = reader.GetDateTime(reader.GetOrdinal("SendDate")); message.Sent = reader.SafeGetBool(reader.GetOrdinal("Sent")).Value; list.Add(message); } } } return list; }
public void Create(Message entity) { throw new NotImplementedException(); }
public ActionResult IndividualSend(Message model) { if (ModelState.IsValid) { //TODO HOW TO GET THE RESPONSE FROM THE SEND //TODO send using SMS Lane SMSSErvice _messageRepository.Create(model); model.Response = "MESSAGE QUEUED FOR SEND"; } return View(model); }
public ActionResult IndividualSend(Guid id) { Message model = new Message(); model.Response = "RESPONSE HERE"; Recipient r = _recipientRepository.GetById(id); model.Recipient = string.Format("{0} | {1} {2}", r.NickName, r.FirstName, r.LastName); // m.GetRecipient(id); model.RecipientId = id; model.SendDate = DateTime.Now; return View(model); }
public ActionResult GroupSend(Message model) { if (ModelState.IsValid) { //RecipientGroupRepository repo = new RecipientGroupRepository(_sqlConnectionString); //Messages m = new Messages(_sqlConnectionString); //model.Response = m.SendMessage(model.Message, model.RecipientGroup, ConfigurationManager.AppSettings["SMSUrl"]); //string mobileNos = string.Join(",", model.RecipientGroup.RecipientsList); //SendSms.SendMessage(model.Message.MessageText, mobileNos, ConfigurationManager.AppSettings["SMSUrl"]); _messageRepository.Create(model); //TODO HOW TO GET THE RESPONSE FROM THE SMS SEND? model.Response = "MESSAGE QUEUED FOR SEND"; } return View(model); }
public ActionResult GroupSend(Guid id) { //GroupSendMessage model = new GroupSendMessage(); Message model = new Message(); model.RecipientGroupId = id; //Messages m = new Messages(_sqlConnectionString); RecipientGroup g = _recipientGroupRepository.GetById(id); // m.GetRecipientGroup(id); model.RecipientGroup = g.GroupName; model.SendDate = DateTime.Now; model.Response = "RESPONSE HERE"; return View(model); }