public ActionResult Pay(int GGBDeal_ID, int?Pay) { if (Session["AUTH"] != null) { if (Pay == null) { return(RedirectToAction("Pricing")); } try { AuthUser auth = (Session["AUTH"] as AuthUser); User user = db.Users.Find(auth.ID); GGBDeal GGBDeal = db.GGBDeals.Find(GGBDeal_ID); Users_GGBDeals item = new Users_GGBDeals { User_ID = user.ID, GGBDeal_ID = GGBDeal_ID, Active = false, Pay = Pay.Value }; db.Users_GGBDeals.Add(item); db.SaveChanges(); string ReturnURL = DEL.Domain + "Home/D?i=" + DEL.encrypt(item.ID.ToString()); return(Redirect(DEL.PayMethod(Pay.Value, ReturnURL, "USD", GGBDeal.Name, GGBDeal.Price.ToString(), user.Name, user.Name, user.Email, user.Phone, user.Country, "AUS", GGBDeal.Name, GGBDeal.Name, DEL.Domain))); } catch { return(RedirectToAction("Pricing")); } } else { return(RedirectToAction("SignIn")); } }
public ActionResult DeleteConfirmed(int id) { GGBDeal gGBDeal = db.GGBDeals.Find(id); db.GGBDeals.Remove(gGBDeal); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,Price,GGB")] GGBDeal gGBDeal) { if (ModelState.IsValid) { db.Entry(gGBDeal).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gGBDeal)); }
public ActionResult Create([Bind(Include = "ID,Name,Price,GGB")] GGBDeal gGBDeal) { if (ModelState.IsValid) { db.GGBDeals.Add(gGBDeal); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gGBDeal)); }
// GET: GGBDeals/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(RedirectToAction("Index")); } GGBDeal gGBDeal = db.GGBDeals.Find(id); if (gGBDeal == null) { return(HttpNotFound()); } return(View(gGBDeal)); }