Example #1
0
 public ActionResult Delete(Supplier supplier)
 {
     try
     {
         var aSupplier = _supplier.GetSupplierById(supplier.Code);
         if (aSupplier != null)
         {
             var isDelete = _supplier.Delete(aSupplier);
             if (isDelete)
             {
                 ViewBag.SDeleted = "Delete Success.";
             }
             else
             {
                 ViewBag.NSDelete = "Delete Failed.";
             }
         }
         else
         {
             ViewBag.FMsg = "Supplier not found.";
         }
     }
     catch (Exception exception)
     {
         ViewBag.FMsg = exception.Message;
     }
     return(View());
 }
Example #2
0
 // GET: Items/Delete/5
 public JsonResult Delete(int id)
 {
     status = _supplierBll.Delete(id);
     if (status == true)
     {
         return(Json(1));
     }
     return(Json(0));
 }
        public ActionResult Delete(long id)
        {
            var apiResult = new APIResult();

            try
            {
                SupplierBll.Delete(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }