Пример #1
0
        public IHttpActionResult PutGuest(int id, Guest guest)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != guest.Id)
            {
                return(BadRequest());
            }

            db.Entry(guest).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GuestExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Latitude,Longitutde,HotelAddress,HotelDescription,HotelRating,HotelName,HotelCity")] Hotel hotel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hotel));
 }
Пример #3
0
        public async Task <ActionResult> Edit([Bind(Include = "Room_Catogory_Id,Room_Catogory,Room_Description,Image_Url,IsActive,LCD_Television,DvdPlayer,RoomServices,MiniBar,WiFi,HairDrier")] Room_Catagorys room_Catagorys)
        {
            if (ModelState.IsValid)
            {
                db.Entry(room_Catagorys).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(room_Catagorys));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Depertment_Id,Depertment,Password")] Admin_login admin_login)
        {
            if (ModelState.IsValid)
            {
                db.Entry(admin_login).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(admin_login));
        }
Пример #5
0
 public ActionResult Edit([Bind(Include = "Id,HotelId,ImageName,ImagePath")] Image image)
 {
     if (ModelState.IsValid)
     {
         db.Entry(image).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HotelId = new SelectList(db.Hotel, "Id", "HotelAddress", image.HotelId);
     return(View(image));
 }
        public async Task <ActionResult> Edit([Bind(Include = "EventReservationId,GuestName,Guest_Email,Guest_Contact_No,EventName,EventDescription")] Event_GuestDetails event_GuestDetails)
        {
            if (ModelState.IsValid)
            {
                db.Entry(event_GuestDetails).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(event_GuestDetails));
        }
Пример #7
0
 public ActionResult Edit([Bind(Include = "Id,CheckinDate,CheckoutDate,ASPUserId,Rating,Comment,RoomId,Price,RoomNumber")] Booking booking)
 {
     if (ModelState.IsValid)
     {
         db.Entry(booking).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RoomId = new SelectList(db.Room, "Id", "RoomType", booking.RoomId);
     return(View(booking));
 }
        public async Task <ActionResult> Edit([Bind(Include = "Package_ID,Package_Name,Package_Price,Package_Details")] Package package)
        {
            if (ModelState.IsValid)
            {
                db.Entry(package).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(package));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Food_category_Id,Category,Description")] Food_Categories food_Categories)
        {
            if (ModelState.IsValid)
            {
                db.Entry(food_Categories).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(food_Categories));
        }
        public async Task <ActionResult> Edit([Bind(Include = "HallId,HallName,HallCapacity,HallDescription,HImage1,HImage2,HImage3,HImage4,Hall_price_Hour")] Hall hall)
        {
            if (ModelState.IsValid)
            {
                db.Entry(hall).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(hall));
        }
Пример #11
0
        public async Task <ActionResult> Edit([Bind(Include = "Guest_Id,Guest_Title,Guest_First_Name,Guest_Last_Name,Guest_Address,Guest_Email,Guest_MobileNO,Guest_CreditCardNo,Paasword")] Guest_Details guest_Details)
        {
            if (ModelState.IsValid)
            {
                db.Entry(guest_Details).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(guest_Details));
        }
Пример #12
0
 public ActionResult Edit([Bind(Include = "Id,RoomId,Date,PriceChange,AvaibleRoom")] RoomStates roomStates)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roomStates).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RoomId = new SelectList(db.Room, "Id", "RoomType", roomStates.RoomId);
     return(View(roomStates));
 }
Пример #13
0
 public ActionResult Edit([Bind(Include = "Id,RoomType,RoomDescription,TotalRoom,RoomPrice,HotelId")] Room room)
 {
     if (ModelState.IsValid)
     {
         db.Entry(room).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HotelId = new SelectList(db.Hotel, "Id", "HotelAddress", room.HotelId);
     return(View(room));
 }
Пример #14
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Item_Category_ID,Item_Name,Item_Code,Description,Portion_Price,Image_URL")] Food_Items food_Items)
        {
            if (ModelState.IsValid)
            {
                db.Entry(food_Items).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Item_Category_ID = new SelectList(db.Food_Categories, "Food_category_Id", "Category", food_Items.Item_Category_ID);
            return(View(food_Items));
        }
Пример #15
0
        public async Task <ActionResult> Edit([Bind(Include = "BookingID,RoomNo,CategoryId,ArivalDate,DepartureDate,ReservationId")] RoomBooking roomBooking)
        {
            if (ModelState.IsValid)
            {
                db.Entry(roomBooking).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.ReservationId = new SelectList(db.Reservations, "Reservation_Id", "Reservation_Id", roomBooking.ReservationId);
            return(View(roomBooking));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Room_Id,Room_Category_Id,Room_Number,Room_Description,Room_Image_url_1,Room_Image_url_2,Room_Image_url_3,Room_Image_url_4,Room_Image_url_5,RoomCapacity")] Room room)
        {
            if (ModelState.IsValid)
            {
                db.Entry(room).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Room_Category_Id = new SelectList(db.Room_Catagorys, "Room_Catogory_Id", "Room_Catogory", room.Room_Category_Id);
            return(View(room));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Bill_ID,Reservation_ID,Total_Charge,Paid")] Bill bill)
        {
            if (ModelState.IsValid)
            {
                db.Entry(bill).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Reservation_ID = new SelectList(db.Reservations, "Reservation_Id", "Reservation_Id", bill.Reservation_ID);
            return(View(bill));
        }
        public async Task <ActionResult> Edit([Bind(Include = "EventBookingID,HallNumber,EventStartDate,EventEndDate,EventReservationId")] EventReservation eventReservation)
        {
            if (ModelState.IsValid)
            {
                db.Entry(eventReservation).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.EventReservationId = new SelectList(db.Event_GuestDetails, "EventReservationId", "GuestName", eventReservation.EventReservationId);
            ViewBag.HallNumber         = new SelectList(db.Halls, "HallId", "HallName", eventReservation.HallNumber);
            return(View(eventReservation));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Order_Id,Reservation_Id,Item_Id,Item_Quantity,Item_Portion_Price,Total_Item_Price")] Order order)
        {
            if (ModelState.IsValid)
            {
                db.Entry(order).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Item_Id        = new SelectList(db.Food_Items, "Id", "Item_Name", order.Item_Id);
            ViewBag.Reservation_Id = new SelectList(db.Reservations, "Reservation_Id", "Reservation_Id", order.Reservation_Id);
            return(View(order));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Reservation_Id,Guest_Id,Package_Id,Room_Number,Check_In,Check_Out,Adults,Childrens")] Reservation reservation)
        {
            if (ModelState.IsValid)
            {
                db.Entry(reservation).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Guest_Id    = new SelectList(db.Guest_Details, "Guest_Id", "Guest_Title", reservation.Guest_Id);
            ViewBag.Package_Id  = new SelectList(db.Packages, "Package_ID", "Package_Name", reservation.Package_Id);
            ViewBag.Room_Number = new SelectList(db.Rooms, "Room_Id", "Room_Description", reservation.Room_Number);
            return(View(reservation));
        }
Пример #21
0
 public void Update(Client item)
 {
     db.Entry(item).State = EntityState.Modified;
 }