Пример #1
0
 public IActionResult AddHotelPhone([FromBody]Hotelphone data)
 {
     if (isEmployee())
     {
         Boolean insertResult = addHotelPhone(data.Hid, data.PhoneNumber);
         if (insertResult)
         {
             return Json("Success");
         }
         else
         {
             return Json("Error: Could not add the phone number");
         }
     }
     else
     {
         return RedirectToAction("AccessDenied", "Account");
     }
 }
Пример #2
0
        public IActionResult DeleteHotelPhone([FromBody]Hotelphone data)
        {
            if (isEmployee())
            {
                if (deleteHotelPhone(data.Hid, data.PhoneNumber))
                {
                    return Json("Success");
                }
                else
                {
                    return Json("Error: Could not delete the phone number");
                }
            }
            else
            {
                return RedirectToAction("AccessDenied", "Account");
            }

        }