public async Task <IActionResult> OTPPayment(string otp1) { if (otp1 == (HttpContext.Session.GetInt32(SessionOtp1)).ToString()) { var card = await _context.Cards .FirstOrDefaultAsync(m => m.CardNumber == HttpContext.Session.GetString(Sessioncard1)); var booking = _context.Bookings .OrderByDescending(a => a.BookingID) .First(); card.balance = (int)(card.balance - HttpContext.Session.GetInt32(SessionAmt1)); booking.status = "Booked"; _context.Update(booking); _context.Update(card); ViewBag.tid = booking.BookingID; await _context.SaveChangesAsync(); ViewBag.paymentStatus = "success"; ViewBag.message1 = "woohoo! Your payment is successfull. Enjoy your Trip :)"; return(View("Cardpayment")); } else { ViewBag.pkgid = HttpContext.Session.GetInt32(Sessionpkgid1); ViewBag.paymentStatus = "fail"; ViewBag.message1 = "Payment failed due to Wrong OTP! Please Try again"; return(View("Cardpayment")); } }
public async Task <IActionResult> Edit(int id, [Bind("BookingID,PackageName,NumberofPersons,JourneyDate,email,city,PaymentMethod,Amount,status")] Booking booking) { if (id != booking.BookingID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(booking); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookingExists(booking.BookingID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(booking)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,CardNumber,month,year,CVV,mailid,balance")] Dcard dcard) { if (id != dcard.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dcard); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DcardExists(dcard.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dcard)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Username,Password,balance,Bank")] Netbanking netbanking) { if (id != netbanking.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(netbanking); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NetbankingExists(netbanking.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(netbanking)); }
public async Task <IActionResult> Edit(int id, [Bind("PackagesID,Name,Places,Amount,discount,Duration,Facilities,Description")] packages packages) { if (id != packages.PackagesID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(packages); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!packagesExists(packages.PackagesID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(packages)); }
// GET: CustomerBooking/Delete/5 public async Task <IActionResult> Cancel(int id) { var booking = await _context.Bookings .FirstOrDefaultAsync(m => m.BookingID == id); ViewBag.amt = booking.Amount; booking.status = "Cancelled"; _context.Update(booking); await _context.SaveChangesAsync(); return(View()); }