コード例 #1
0
 public ActionResult DeleteSupplier(int id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     if (supplier.DeleteSupplier(id) == false)
     {
         return(HttpNotFound());
     }
     supplier.DeleteSupplier(id);
     return(RedirectToAction("Index"));
 }
コード例 #2
0
        public JsonResult Delete(SupplierActionModel model)
        {
            JsonResult json = new JsonResult();

            var result = false;

            var supplier = services.GetSupplierByID(model.SupplierID);

            result = services.DeleteSupplier(supplier);

            if (result)
            {
                json.Data = new { Success = true };
            }
            else
            {
                json.Data = new { Success = false, Message = "Unable to perform any action" };
            }

            return(json);
        }