internal List <IResearchInvestigationEntity> GetFilterIResearchInvestigation(string SrcRecordId, string Status, string RequestStartDateTime, string RequestendDateTime, string Keyword) { List <IResearchInvestigationEntity> results = new List <IResearchInvestigationEntity>(); List <IResearchInvestigationEntity> resultsFailed = new List <IResearchInvestigationEntity>(); try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "dnb.GetiResearchInvestigation"; sproc.StoredProceduresParameter.Add(GetParam("@SrcRecordId", !string.IsNullOrEmpty(SrcRecordId) ? SrcRecordId : null, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@CaseStatus", !string.IsNullOrEmpty(Status) ? Status : null, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@RequestStartDateTime", !string.IsNullOrEmpty(RequestStartDateTime) ? RequestStartDateTime : null, SQLServerDatatype.DateTimeDataType)); sproc.StoredProceduresParameter.Add(GetParam("@RequestendDateTime", !string.IsNullOrEmpty(RequestendDateTime) ? Convert.ToDateTime(RequestendDateTime).Add(DateTime.MaxValue.TimeOfDay).ToString() : null, SQLServerDatatype.DateTimeDataType)); sproc.StoredProceduresParameter.Add(GetParam("@SearchKeyword", !string.IsNullOrEmpty(Keyword) ? Keyword.Trim() : null, SQLServerDatatype.NvarcharDataType)); DataSet ds; ds = sql.ExecuteDataSet(CommandType.StoredProcedure, sproc); if (ds != null) { IResearchInvestigationAdapter ta = new IResearchInvestigationAdapter(); if (ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { foreach (DataRow rw in ds.Tables[0].Rows) { results = ta.Adapt(ds.Tables[0]); } } if (ds.Tables.Count > 1 && ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) { foreach (DataRow rw in ds.Tables[1].Rows) { resultsFailed = ta.Adapt(ds.Tables[1]); } if (!string.IsNullOrEmpty(SrcRecordId)) { resultsFailed = resultsFailed.Where(x => x.RequestBodylst.customerTransactionID.ToLower() == SrcRecordId.ToLower()).ToList(); } resultsFailed.ForEach(x => { x.SrcRecordId = x.RequestBodylst.customerTransactionID; x.RequestType = x.RequestBodylst.researchRequestType; if (x.RequestBodylst.researchRequestType.ToLower() == "targeted") { x.ResolutionDUNS = x.RequestBodylst?.organization?.duns; } }); results.AddRange(resultsFailed); } } } catch (Exception) { throw; } return(results); }
internal List <IResearchInvestigationEntity> GetIResearchInvestigation() { List <IResearchInvestigationEntity> results = new List <IResearchInvestigationEntity>(); try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "dnb.GetiResearchInvestigation"; DataTable dt; dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString()); if (dt != null && dt.Rows.Count > 0) { IResearchInvestigationAdapter ta = new IResearchInvestigationAdapter(); foreach (DataRow rw in dt.Rows) { results = ta.Adapt(dt); } } } catch (Exception) { throw; } return(results); }