public ActionResult Index(MailViewModel cvm) { ContactHistory ch = new ContactHistory(); Common.CopyProperties(cvm, ch, false); ch.ContactDate = DateTime.Now; ch.BusinessName = cvm.BusinessName; ch.Comments = cvm.Comments; ch.ContactName = ""; ch.Phone = cvm.Phone; ch.Email = cvm.Email; db.ContactHistories.Add(ch); string Message = ""; Message += "Date:" + ch.ContactDate + "\n\r"; //Message += "Business Name: " + ch.BusinessName + "\n\r"; Message += "Contact Name: " + ch.ContactName + "\n\r"; Message += "Company Name: " + ch.BusinessName + "\n\r"; Message += "Phone: " + ch.Phone + "\n\r"; Message += "Email Addr: " + ch.Email + "\n\r"; Message += "Message: " + ch.Comments + "\n\r"; Class_Gmail mail = new Class_Gmail(ch.Email, ch.BusinessName, "*****@*****.**", "Customer Service", "*****@*****.**", "Feline33"); mail.Subject = "Inquiry"; mail.Body = Message; mail.Send(); db.SaveChanges(); MailViewModel mvm = new MailViewModel(); mvm.Msg = "Message Sent"; return View(mvm); }
public static void Main(string[] args) { var client = new CallfireClient("api_login", "api_password"); var request = new GetByIdRequest { Id = 379506003, Offset = 0, Limit = 10, Fields = "calls/fromNumber,calls/toNumber,texts/message" }; ContactHistory contactHistory = client.ContactsApi.GetHistory(request); }
public override DataTemplate SelectTemplate(object inItem, DependencyObject inContainer) { DataRowView row = inItem as DataRowView; ContactHistory w = GetWindow1(inContainer); if (row != null) { if (row.DataView.Table.Columns.Contains("media")) { string media = string.Empty; if (row["media"] != null) { media = row["media"] as string; } if (media == "chat") { return((DataTemplate)w.FindResource("MediaTemplateChat")); } if (media == "email") { string type = row["SubtypeId"] as string; if (string.IsNullOrEmpty(type)) { return((DataTemplate)w.FindResource("MediaTemplateEmailOutbound")); } if (type.ToLower().Contains("inbound")) { return((DataTemplate)w.FindResource("MediaTemplateEmailInbound")); } else { return((DataTemplate)w.FindResource("MediaTemplateEmailOutbound")); } } if (media == "voice") { return((DataTemplate)w.FindResource("MediaTemplateVoice")); } } } return((DataTemplate)w.FindResource("MediaTemplateDefault")); }
public void Execute_Creates_History_Record() { // Setup InitializeTestEntities(); // Act DateTime start = DateTime.Now; new EditContactCommand(_serviceFactory.Object).WithContactId(_contact.Id) .SetName("Name") .SetDirectPhone("111-111-1111") .SetMobilePhone("222-222-2222") .SetExtension("33") .SetEmail("*****@*****.**") .SetAssistant("Assistant") .SetReferredBy("Referred By") .SetNotes("Notes") .SetTitle("New Title") .SetJigsawId(1235) .RequestedByUserId(_user.Id) .Execute(); DateTime end = DateTime.Now; // Verify Contact contact = _unitOfWork.Contacts.Fetch().Single(); ContactHistory history = contact.History.Single(); Assert.AreEqual("Name", history.Name, "The history record's name was incorrect"); Assert.AreEqual("111-111-1111", history.DirectPhone, "The history record's direct phone was incorrect"); Assert.AreEqual("222-222-2222", history.MobilePhone, "The history record's mobile phone was incorrect"); Assert.AreEqual("33", history.Extension, "The history record's extension was incorrect"); Assert.AreEqual("*****@*****.**", history.Email, "The history record's email was incorrect"); Assert.AreEqual("Assistant", history.Assistant, "The history record's assistant was incorrect"); Assert.AreEqual("Referred By", history.ReferredBy, "The history record's referred by was incorrect"); Assert.AreEqual("Notes", history.Notes, "The history record's notes was incorrect"); Assert.AreEqual("New Title", history.Title, "The history record's title was incorrect"); Assert.AreEqual(1235, history.JigsawId, "Jigsaw Id was incorrect"); Assert.IsTrue(history.HasJigsawAccess, "Jigsaw access was incorrect"); Assert.AreEqual(_user, history.AuthoringUser, "The history record's author was incorrect"); Assert.AreEqual(MJLConstants.HistoryUpdate, history.HistoryAction, "The history record's action value was incorrect"); Assert.IsTrue(history.DateModified >= start && history.DateModified <= end, "The history record's modification date was incorrect"); }