internal ThirdPartyEnrichmentsEntity GetThirdPartyEnrichmentsByEnrichmentId(int enrichId) { ThirdPartyEnrichmentsEntity thirdPartyEnrichments = new ThirdPartyEnrichmentsEntity(); try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "dnb.GetThirdPartyEnrichmentsByEnrichmentId"; sproc.StoredProceduresParameter.Add(GetParam("@EnrichmentId", enrichId.ToString(), SQLServerDatatype.IntDataType)); DataTable dt; dt = sql.ExecuteDataTable(CommandType.StoredProcedure, sproc, ""); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { thirdPartyEnrichments = CommonConvertMethods.GetItem <ThirdPartyEnrichmentsEntity>(dr); } } return(thirdPartyEnrichments); } catch (Exception) { throw; } }
public ActionResult UpsertThirdPartyEnrichments(string Parameters) { ThirdPartyEnrichmentsEntity thirdPartyEnrichments = new ThirdPartyEnrichmentsEntity(); int enrichId = 0; if (!string.IsNullOrEmpty(Parameters) && Parameters != "null") { enrichId = Convert.ToInt32(StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase)); } ThirdPartyEnrichmentsFacade fac = new ThirdPartyEnrichmentsFacade(this.CurrentClient.ApplicationDBConnectionString); if (enrichId > 0) { thirdPartyEnrichments = fac.GetThirdPartyEnrichmentsByEnrichmentId(enrichId); } return(PartialView(thirdPartyEnrichments)); }
public ActionResult UpsertThirdPartyEnrichments(ThirdPartyEnrichmentsEntity enrichmentsEntity) { try { ThirdPartyEnrichmentsFacade fac = new ThirdPartyEnrichmentsFacade(this.CurrentClient.ApplicationDBConnectionString); enrichmentsEntity.EnrichmentURL = ConfigurationManager.AppSettings[enrichmentsEntity.ThirdPartyProvider].ToString() + enrichmentsEntity.EnrichmentFields; fac.UpsertThirdPartyEnrichments(enrichmentsEntity, Helper.oUser.UserId); if (enrichmentsEntity.EnrichmentId > 0) { return(Json(new { result = true, message = CommonMessagesLang.msgCommanUpdateMessage }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { result = true, message = CommonMessagesLang.msgCommanInsertMessage }, JsonRequestBehavior.AllowGet)); } } catch (Exception) { return(Json(new { result = false, message = CommonMessagesLang.msgCommanErrorMessage }, JsonRequestBehavior.AllowGet)); } }
internal void UpsertThirdPartyEnrichments(ThirdPartyEnrichmentsEntity obj, int UserId) { try { StoredProcedureEntity sproc = new StoredProcedureEntity(); sproc.StoredProcedureName = "dnb.UpsertThirdPartyEnrichments"; sproc.StoredProceduresParameter.Add(GetParam("@EnrichmentId", obj.EnrichmentId.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@CredentialId", obj.CredentialId.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@EnrichmentDescription", obj.EnrichmentDescription, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@EnrichmentURL", obj.EnrichmentURL.ToString(), SQLServerDatatype.NvarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@Tags", !string.IsNullOrEmpty(obj.Tags) ? obj.Tags : null, SQLServerDatatype.VarcharDataType)); sproc.StoredProceduresParameter.Add(GetParam("@CountryGroupId", obj.CountryGroupId > 0 ? obj.CountryGroupId.ToString() : null, SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@EnablePeriodicRefresh", obj.EnablePeriodicRefresh.ToString(), SQLServerDatatype.BitDataType)); sproc.StoredProceduresParameter.Add(GetParam("@PeriodicRefreshIntervalDays", obj.PeriodicRefreshIntervalDays.ToString(), SQLServerDatatype.IntDataType)); sproc.StoredProceduresParameter.Add(GetParam("@UserId", Convert.ToString(UserId), SQLServerDatatype.IntDataType)); sql.ExecuteScalar(CommandType.StoredProcedure, sproc); } catch (Exception) { throw; } }
public void UpsertThirdPartyEnrichments(ThirdPartyEnrichmentsEntity obj, int UserId) { rep.UpsertThirdPartyEnrichments(obj, UserId); }