Beispiel #1
0
        /// <summary>
        /// Supprime l'élement sélectionné du bon tableau
        /// </summary>
        /// <param name="NodeName"></param>
        /// <param name="SelectedItem"></param>
        private void DeleteItemListView(String NodeName, ListViewItem SelectedItem)
        {
            switch (NodeName)
            {
            case "Articles":
                ArticleDAO.DeleteArticle(SelectedItem.SubItems[2].Text);
                UpdateListView("Articles");
                break;

            case "Marques":
                BrandDAO.DeleteBrand(int.Parse(SelectedItem.SubItems[1].Text));
                UpdateListView("Marques");
                break;

            case "Familles":
                FamilyDAO.DeleteFamily(int.Parse(SelectedItem.SubItems[1].Text));
                UpdateListView("Familles");
                break;

            case "Sous familles":
                SubFamilyDAO.DeleteSubFamily(int.Parse(SelectedItem.SubItems[1].Text));
                UpdateListView("Sous familles");
                break;

            default:
                break;
            }
        }
Beispiel #2
0
        public ActionResult DeleteArticle(int id)
        {
            ArticleDAO articleDAO = new ArticleDAO();

            articleDAO.DeleteArticle(id);
            return(Redirect("/Home/Articles/"));
        }
Beispiel #3
0
        public ActionResult Delete(int id)
        {
            // Check cookies admin
            if (Request.Cookies["AdminIIT"] == null ||
                Request.Cookies["AdminIIT"].Values["expires"].AsDateTime() < DateTime.Now)
            {
                return(RedirectToAction("Login", "Account", "Admin"));
            }


            var dao = new ArticleDAO();

            dao.DeleteArticle(id);

            return(RedirectToAction("Index", "Article", "Admin"));
        }
        public ActionResult Delete(int id)
        {
            if (!checkSession())
            {
                return(RedirectToAction("login", "users"));
            }
            ArticleDAO articleDAO = new ArticleDAO();

            if (articleDAO.DeleteArticle(id))
            {
                return(Json(new
                {
                    MESSAGE = "1"
                }));
            }
            else
            {
                return(Json(new
                {
                    MESSAGE = "0"
                }));
            }
            //return RedirectToAction("Index");
        }