Пример #1
0
        public ResponseModel ReportSearch([FromBody] ReportSearchModel searchparams)
        {
            List <SearchResponseReport> searchResult = null;
            ResponseModel  objResponseModel          = new ResponseModel();
            int            statusCode     = 0;
            string         statusMessage  = "";
            int            resultCount    = 0;
            SettingsCaller dbSearchMaster = new SettingsCaller();

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();

                var temp = SecurityService.DecryptStringAES(token);
                authenticate              = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token));
                searchparams.TenantID     = authenticate.TenantId;     // add tenantID to request
                searchparams.curentUserId = authenticate.UserMasterID; // add currentUserID to request


                //searchparams.TenantID = 1; // add tenantID to request
                //searchparams.curentUserId = 9; // add currentUserID to request
                resultCount = dbSearchMaster.GetReportSearch(new ReportService(Cache, Db), searchparams);

                statusCode                    = resultCount > 0 ? (int)EnumMaster.StatusCode.Success : (int)EnumMaster.StatusCode.RecordNotFound;
                statusMessage                 = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode);
                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = statusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = resultCount;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }