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));
        }
Esempio n. 2
0
        public IActionResult Delete(Bank bank)
        {
            var result = _bankService.Delete(bank);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Esempio n. 3
0
        public IActionResult Delete(string id)
        {
            var entity = _manager.GetByPrimaryKey(id);

            if (entity == null)
            {
                return(NoResult());
            }
            _manager.Delete(entity);
            return(ResponseJson(entity));
        }
Esempio n. 4
0
 public ActionResult Delete(BankViewModel account)
 {
     try
     {
         _service.Delete(account.Id);
         return(RedirectToAction("List"));
     }
     catch (Exception e)
     {
         _log.Error("Error deleting account: ", e);
         throw;
     }
 }
Esempio n. 5
0
        // 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));
        }
Esempio n. 6
0
        //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.");
            }
        }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 8
0
        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());
        }
Esempio n. 9
0
        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;
            }
        }
Esempio n. 11
0
 public static void Delete(string id)
 {
     service.Delete(id, AuthenticationHelper.CompanyId.Value);
 }
Esempio n. 12
0
 public bool Delete([FromBody] Guid bankId)
 {
     return(bankService.Delete(bankId));
 }
Esempio n. 13
0
 public ActionResult Delete(int id)
 {
     _bankService.Delete(id);
     return(new NoContentResult());
 }
Esempio n. 14
0
 public ActionResult Delete(int id)
 {
     SetError(bankService.Delete(id));
     return(RedirectToAction("Index"));
 }
Esempio n. 15
0
        public IActionResult Delete(int id)
        {
            var success = _BankService.Delete(id).Result;

            return(Ok(success));
        }
Esempio n. 16
0
 public ActionResult DeleteConfirmed(Guid id)
 {
     bankService.Delete(id);
     return(RedirectToAction("Index"));
 }