public async Task <ActionResult> UserDetailsByAdhar()
        {
            if (HttpContext.Session.GetString("User") != null)
            {
                PensionDetailApi _api   = new PensionDetailApi();
                PensionerDetails Pd     = new PensionerDetails();
                HttpClient       client = _api.Initial();
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", HttpContext.Session.GetString("token"));
                HttpResponseMessage res = await client.GetAsync($"api/ProcessPension/GetByAadhar?aadaharNo={Convert.ToDouble(HttpContext.Session.GetString("aadhar"))}");

                if (res.IsSuccessStatusCode)
                {
                    var result = res.Content.ReadAsStringAsync().Result;
                    Pd = JsonConvert.DeserializeObject <PensionerDetails>(result);
                    if (Pd != null)
                    {
                        ViewBag.Name = Pd.Name;
                        return(View("ViewAllDetails", Pd));
                    }
                }
                ViewBag.user  = $",{HttpContext.Session.GetString("User").ToUpper()}";
                ViewBag.error = $"Pension details for this {Convert.ToDouble(HttpContext.Session.GetString("aadhar"))} not exist in our system";
                return(View());
            }
            else
            {
                TempData["LoginError"] = "Cannot Go back as User logged out";
                return(RedirectToAction("Index", "Home"));
            }
        }
        public async Task <int> DisburePension(ProcessPensionInput input)
        {
            PensionerDetails    pensioner = new PensionerDetails();
            HttpClient          client    = _pensionDetailApi.Initial();
            HttpResponseMessage res       = await client.GetAsync($"api/PensionerDetailss/{input.AdhaarNumber}");

            if (res.IsSuccessStatusCode)
            {
                var result = res.Content.ReadAsStringAsync().Result;
                pensioner = JsonConvert.DeserializeObject <PensionerDetails>(result);
                double currentAmount = pensioner.Salary;
                if (pensioner.PensionType == "Self")
                {
                    currentAmount = currentAmount * 80 / 100;
                }
                else
                {
                    currentAmount = currentAmount * 50 / 100;
                }
                currentAmount += pensioner.Allowances;
                if (pensioner.BankDetails.BankType == "Public")
                {
                    currentAmount -= 500;
                }
                else
                {
                    currentAmount -= 550;
                }
                if (currentAmount == input.PensionAmount)
                {
                    ProcessPensionStatusCode = 10;
                }
            }
            return(ProcessPensionStatusCode);
        }
        public async Task <ActionResult> AllDetails(AadharEntry AEntry)
        {
            if (HttpContext.Session.GetString("User") != null)
            {
                PensionDetailApi _api   = new PensionDetailApi();
                PensionerDetails Pd     = new PensionerDetails();
                HttpClient       client = _api.Initial();
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", HttpContext.Session.GetString("token"));
                HttpResponseMessage res = await client.GetAsync($"api/ProcessPension/GetByAadhar?aadaharNo={AEntry.AadharNo}");

                if (res.IsSuccessStatusCode)
                {
                    var result = res.Content.ReadAsStringAsync().Result;
                    Pd = JsonConvert.DeserializeObject <PensionerDetails>(result);
                    if (Pd != null)
                    {
                        ViewBag.Name = Pd.Name;
                        return(View("ViewAllDetails", Pd));
                    }
                }
                ModelState.AddModelError("", "Enterd Incorrect Aadhar Number");
                return(View());
            }
            else
            {
                TempData["LoginError"] = "Cannot Go back as User logged out";
                return(RedirectToAction("Index", "Home"));
            }
        }