Example #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            BookingInfo bookingInfo = await db.BookingInfo.FindAsync(id);

            db.BookingInfo.Remove(bookingInfo);
            await db.SaveChangesAsync();

            return(RedirectToAction("BookingData"));
        }
Example #2
0
        public async Task <ActionResult> BookingEdit([Bind(Include = "BookingID,ServerID,UserID,CheckInTime,CheckOutTime")] BookingInfo bookingInfo)
        {
            if (ModelState.IsValid)
            {
                db.Entry(bookingInfo).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("BookingData"));
            }
            ViewBag.ServerID = new SelectList(db.InfoServers, "ServerID", "ServerID", bookingInfo.ServerID);
            return(View(bookingInfo));
        }
Example #3
0
        // GET: BookingInfoesCRUD/Details/5
        public async Task <ActionResult> BookingDetails(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BookingInfo bookingInfo = await db.BookingInfo.FindAsync(id);

            if (bookingInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(bookingInfo));
        }
Example #4
0
        // GET: BookingInfoesCRUD/Edit/5
        public async Task <ActionResult> BookingEdit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BookingInfo bookingInfo = await db.BookingInfo.FindAsync(id);

            if (bookingInfo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ServerID = new SelectList(db.InfoServers, "ServerID", "ServerID", bookingInfo.ServerID);
            return(View(bookingInfo));
        }