Beispiel #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            TradeBooking tradeBooking = await db.TradeBookings.FindAsync(id);

            db.TradeBookings.Remove(tradeBooking);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public async Task <ActionResult> Edit([Bind(Include = "TradeBookingID,UserId,TradeId,TradeStatus")] TradeBooking tradeBooking)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tradeBooking).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.TradeId = new SelectList(db.Trades, "TradeID", "Reference", tradeBooking.TradeId);
            ViewBag.UserId  = new SelectList(db.Users, "ID", "FirstName", tradeBooking.UserId);
            return(View(tradeBooking));
        }
Beispiel #3
0
        // GET: TradeBookings/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TradeBooking tradeBooking = await db.TradeBookings.FindAsync(id);

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

            if (tradeBooking == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TradeId = new SelectList(db.Trades, "TradeID", "Reference", tradeBooking.TradeId);
            ViewBag.UserId  = new SelectList(db.Users, "ID", "FirstName", tradeBooking.UserId);
            return(View(tradeBooking));
        }