Exemplo n.º 1
0
        public void UpdateListofhotel(int listid, ListofHotelDetail list)
        {
            var data = context.ListofHotelDetails.SingleOrDefault(s => s.ListId == listid);

            data.CostId  = list.CostId;
            data.HotelId = list.HotelId;
            context.SaveChanges();
        }
 public ActionResult UpdateList(int HotelList, ListofHotelDetail listofHotel)
 {
     try
     {
         repository.UpdateListofhotel(HotelList, listofHotel);
         return(Ok("List of HotelSuccessfully Updated"));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
 public ActionResult InsertList(ListofHotelDetail listofHotel)
 {
     try
     {
         repository.InsertHotelList(listofHotel);
         return(Ok("Hotel List successfully Inserted"));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
Exemplo n.º 4
0
 public void InsertHotelList(ListofHotelDetail list)
 {
     context.ListofHotelDetails.Add(list);
     context.SaveChanges();
 }