This commit is contained in:
2025-02-06 16:45:47 -05:00
parent 989b722237
commit 29e074ef9d

View File

@@ -33,13 +33,19 @@ namespace MarketData.DataAccess
StringBuilder sb = new StringBuilder();
sb.Append("update securitymaster ");
sb.Append("set ");
if((null!=companyProfile.Sector&&!"".Equals(companyProfile.Sector)) && (null!=companyProfile.Industry&&!"".Equals(companyProfile.Industry)))
if((null!=companyProfile.Sector && !"".Equals(companyProfile.Sector)) && (null != companyProfile.Industry && !"".Equals(companyProfile.Industry)))
{
sb.Append("Sector=").Append(SqlUtils.AddQuotes(companyProfile.Sector)).Append(", ");
sb.Append("Industry=").Append(SqlUtils.AddQuotes(companyProfile.Industry)).Append(" ");
}
else if(null!=companyProfile.Industry&&!"".Equals(companyProfile.Industry))sb.Append("Industry=").Append(SqlUtils.AddQuotes(companyProfile.Industry)).Append(" ");
else if(null!=companyProfile.Sector&&!"".Equals(companyProfile.Industry))sb.Append("Sector=").Append(SqlUtils.AddQuotes(companyProfile.Sector)).Append(" ");
else if(null!=companyProfile.Industry && !"".Equals(companyProfile.Industry))
{
sb.Append("Industry=").Append(SqlUtils.AddQuotes(companyProfile.Industry)).Append(" ");
}
else if(null!=companyProfile.Sector&&!"".Equals(companyProfile.Industry))
{
sb.Append("Sector=").Append(SqlUtils.AddQuotes(companyProfile.Sector)).Append(" ");
}
sb.Append(" where symbol=").Append(SqlUtils.AddQuotes(companyProfile.Symbol));
strQuery = sb.ToString();
sqlCommand = new MySqlCommand(strQuery, sqlConnection, sqlTransaction);