public ActionResult Index(SMSTextMessage sms) { if (ModelState.IsValid) { // findContact returns error, an error message is broadcast to the screen. // otherwise it broadcasts a success message Contacts contactsIndex = new Contacts(); string findContact = contactsIndex.findContact(sms.AreaCode, sms.PhoneNumber); if (findContact == "error") { ViewData["SuccessMsg"] = "Error. Contact does not exist. Goto contacts page above."; } else { ViewData["SuccessMsg"] = "Message was successfully sent."; } } return View(sms); }
// GET: Contacts // Returns list of contacts public ActionResult Index() { Contacts contactsIndex = new Contacts(); return View(contactsIndex.contacts); }