Пример #1
0
        public async Task <List <Policies> > GetPoliciesByNationalId()
        {
            string nationalId = TempData["NationalId"].ToString();
            string yob        = TempData["YOB"].ToString();

            TempData.Keep("YOB");
            TempData.Keep("NationalId");
            var result = new List <Policies>();

            try
            {
                if (nationalId != null && yob != null)
                {
                    var clsInput = new ClsInput();
                    clsInput.code       = "CI";
                    clsInput.nationalID = nationalId;
                    //DateTime date = DateTime.Parse(yob);
                    //DateTime date = Convert.ToDateTime(yob);
                    DateTime dt   = Convert.ToDateTime(yob);
                    int      year = dt.Year;
                    clsInput.yearOfBirth = year.ToString();
                    clsInput.insPolicyNo = "";
                    result = await _policyHandler.GetPoliciesByNationalId(clsInput);
                }
                return(result);
            }
            catch (Exception ex)
            {
                _logger.LogInformation("PolicyController::GetPoliciesByNationalId::" + ex.Message);
            }
            return(result);
        }