Beispiel #1
0
        public List <NHMReports> RetrieveParticularNHMReports(NHMRequest nhmData)
        {
            string stProc = NHMReportParticularDetails;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@UserInput", nhmData.userInput),
                new SqlParameter("@DistrictId", nhmData.districtId),
                new SqlParameter("@BlockId", nhmData.blockId),
            };
            var allData = UtilityDL.FillData <NHMReports>(stProc, pList);

            return(allData);
        }
Beispiel #2
0
        public async Task <IActionResult> RetrieveSubjectsForNHMReports(NHMRequest nhmData)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            _logger.LogDebug($"Retrieve subject detail for nhm report- {JsonConvert.SerializeObject(nhmData)}");
            var nhmReports = await _reportsService.RetriveNHMReportsDetail(nhmData);

            _logger.LogInformation($"Fetch Subjects for nhm reports {nhmReports}");
            return(Ok(new NHMReportResponse
            {
                status = nhmReports.status,
                message = nhmReports.message,
                data = nhmReports.data,
            }));
        }
Beispiel #3
0
        public List <NHMReports> RetrieveNHMReports(NHMRequest nhmData)
        {
            string stProc = NHMReport;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@FromDate", nhmData.fromDate),
                new SqlParameter("@ToDate", nhmData.toDate),
                new SqlParameter("@DistrictId", nhmData.districtId),
                new SqlParameter("@BlockId", nhmData.blockId),
                new SqlParameter("@CHCID", nhmData.chcId),
                new SqlParameter("@ANMID", nhmData.anmId)
            };
            var allData = UtilityDL.FillData <NHMReports>(stProc, pList);

            return(allData);
        }
Beispiel #4
0
        public async Task <NHMReportResponse> RetriveNHMReportsDetail(NHMRequest nhmData)
        {
            var tResponse = new NHMReportResponse();

            try
            {
                if (nhmData.searchType == 1)
                {
                    var result = _reportsData.RetrieveNHMReports(nhmData);
                    tResponse.status  = "true";
                    tResponse.message = "";
                    tResponse.data    = result;
                }
                else if (nhmData.searchType == 2)
                {
                    if (string.IsNullOrEmpty(nhmData.userInput))
                    {
                        tResponse.status  = "false";
                        tResponse.message = "Please give some input for search";
                    }
                    else
                    {
                        var result = _reportsData.RetrieveParticularNHMReports(nhmData);
                        tResponse.status  = "true";
                        tResponse.message = "";
                        tResponse.data    = result;
                    }
                }
            }
            catch (Exception e)
            {
                tResponse.status  = "false";
                tResponse.message = e.Message;
            }
            return(tResponse);
        }