Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            User user = site.Users.Find(id);

            site.Users.Remove(user);
            site.SaveChanges();
            return(RedirectToAction("All"));
        }
Exemplo n.º 2
0
        public ActionResult Create(Date date)
        {
            if (ModelState.IsValid)
            {
                db.Dates.Add(date);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(date));
        }
Exemplo n.º 3
0
        public ActionResult Create(Track track)
        {
            if (ModelState.IsValid)
            {
                db.Tracks.Add(track);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(track));
        }
        public ActionResult Create(Price price)
        {
            if (ModelState.IsValid)
            {
                db.Prices.Add(price);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(price));
        }
Exemplo n.º 5
0
        public ActionResult Create(Information information)
        {
            if (ModelState.IsValid)
            {
                db.Information.Add(information);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(information));
        }
Exemplo n.º 6
0
        public ActionResult Create(Log log)
        {
            if (ModelState.IsValid)
            {
                db.Logs.Add(log);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(log));
        }
        public ActionResult Create(User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RegistrationID = new SelectList(db.Registrations, "RegistrationID", "Type", user.RegistrationID);
            return(View(user));
        }
        public ActionResult Create(Critique critique)
        {
            if (ModelState.IsValid)
            {
                db.Critiques.Add(critique);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.UserID = new SelectList(db.Users, "UserID", "FirstName", critique.UserID);
            return(View(critique));
        }
Exemplo n.º 9
0
        public ActionResult Create(LisaWheeler lisa)
        {
            if (ModelState.IsValid)
            {
                lisa.Created     = DateTime.UtcNow;
                lisa.Cleared     = DateTime.UtcNow;
                lisa.WaitingList = false;

                db.LisaWheelers.Add(lisa);
                db.SaveChanges();

                return(RedirectToAction("Manage"));
            }

            return(View(lisa));
        }
Exemplo n.º 10
0
        public ActionResult IPN()
        {
            var formVals = new Dictionary <string, string>();

            formVals.Add("cmd", "_notify-validate");

            string response = GetPayPalResponse(formVals, false);

            DAL.Log("got IPN response", "IPN");

            if (response == "VERIFIED")
            {
                DAL.Log("IPN Response: " + Request["payment_status"], "IPN");
                DAL.Log("IPN Status: " + Request["custom"], "IPN");

                try
                {
                    var custom = Request["custom"];

                    var lisa = (from p in scbwi.LisaWheelers
                                where p.PayPalID == custom
                                select p).SingleOrDefault();

                    if (lisa == null)
                    {
                        DAL.Log("shit, f**k, lisa not found", "IPN");

                        return(View());
                    }

                    if (Request["payment_status"] == "Completed")
                    {
                        DAL.Log("Completed, supposedly", "IPN");

                        lisa.Cleared = DateTime.UtcNow;

                        DAL.LWEmailComplete(lisa);
                    }
                    else if (Request["payment_status"] == "Pending")
                    {
                        DAL.Log("Pending, supposedly", "IPN");

                        lisa.Paid = DateTime.UtcNow;

                        DAL.LWEmailPending(lisa);
                    }
                    else if (Request["payment_status"] == "Denied")
                    {
                        DAL.Log("Declined, supposedly", "IPN");

                        DAL.LWEmailDeclined(lisa);
                    }

                    scbwi.Entry(lisa).State = EntityState.Modified;
                    scbwi.SaveChanges();

                    return(View());
                }
                catch (Exception e)
                {
                    DAL.Log("Exception: " + e.Message, "IPN");
                }

                return(View());
            }

            if (response == "INVALID")
            {
                DAL.Log("Invalid response! Bailing!", "IPN");
                DAL.Log(response, "IPN");

                string transactionID = Request["txn_id"];
                string sAmountPaid   = Request["mc_gross_1"];
                string payer_email   = Request["payer_email"];
                string stat          = Request["payment_status"];
                string received      = Request["payment_date"];

                return(View());
            }

            return(View());
        }