private void DeleteSupplier(object sender, EventArgs e) { if (YesNoDialog() != DialogResult.Yes) { return; } try { if (_supplierServices.DeleteSupplier(Mapper.Map <SupplierModel>(_currentSupplier)) != 0) { LoadSuppliers(); _currentSupplier = null; SuccessMessage(); ClearForm(); } else { LoadSuppliers(); ErrorMessage(); } } catch (Exception ex) { _logger.Error(ex.Message); ErrorMessage(); } }
public HttpResponseMessage DeleteSupplier(int storeId, int LoggedInUserId, int SupplierID) { try { var result = _SupplierServices.DeleteSupplier(storeId, LoggedInUserId, SupplierID); return(Request.CreateResponse(HttpStatusCode.OK, result)); } catch (Exception) { throw; } }
public ActionResult SupplierDelete(long id) { _supplierServices.DeleteSupplier(id); return(RedirectToAction("Index", new { id = 0 })); }