Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        internal IResearchInvestigationEntity iResearchInvestigationIsExists(string InputId, string SrcRecordId, string Duns)
        {
            IResearchInvestigationEntity results;

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "[dnb].[CheckiResearchInvestigated]";
                sproc.StoredProceduresParameter.Add(GetParam("@InputId", InputId, SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@SrcRecordId", SrcRecordId, SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@DUNSNumber", !string.IsNullOrEmpty(Duns) ? Duns : null, SQLServerDatatype.VarcharDataType));
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc);
                if (dt != null && dt.Rows.Count > 0)
                {
                    IResearchInvestigationAdapter ta = new IResearchInvestigationAdapter();
                    results = ta.AdaptItem(dt.Rows[0], dt);
                    return(results);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        internal List <DashboardV2GetInvestigationStatistics> GetDashboardV2GetInvestigationStatistics()
        {
            List <DashboardV2GetInvestigationStatistics> lstStats = new List <DashboardV2GetInvestigationStatistics>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "[dnb].[DashboardV2GetInvestigationStatistics]";
                DataTable dt;
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.ReadWrite.ToString());
                IResearchInvestigationAdapter ta = new IResearchInvestigationAdapter();
                lstStats = ta.AdaptInvestigationStatistics(dt);
            }
            catch (Exception)
            {
                throw;
            }
            return(lstStats);
        }
Ejemplo n.º 5
0
        internal List <iResearchEntityTargetedEntity> GetDnBReferenceDataBycategoryID(int categoryID)
        {
            List <iResearchEntityTargetedEntity> results = new List <iResearchEntityTargetedEntity>();

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.GetDnBReferenceDataBycategoryID";
                sproc.StoredProceduresParameter.Add(GetParam("@categoryID", Convert.ToString(categoryID), SQLServerDatatype.IntDataType));
                DataTable dt = new DataTable();
                dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, "", DBIntent.Read.ToString());
                if (dt != null && dt.Rows.Count > 0)
                {
                    results = new IResearchInvestigationAdapter().AdaptItems(dt);
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(results);
        }