Skip to content

Instantly share code, notes, and snippets.

@codyherring
Last active December 26, 2015 03:59
Show Gist options
  • Save codyherring/7089645 to your computer and use it in GitHub Desktop.
Save codyherring/7089645 to your computer and use it in GitHub Desktop.
// Data Rows Below Header Row
switch(dr["TransactionType"].ToString())
{
case "OutgoingFeed":
if(!(bool)ColumnIsNull["FeedFileLocation"])
sb.AppendFormat(DATAFormat, "Feed:",
BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "FeedFile"));
if(!(bool) ColumnIsNull["MarketplaceURL"])
sb.Append(GetDeliveryURL(DATAFormat, dr));
if(!(bool)ColumnIsNull["MarketplaceTransactionID"])
sb.AppendFormat(DATAFormat, "Transaction ID:", dr["MarketplaceTransactionID"]);
if(!(bool)ColumnIsNull["MarketplaceDocumentID"])
sb.AppendFormat(DATAFormat, "Document ID:", dr["MarketplaceDocumentID"].ToString());
if(!(bool)ColumnIsNull["NumberOfItems"])
sb.AppendFormat(DATAFormat, "Items:", dr["NumberOfItems"]);
if(!(bool)ColumnIsNull["ProcessingReportFileLocation"])
sb.AppendFormat(DATAFormat, "Processing Report:",
BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "processingReport",
dr["ProcessingReportFileLocation"].ToString(), "ProcessingReport"));
if(!(bool)ColumnIsNull["MessageProcessed"])
sb.AppendFormat(DATAFormat, "Items Processed:", dr["MessageProcessed"]);
if(!(bool)ColumnIsNull["MessageSuccessful"])
sb.AppendFormat(DATAColoredFormat, "Items Successful:", dr["MessageSuccessful"], ((int)dr["MessageSuccessful"] == 0 ? "#CC3333" : "#000000"));
if(!(bool)ColumnIsNull["MessageError"])
sb.AppendFormat(DATAColoredFormat, "Items with Errors:", dr["MessageError"], ((int)dr["MessageError"] > 0 ? "#CC3333" : "#000000"));
if(!(bool)ColumnIsNull["MessageWarning"])
sb.AppendFormat(DATAColoredFormat, "Items with Warnings:", dr["MessageWarning"], ((int)dr["MessageWarning"] > 0 ? "#CC3333" : "#000000"));
break;
case "IncomingFeed":
if(!(bool)ColumnIsNull["FeedFileLocation"])
sb.AppendFormat(DATAFormat, "Feed Location:",
BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "FeedFile"));
if(!(bool)ColumnIsNull["FeedFileLocation"] && dr["FeedType"].ToString() == "SettlementReport")
{
sb.AppendFormat(DATASummaryDetailFormat
, "Download:"
, BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "SettlementReportSummary", "Summary")
, BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "SettlementReportDetail", "Detail")
);
}
if(!(bool)ColumnIsNull["MarketplaceURL"])
sb.AppendFormat(DATAFormat, "From URL:", Server.HtmlEncode(dr["MarketplaceURL"].ToString()));
if(!(bool)ColumnIsNull["MarketplaceDocumentID"])
sb.AppendFormat(DATAFormat, "Document ID:", dr["MarketplaceDocumentID"].ToString());
if(dr["FeedType"].ToString() != "SettlementReport"
&& dr["FeedType"].ToString() != "ProductAd"
&& dr["FeedType"].ToString() != "DownloadSync"
&& dr["FeedType"].ToString() != "UploadSync"
&& dr["FeedType"].ToString() != "PerformanceReport")
if(!(bool)ColumnIsNull["NumberOfItems"])
if(dr["FeedType"].ToString() == "ItemLookup")
{
sb.AppendFormat(DATAFormat, "Items Received:", dr["NumberOfItems"]);
if(!(bool)ColumnIsNull["MessageSuccessful"])
sb.AppendFormat(DATAColoredFormat, "Items Successful:", dr["MessageSuccessful"], ((int)dr["MessageSuccessful"] == 0 ? "#CC3333" : "#000000"));
if(!(bool)ColumnIsNull["MessageError"])
sb.AppendFormat(DATAColoredFormat, "Items with Errors:", dr["MessageError"], ((int)dr["MessageError"] > 0 ? "#CC3333" : "#000000"));
if(!(bool)ColumnIsNull["MessageWarning"])
sb.AppendFormat(DATAColoredFormat, "Items with Warnings:", dr["MessageWarning"], ((int)dr["MessageWarning"] > 0 ? "#CC3333" : "#000000"));
}
else if(dr["FeedType"].ToString() == "DataQualityReport")
{
sb.AppendFormat(DATAFormat,
"Data Quality Report:",
BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "GoogleBase_DataQualityReport", "View Report", true)
);
sb.AppendFormat(DATAFormat, "Products with Quality Issues:", dr["NumberOfItems"]);
}
else
sb.AppendFormat(DATAFormat, "Orders Received:", dr["NumberOfItems"]);
break;
case "CheckForReports":
if(!(bool)ColumnIsNull["NumberOfItems"])
sb.AppendFormat(DATAFormat, "Number of Reports:", dr["NumberOfItems"]);
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment