asked on
#region Paint
string paintCategory = item.GetAttributeValue<string>("uxce_category");
//1
string NarrativePaintColor = item.GetAttributeValue<string>("uxce_paintcolorselectionnarr");
if (!String.IsNullOrEmpty(NarrativePaintColor))
{
//Remove trailing ';'
if (NarrativePaintColor.EndsWith(";"))
{
NarrativePaintColor = NarrativePaintColor.Substring(0, NarrativePaintColor.Length - 1);
}
var results = nb.GeneratePaintNarrativeArray(NarrativePaintColor);
//loop through each array item and apply the narrative code/desc
for (int a = 0; a < results.Length; a++)
{
nb.AddNarrative(results[a][0], "N", results[a][1]);
}
}
//2
string NarrativePaintDesign = item.GetAttributeValue<string>("uxce_paintcolorselectionnarr");
if (!String.IsNullOrEmpty(NarrativePaintDesign))
{
string productdesc = item.GetAttributeValue<string>("productdescription");
string optionCd = item.GetAttributeValue<string>("uxce_salesoption");
if (!String.IsNullOrEmpty(paintCategory) && paintCategory == "Paint Design")
{
if (divisionCode == "K")
{
if (productdesc.Contains("Spectrum"))
{
nb.AddNarrative("1", "P", "SPECTRUM DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "SPECTRUM DESIGN CODE: " + optionCd);
}
else
{
nb.AddNarrative("1", "P", "DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "DESIGN CODE: " + optionCd);
}
}
else if (divisionCode == "P")
{
if (productdesc.Contains("Feature"))
{
nb.AddNarrative("1", "P", "FEATURE DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "FEATURE DESIGN CODE: " + optionCd);
}
else
{
nb.AddNarrative("1", "P", "CUSTOM DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "CUSTOM DESIGN CODE: " + optionCd);
}
}
}
}
//#3
string NarrativePaintSpec = item.GetAttributeValue<string>("uxce_paintspecificationsnarr");
if (!String.IsNullOrEmpty(NarrativePaintSpec))
{
if (NarrativePaintSpec.EndsWith(";"))
{
NarrativePaintSpec = NarrativePaintSpec.Substring(0, NarrativePaintSpec.Length - 1);
}
string[] SpecResults = NarrativePaintSpec.Split(';');
char c1 = 'A';
//loop through each array item and apply the narrative code/desc
for (int a = 0; a < SpecResults.Length; a++)
{
nb.AddNarrative(c1.ToString(), "P", SpecResults[a]);
c1++;
}
}
#endregion
#region Paint
//ERROR ON LINE BELOW
string paintCategory = item.GetAttributeValue<string>("uxce_category");
//1
//ERROR ON LINE BELOW
string NarrativePaintColor = item.GetAttributeValue<string>("uxce_paintcolorselectionnarr");
if (!String.IsNullOrEmpty(NarrativePaintColor))
{
//Remove trailing ';'
if (NarrativePaintColor.EndsWith(";"))
{
NarrativePaintColor = NarrativePaintColor.Substring(0, NarrativePaintColor.Length - 1);
}
var results = nb.GeneratePaintNarrativeArray(NarrativePaintColor);
//loop through each array item and apply the narrative code/desc
for (int a = 0; a < results.Length; a++)
{
nb.AddNarrative(results[a][0], "N", results[a][1]);
}
}
//2
//ERROR ON LINE BELOW
string NarrativePaintDesign = item.GetAttributeValue<string>("uxce_paintcolorselectionnarr");
if (!String.IsNullOrEmpty(NarrativePaintDesign))
{
//ERROR ON LINE BELOW
string productdesc = item.GetAttributeValue<string>("productdescription");
//ERROR ON LINE BELOW
string optionCd = item.GetAttributeValue<string>("uxce_salesoption");
if (!String.IsNullOrEmpty(paintCategory) && paintCategory == "Paint Design")
{
if (divisionCode == "K")
{
if (productdesc.Contains("Spectrum"))
{
nb.AddNarrative("1", "P", "SPECTRUM DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "SPECTRUM DESIGN CODE: " + optionCd);
}
else
{
nb.AddNarrative("1", "P", "DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "DESIGN CODE: " + optionCd);
}
}
else if (divisionCode == "P")
{
if (productdesc.Contains("Feature"))
{
nb.AddNarrative("1", "P", "FEATURE DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "FEATURE DESIGN CODE: " + optionCd);
}
else
{
nb.AddNarrative("1", "P", "CUSTOM DESIGN CODE: " + optionCd);
nb.AddNarrative("2", "P", "CUSTOM DESIGN CODE: " + optionCd);
}
}
}
}
//#3
//ERROR ON LINE BELOW
string NarrativePaintSpec = item.GetAttributeValue<string>("uxce_paintspecificationsnarr");