Ejemplo n.º 1
0
        public async Task <Response> DeleteBank(int Id)
        {
            Response response = _utilities.InitializeResponse();

            try
            {
                int addedBank = await _bankRepository.DeleteBank(Id);

                if (addedBank > 0)
                {
                    response.Data = "Airport Deleted Successfully";
                }
                if (addedBank < 0)
                {
                    response.Data = "Airport Does not Exist";
                }
                if (addedBank == 0)
                {
                    return(_utilities.UnsuccessfulResponse(response, "Unable to Delete Beneficiary"));
                }
            }
            catch (Exception ex)
            {
                response = _utilities.CatchException(response);
                _logger.LogError($"{ex.Message} REQUEST BODY => REQUEST ID => {response.RequestId}");
            }
            return(response);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage Delete([FromBody] Models.bank oBank, long updated_by)
        {
            try
            {
                //int con_id = int.Parse(country_id);
                bool updatBankbranch = bankRepository.DeleteBank(oBank.bank_id, updated_by);

                if (updatBankbranch)
                {
                    var formatter = RequestFormat.JsonFormaterString();
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        output = "success", msg = "Bank Delete Successfully."
                    }, formatter));
                }
                else
                {
                    var formatter = RequestFormat.JsonFormaterString();
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        output = "error", msg = "Bank can not be delete."
                    }, formatter));
                }
            }
            catch (Exception ex)
            {
                var formatter = RequestFormat.JsonFormaterString();
                return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                    output = "error", msg = ex.ToString()
                }, formatter));
            }
        }
Ejemplo n.º 3
0
        public Response <Bank> DeleteBankAccount(int id)
        {
            var response = new Response <Bank>();

            if (response.Success)
            {
                _repository.DeleteBank(id);
            }

            return(response);
        }
Ejemplo n.º 4
0
        public object DeleteBank(string Code)
        {
            object result = null;

            try
            {
                result = _bankRepository.DeleteBank(Code);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public List <BankModel> DeleteBank(BankModel model)
        {
            List <BankModel> banks = null;

            try
            {
                _bankRepository.DeleteBank(model.Id);
                BaseViewModel baseViewModel = new BaseViewModel();
                baseViewModel.CurrentCulture = model.CurrentCulture;
                baseViewModel.CurrentUserID  = model.CurrentUserID;
                banks = GetAllBankList(baseViewModel);
            }
            catch (Exception ex)
            {
                IErrorLogService errorLog = new ErrorLogService();
                string           message  = ex.InnerException != null ? ex.InnerException.InnerException.Message : ex.Message;
                errorLog.SetErrorLog(model.CurrentUserID, "Bank", message);
                throw new Exception(ex.Message);
            }
            return(banks);
        }
Ejemplo n.º 6
0
 public void DeleteBank(int id)
 {
     _repository.DeleteBank(id);
 }
Ejemplo n.º 7
0
        public Bank DeleteBank(int id)
        {
            var bank = _bankRepository.ReadBank(id);

            return(_bankRepository.DeleteBank(bank));
        }
Ejemplo n.º 8
0
 public int DeleteBank(int bankId)
 {
     return(_ibankRepository.DeleteBank(bankId));
 }
Ejemplo n.º 9
0
 public object DeleteBank(int code)
 {
     return(_bankRepository.DeleteBank(code));
 }