本文整理汇总了C#中IDnaDataReader.GetAmpersandEscapedStringNullAsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# IDnaDataReader.GetAmpersandEscapedStringNullAsEmpty方法的具体用法?C# IDnaDataReader.GetAmpersandEscapedStringNullAsEmpty怎么用?C# IDnaDataReader.GetAmpersandEscapedStringNullAsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDnaDataReader
的用法示例。
在下文中一共展示了IDnaDataReader.GetAmpersandEscapedStringNullAsEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateArticleSearchXml
//.........这里部分代码省略.........
articleKeyPhrases.Add(h2g2ID, phraselist);
dataReader.NextResult();
if (dataReader.Read())
{
total = dataReader.GetInt32NullAsZero("TOTAL");
//The stored procedure returns one row for each article. The article's keyphrases have been stored in articleKeyPhrases.
XmlNode article = CreateElementNode("ARTICLE");
do
{
count++;
h2g2ID = dataReader.GetInt32NullAsZero("H2G2ID");
//Start filling new article xml
AddAttribute(article, "H2G2ID", h2g2ID);
int editorID = dataReader.GetInt32NullAsZero("editor");
XmlNode editor = CreateElementNode("EDITOR");
User user = new User(InputContext);
user.AddUserXMLBlock(dataReader, editorID, editor);
article.AppendChild(editor);
AddTextTag(article, "STATUS", dataReader.GetInt32NullAsZero("status"));
AddXmlTextTag(article, "SUBJECT", dataReader.GetStringNullAsEmpty("SUBJECT"));
AddTextTag(article, "TYPE", dataReader.GetInt32NullAsZero("type"));
AddDateXml(dataReader, article, "DateCreated", "DATECREATED");
AddDateXml(dataReader, article, "LastUpdated", "LASTUPDATED");
//Add Extra Info XML where it exists.
string extraInfo = dataReader.GetAmpersandEscapedStringNullAsEmpty("EXTRAINFO");
if (extraInfo != string.Empty)
{
XmlDocument extraInfoXml = new XmlDocument();
extraInfoXml.LoadXml(extraInfo);
article.AppendChild(ImportNode(extraInfoXml.FirstChild));
}
AddTextTag(article, "NUMBEROFPOSTS", dataReader.GetInt32NullAsZero("ForumPostCount"));
AddDateXml(dataReader, article, "LASTPOSTED", "FORUMLASTPOSTED");
if (!dataReader.IsDBNull("StartDate"))
{
AddDateXml(dataReader, article, "StartDate", "DATERANGESTART");
// Take a day from the end date as stored in the database for UI purposes.
// E.g. User submits a date range of 01/09/1980 to 02/09/1980. They mean for this to represent 2 days i.e. 01/09/1980 00:00 - 03/09/1980 00:00.
// This gets stored in the database but for display purposes we subtract a day from the database end date to return the
// original dates submitted by the user inorder to match their expectations.
AddDateXml(dataReader.GetDateTime("EndDate").AddDays(-1), article, "DATERANGEEND");
AddTextTag(article, "TIMEINTERVAL", dataReader.GetInt32NullAsZero("TimeInterval"));
}
if (dataReader.DoesFieldExist("BookmarkCount"))
{
AddTextTag(article, "BOOKMARKCOUNT", dataReader.GetInt32NullAsZero("BookmarkCount"));
}
if (dataReader.DoesFieldExist("ZeitgeistScore"))
{
AddElement(article, "ZEITGEIST", "<SCORE>" + dataReader.GetDoubleNullAsZero("ZeitgeistScore") + "</SCORE>");
示例2: CreateList
//.........这里部分代码省略.........
{
AddTextTag(article, "SUBJECT", dataReader.GetStringNullAsEmpty("Subject"));
}
if (dataReader.DoesFieldExist("DateCreated"))
{
AddDateXml(dataReader, article, "DateCreated", "DATE-CREATED");
}
if (dataReader.DoesFieldExist("LastUpdated"))
{
AddDateXml(dataReader, article, "LastUpdated", "LASTUPDATED");
}
if (dataReader.DoesFieldExist("DateRecommended"))
{
AddDateXml(dataReader, article, "DateRecommended", "DATE-RECOMMENDED");
}
if (dataReader.DoesFieldExist("DecisionDate"))
{
AddDateXml(dataReader, article, "DecisionDate", "RECOMMENDATION-DECISION-DATE");
}
if (dataReader.DoesFieldExist("DateAllocated"))
{
AddDateXml(dataReader, article, "DateAllocated", "DATE-ALLOCATED");
}
if (dataReader.DoesFieldExist("DateReturned"))
{
AddDateXml(dataReader, article, "DateReturned", "DATE-RETURNED");
}
//TODO add Extra Info correctly
if (dataReader.DoesFieldExist("ExtraInfo"))
{
//Add Extra Info XML where it exists.
string extraInfo = dataReader.GetAmpersandEscapedStringNullAsEmpty("ExtraInfo");
if (extraInfo != string.Empty)
{
XmlDocument extraInfoXml = new XmlDocument();
extraInfoXml.LoadXml(extraInfo);
article.AppendChild(ImportNode(extraInfoXml.FirstChild));
}
//TODO Use Extra Info Class will need to change SP to get out the guide entry Type
//ExtraInfo extraInfo = new ExtraInfo();
//extraInfo.TryCreate(dataReader.GetInt32NullAsZero("Type"), dataReader.GetStringNullAsEmpty("ExtraInfo"));
//AddInside(article, extraInfo);
}
if (dataReader.DoesFieldExist("ForumPostCount"))
{
AddIntElement(article, "FORUMPOSTCOUNT", dataReader.GetInt32NullAsZero("ForumPostCount"));
AddIntElement(article, "FORUMPOSTLIMIT", InputContext.GetSiteOptionValueInt("Forum", "PostLimit"));
}
if (dataReader.DoesFieldExist("StartDate") && !dataReader.IsDBNull("StartDate"))
{
AddDateXml(dataReader, article, "StartDate", "DATERANGESTART");
}
// Take a day from the end date as stored in the database for UI purposes.
// E.g. User submits a date range of 01/09/1980 to 02/09/1980. They mean for this to represent 2 days i.e. 01/09/1980 00:00 - 03/09/1980 00:00.
// This gets stored in the database but for display purposes we subtract a day from the database end date to return the
// original dates submitted by the user inorder to match their expectations.
if (dataReader.DoesFieldExist("EndDate") && !dataReader.IsDBNull("EndDate"))
{
AddDateXml(dataReader.GetDateTime("EndDate").AddDays(-1), article, "DATERANGEEND");
}