示例#1
0
        public SCRIANMResponse GetAssociatedANM(int chcId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var associatedANM = _webMasterService.RetrieveAssociatedANMByCHC(chcId);

                _logger.LogInformation($"Received associated ANM master data by chc {associatedANM}");
                return(associatedANM.Count == 0 ?
                       new SCRIANMResponse {
                    Status = "true", Message = "No record found", AssociatedANMDetail = new List <AssociatedSCRIANM>()
                }
                    : new SCRIANMResponse {
                    Status = "true", Message = string.Empty, AssociatedANMDetail = associatedANM
                });
            }
            catch (Exception e)
            {
                _logger.LogError($"Error in receiving associated ANM data by chc {e.StackTrace}");
                return(new SCRIANMResponse {
                    Status = "false", Message = e.Message, AssociatedANMDetail = null
                });
            }
        }