Exemplo n.º 1
0
 public static int DeleteGuest(Common.DTO.GuestDto guest)
 {
     try
     {
         return(DAL.GuestDal.DeleteGuest(Converters.GuestConverter.ToDalGuest(guest)));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 2
0
 //add
 public IHttpActionResult PutGuest(Common.DTO.GuestDto guest)
 {
     try
     {
         var q = BLL.GuestService.AddGuest(guest);
         //if (q == null)
         //  return NotFound();
         return(Ok(q));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 3
0
        //update
        public IHttpActionResult PostGuest(Common.DTO.GuestDto guest)
        {
            try
            {
                int x = BLL.GuestService.UpdateGuest(guest);

                if (x == 0)
                {
                    return(NotFound());
                }
                else
                {
                    return(Ok(x));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }