public IActionResult AddHotelChainPhone([FromBody]Hotelchainphone data) { if (isEmployee()) { Boolean insertResult = addHotelChainPhone(data.Hcid, data.PhoneNumber); if (insertResult) { return Json("Success"); } else { return Json("Error: Could not add the phone number"); } } else { return RedirectToAction("AccessDenied", "Account"); } }
public IActionResult DeleteHotelChainPhone([FromBody]Hotelchainphone data) { if (isEmployee()) { if (deleteHotelChainPhone(data.Hcid, data.PhoneNumber)) { return Json("Success"); } else { return Json("Error: Could not delete the phone number"); } } else { return RedirectToAction("AccessDenied", "Account"); } }