public ActionResult Delete(int id, string url)
        {
            //The URl attribute doesnt always return the correct value this needs to be fixed.
            EmailCart emailcart = repo.getEmailItem(id);

            repo.removeEmailItem(emailcart);
            return(RedirectToAction("Index", "Home"));
        }
Exemple #2
0
        public ActionResult AddToEmailCart(string photoShootName, string link, string searchTerm, string searchField, string type)
        {
            EmailCart emailcart = new EmailCart();

            emailcart.photoShootName = photoShootName;
            emailcart.link           = link;
            emailcart.netId          = User.Identity.Name;
            if (ModelState.IsValid)
            {
                db.EmailCarts.Add(emailcart);
                db.SaveChanges();
            }
            return(RedirectToAction("Index", new { searchTerm = searchTerm, searchField = searchField, type = type }));
        }
        public ActionResult addtoEmail(string title, string url, int id)
        {
            EmailCart emailcart = new EmailCart();

            emailcart.photoShootName = title;
            emailcart.link           = url;
            emailcart.netId          = User.Identity.Name;
            repo.AddToEmail(emailcart);
            string[] splitUrl = Regex.Split(url, "/" + title);

            url = Server.MapPath(splitUrl[0]);

            return(Redirect("/photos/index?id=" + url));
        }