public ActionResult addAddress(Twilio.Address _address) { var twilio = new TwilioRestClient(AccountSid, AuthToken); try{ var addResult = twilio.AddAddress(_address.FriendlyName, _address.CustomerName, _address.Street, _address.City, _address.Region, _address.PostalCode, _address.IsoCountry); return(View("Addresses")); } catch (Exception ex) { return(View()); } }
public ActionResult EditAddress(Twilio.Address _address) { var twilio = new TwilioRestClient(AccountSid, AuthToken); var options = new AddressOptions(); options.City = _address.City; options.CustomerName = _address.CustomerName; options.FriendlyName = _address.FriendlyName; options.PostalCode = _address.PostalCode; options.Region = _address.Region; options.Street = _address.Street; var response = twilio.UpdateAddress(_address.Sid, options); return(RedirectToAction("ListAddress")); }