public IActionResult Delete(int id) { if (id <= 0) { return(ResponseModel.Instance.ReturnResult(HttpStatusCode.NotAcceptable, "Id canot be less or equal to 0.")); } _service.Delete(id); return(ResponseModel.Instance.ReturnResult(HttpStatusCode.OK)); }
public IActionResult Delete(Bank bank) { var result = _bankService.Delete(bank); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IActionResult Delete(string id) { var entity = _manager.GetByPrimaryKey(id); if (entity == null) { return(NoResult()); } _manager.Delete(entity); return(ResponseJson(entity)); }
public ActionResult Delete(BankViewModel account) { try { _service.Delete(account.Id); return(RedirectToAction("List")); } catch (Exception e) { _log.Error("Error deleting account: ", e); throw; } }
// POST: /BasicDataManagement/BankAccount/Delete/ public ActionResult Delete() { Bank[] datas = ClassConvert <Bank> .Process(Request.Form); foreach (var data in datas) { var result = _bankService.Delete(data); if (result.ResultType != OperationResultType.Success) { return(Json(new { error = result.ResultType.GetDescription(), total = datas.Length, data = datas })); } } return(Json(new { total = datas.Length, data = datas }, JsonRequestBehavior.AllowGet)); }
//Deletes a bank //Asks for Id, then starts deleting if found public void DeleteBank() { Console.Write("Enter the id of bank to be deleted:"); var userInput = Console.ReadLine(); if (int.TryParse(userInput, out int id) == true) { _bankService.Delete(id); } else { Console.WriteLine("Invalid input, please try again."); } }
public void Delete() { Console.WriteLine("Give the bank's id you want to delete: "); long id = long.Parse(Console.ReadLine()); // expecting the user to input a correct value var banks = _bankService.Read(); var bank = ReturnBankById(banks, id); if (bank != null) { _bankService.Delete(bank); } else { Console.WriteLine("Could not find a bank with id " + id); } }
public async Task <IActionResult> Delete([FromRoute] Guid id) { if (!ModelState.IsValid) { return(BadRequest()); } if (id != Guid.Empty || id == null) { return(BadRequest()); } await _bankService.Delete(id); return(NoContent()); }
public async Task <ActionResult> Delete(Guid id) { try { await _bankService.Delete(id); return(Ok()); } catch (KeyNotFoundException) { return(NotFound()); } catch { return(StatusCode(500)); } }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (CurrentBank == null) { MainWindow.WarningMessage = ((string)Application.Current.FindResource("Morate_odabrati_stavku_za_brisanjeUzvičnik")); return; } // Delete data var result = bankService.Delete(CurrentBank.Identifier); if (result.Success) { MainWindow.SuccessMessage = ((string)Application.Current.FindResource("Podaci_su_uspešno_obrisaniUzvičnik")); Thread displayThread = new Thread(() => SyncData()); displayThread.IsBackground = true; displayThread.Start(); } else { MainWindow.ErrorMessage = result.Message; } }
public static void Delete(string id) { service.Delete(id, AuthenticationHelper.CompanyId.Value); }
public bool Delete([FromBody] Guid bankId) { return(bankService.Delete(bankId)); }
public ActionResult Delete(int id) { _bankService.Delete(id); return(new NoContentResult()); }
public ActionResult Delete(int id) { SetError(bankService.Delete(id)); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { var success = _BankService.Delete(id).Result; return(Ok(success)); }
public ActionResult DeleteConfirmed(Guid id) { bankService.Delete(id); return(RedirectToAction("Index")); }