// DELETE api/product/id
        public IHttpActionResult Delete(Product product)
        {
            var productoManager = new ProductManagement();

            productoManager.Delete(product);
            apiResponse = new ApiResponse();
            return(Ok(apiResponse));
        }
        public void WhenProductIsDeletedPermissionShouldBeDelete()
        {
            var authorizer     = new MockAuthorizer();
            var productManager = new ProductManagement(authorizer);
            var product        = new Product();

            productManager.Delete(product);

            authorizer.PermissionRequiredInput.Should().Be(Permission.ProductDelete);
        }
        //Deletes component from database
        private void btnDeleteProduct_Click(object sender, EventArgs e)
        {
            BusinessLayer.Component comp = (BusinessLayer.Component)cbProductName_Delete.SelectedItem;
            //WATCH STORED PROCEDURE RELATIONSHIP ORDER!!!
            management.Delete(comp.ID);

            RefreshAll();

            MessageBox.Show($"{comp.Name} successfully deleted", "Success", MessageBoxButtons.OK, MessageBoxIcon.None);
        }
Пример #4
0
        public IHttpActionResult Delete(int id)
        {
            if (id <= 0)
            {
                return(BadRequest("Not a valid collection id"));
            }
            bool deleted = _pm.Delete(id);

            if (deleted)
            {
                return(Ok(id));
            }
            else
            {
                return(BadRequest("This content collection does not exist"));
            }
        }
 public ActionResult Delete(int id)
 {
     ProductManagement.Delete(id);
     return(RedirectToAction("Index"));
 }