public IActionResult AddHotelChainEmail([FromBody]Hotelchainemail data) { if (isEmployee()) { Boolean insertResult = addHotelChainEmail(data.Hcid, data.Email); if (insertResult) { return Json("Success"); } else { return Json("Error: Could not add the email"); } } else { return RedirectToAction("AccessDenied", "Account"); } }
public IActionResult DeleteHotelChainEmail([FromBody]Hotelchainemail data) { if (isEmployee()) { if (deleteHotelChainEmail(data.Hcid, data.Email)) { return Json("Success"); } else { return Json("Error: Could not delete the email"); } } else { return RedirectToAction("AccessDenied", "Account"); } }