public async Task <IActionResult> LastDayEOD(EODViewModel model)
        {
            //Retrieve currnet signed in user
            var user = await _userManager.GetUserAsync(User);

            if (!ModelState.IsValid)
            {
                model.StatusMessage = "Please correct EOD errors in the model";
                return(View(model));
            }

            Result = await _rpService.EOMLastDaySavingsInterest(user.UserName);

            if (Result.Equals("Failed"))
            {
                StatusMessage = "Error: EOM last day savings interest uncompleted";
                return(RedirectToAction(nameof(EOM)));
            }

            Result = await _rpService.EOMLastDayOverdrawn();

            if (Result.Equals("Succeeded"))
            {
                StatusMessage = _config.GetSection("Messages")["Success"];
                return(RedirectToAction(nameof(EOM)));
            }

            StatusMessage = "Error: EOM last day overdrawn account uncompleted";
            return(RedirectToAction(nameof(EOM)));
        }
        public IActionResult EOM()
        {
            var model = new EODViewModel {
                StatusMessage = StatusMessage
            };

            return(View(model));
        }
        public async Task <IActionResult> StartofMonth(EODViewModel model)
        {
            var result = await _rpRepository.StartofMonth(model);

            if (result == "Succeeded")
            {
                return(Ok());
            }
            return(BadRequest(result));
        }
        public string EOD(EODViewModel model)
        {
            string eodModel    = JsonConvert.SerializeObject(model);
            var    contentData = new StringContent(eodModel, System.Text.Encoding.UTF8, "application/json");

            response = client.PostAsync("api.bankmodel/routineprocessing/eod", contentData).Result;

            if (response.IsSuccessStatusCode)
            {
                return("Succeeded");
            }
            return(string.Concat("Failed ", response.ReasonPhrase));
        }
        public IActionResult EOD()
        {
            ViewData["PendingSystemUsers"]    = _rpService.GetPendingSystemUsers();
            ViewData["PendingBranch"]         = _rpService.GetPendingBranch();
            ViewData["PendingChartofAccount"] = _rpService.GetPendingChartofAccount();
            ViewData["PendingProfile"]        = _rpService.GetPendingProfile();
            ViewData["PendingAccount"]        = _rpService.GetPendingAccount();
            ViewData["PendingTransaction"]    = _rpService.GetPendingTransaction();
            ViewData["PendingLoan"]           = _rpService.GetPendingLoan();
            ViewData["PendingLoanRepayment"]  = _rpService.GetPendingLoanRepayment();
            ViewData["PendingFixedDeposit"]   = _rpService.GetPendingFixedDeposit();
            ViewData["PendingSalary"]         = _rpService.GetPendingSalary();
            ViewData["PendingMobileMoney"]    = _rpService.GetPendingMobileMoney();

            var model = new EODViewModel {
                StatusMessage = StatusMessage
            };

            return(View(model));
        }
        public async Task <string> StartofMonth(EODViewModel model)
        {
            var result = await ValidateStartofMonth(model.StartDate);

            if (!result)
            {
                return("Failed");
            }

            string eodModel    = JsonConvert.SerializeObject(model);
            var    contentData = new StringContent(eodModel, System.Text.Encoding.UTF8, "application/json");

            response = client.PostAsync("api.bankmodel/routineprocessing/start-of-month", contentData).Result;

            if (response.IsSuccessStatusCode)
            {
                return("Succeeded");
            }
            return(string.Concat("Failed ", response.ReasonPhrase));
        }
        public async Task <IActionResult> EOMBalanceSheet(EODViewModel model)
        {
            //Retrieve currnet signed in user
            var user = await _userManager.GetUserAsync(User);

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            Result = await _rpService.EOMBalanceSheet();

            if (Result.Equals("Succeeded"))
            {
                StatusMessage = _config.GetSection("Messages")["Success"];
                return(RedirectToAction(nameof(EOM)));
            }

            StatusMessage = "Error: Unable to end day";
            return(RedirectToAction(nameof(EOM)));
        }
        public async Task <IActionResult> EOD(EODViewModel model)
        {
            //Retrieve currnet signed in user
            var user = await _userManager.GetUserAsync(User);

            if (!ModelState.IsValid)
            {
                model.StatusMessage = "Please correct EOD errors in the model";
                return(View(model));
            }

            model.ActionBy = user.UserName;
            Result         = _rpService.EOD(model);
            if (Result.Equals("Succeeded"))
            {
                StatusMessage = _config.GetSection("Messages")["Success"];
                return(RedirectToAction(nameof(EOD)));
            }

            StatusMessage = Result;
            return(RedirectToAction(nameof(EOD)));
        }
 public async Task <string> EOY(EODViewModel model)
 {
     //return await _rpRepository.EOY(model);
     return(string.Empty);
 }