Ejemplo n.º 1
0
        //[ValidateAntiForgeryToken]
        public ActionResult RemoveFromPullConfirmed(int?id)
        {
            //if (ModelState.IsValid)
            //{
            this.ApplicationDbContext = new ApplicationDbContext();
            this.UserManager          = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(this.ApplicationDbContext));
            var    user  = UserManager.FindById(User.Identity.GetUserId());
            string email = user.Email;

            var customerId = _customerManager.RetrieveCustomerIdByEmail(email);
            var comicId    = id;

            if (_comicManager.RemoveComicFromPullList(comicId, customerId) == true)
            {
                ViewBag.Message = "Comic removed from pull list!";
                return(RedirectToAction("PullList"));
            }
            else
            {
                return(new HttpStatusCodeResult(HttpStatusCode.ServiceUnavailable));
            }
            //}
            //else
            //{
            //    return View(Index());
            //}
        }
Ejemplo n.º 2
0
        private void btnRemoveFromPull_Click(object sender, RoutedEventArgs e)
        {
            var _customerID   = _customer.CustomerID;
            var _comicID      = _comic.ComicID;
            var _comicManager = new ComicManager();
            var mainWindow    = new MainWindow();

            try
            {
                _comicManager.RemoveComicFromPullList(_comicID, _customerID);
                MessageBox.Show("Comic removed from your pull list.");
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to remove from your pull list" + ex.Message + ex.StackTrace);
            }
        }