public HttpStatusCode Delete(int Id)
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            ProductDA.DeleteProduct(Id, p.Claims);
            return(HttpStatusCode.OK);
        }
Ejemplo n.º 2
0
 public HttpResponseMessage Delete(int id)
 {
     try
     {
         ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;
         ProductDA.DeleteProduct(id, p.Claims);
         return(new HttpResponseMessage(HttpStatusCode.OK));
     }
     catch
     {
         return(new HttpResponseMessage(HttpStatusCode.InternalServerError));
     }
 }
Ejemplo n.º 3
0
        public IActionResult DeleteProduct(int id)
        {
            var res = _pro.DeleteProduct(id);

            if (res)
            {
                return(Ok(new { message = "Product deleted successfully" }));
            }
            else
            {
                return(BadRequest(new { message = "Error, can't delete product" }));
            }
        }
Ejemplo n.º 4
0
        public Boolean DeleteProduct(long id)           //to soft delete product
        {
            var model = obj.GetProduct(id);

            if (model != null)
            {
                model.ProductStatus = "Deleted";
                if (obj.DeleteProduct(model))
                {
                    return(true);
                }
                return(false);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        public ActionResult DeleteProduct(int id)
        {
            var result = _productDa.DeleteProduct(id);

            if (result > 0)
            {
                return(Json(new
                {
                    Status = true,
                    Message = "Xóa thành công"
                }));
            }
            return(Json(new
            {
                Status = false,
                Message = "Xóa thất bại"
            }));
        }
Ejemplo n.º 6
0
 public void Delete(int id)
 {
     da.DeleteProduct(id);
 }
Ejemplo n.º 7
0
        // DELETE: api/product/5
        public int Delete(int id)
        {
            ClaimsPrincipal p = RequestContext.Principal as ClaimsPrincipal;

            return(ProductDA.DeleteProduct(id, p.Claims));
        }