当前位置: 首页>>代码示例>>C#>>正文


C# IDnaDataReader.GetGuid方法代码示例

本文整理汇总了C#中IDnaDataReader.GetGuid方法的典型用法代码示例。如果您正苦于以下问题:C# IDnaDataReader.GetGuid方法的具体用法?C# IDnaDataReader.GetGuid怎么用?C# IDnaDataReader.GetGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDnaDataReader的用法示例。


在下文中一共展示了IDnaDataReader.GetGuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTopicFromReader

        /// <summary>
        /// Gets the topic elements from the current reader.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        static public TopicElement GetTopicFromReader(IDnaDataReader reader)
        {
            var topicEdit = new TopicElement();
            topicEdit.TopicId = reader.GetInt32NullAsZero("topicid");
            topicEdit.H2G2Id = reader.GetInt32NullAsZero("h2g2ID");
            topicEdit.SiteId = reader.GetInt32NullAsZero("SiteID");
            topicEdit.TopicStatus = (TopicStatus)reader.GetInt32NullAsZero("TopicStatus");
            topicEdit.Title = reader.GetStringNullAsEmpty("TITLE");
            topicEdit.ForumId = reader.GetInt32NullAsZero("ForumID");
            topicEdit.Description = reader.GetStringNullAsEmpty("description");
            topicEdit.Position = reader.GetInt32NullAsZero("position");
            topicEdit.TopicLinkId = reader.GetInt32NullAsZero("topiclinkid");
            topicEdit.Createdby = new TopicCreatedDate
              {
                  CreatedDate = new DateElement(reader.GetDateTime("createddate")),
                  Username = reader.GetStringNullAsEmpty("CreatedByUserName"),
                  Userid = reader.GetInt32NullAsZero("CreatedByUserID")
              };

            topicEdit.Updatedby = new TopicLastUpdated()
            {
                LastUpdated = new DateElement(reader.GetDateTime("LastUpdated")),
                Username = reader.GetStringNullAsEmpty("UpdatedByUserName"),
                Userid = reader.GetInt32NullAsZero("UpdatedByUserID")
            };
            topicEdit.Style = reader.GetInt32NullAsZero("style");
            topicEdit.ForumPostCount = reader.GetInt32NullAsZero("forumpostcount");
            topicEdit.FrontPageElement.Elementid = reader.GetInt32NullAsZero("FP_ElementID");
            topicEdit.FrontPageElement.Position = reader.GetInt32NullAsZero("FP_Position");
            topicEdit.FrontPageElement.Title = reader.GetStringNullAsEmpty("FP_Title");
            topicEdit.FrontPageElement.TemplateElement = reader.GetInt32NullAsZero("FP_Template");
            topicEdit.FrontPageElement.Text = reader.GetStringNullAsEmpty("FP_Text");
            topicEdit.FrontPageElement.ImageName = reader.GetStringNullAsEmpty("FP_ImageName");
            topicEdit.FrontPageElement.ImageAltText = reader.GetStringNullAsEmpty("FP_ImageAltText");
            topicEdit.FrontPageElement.ForumPostCount = reader.GetInt32NullAsZero("forumpostcount");
            topicEdit.FrontPageElement.TopicId = reader.GetInt32NullAsZero("topicid");
            
            topicEdit.Fastmod = reader.GetInt32NullAsZero("fastmod");
            topicEdit.Editkey = reader.GetGuid("editkey");
            topicEdit.FrontPageElement.Editkey = reader.GetGuid("FP_EditKey");

            return topicEdit;
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:48,代码来源:TopicElement.cs

示例2: ReadTemplateData

        /// <summary>
        /// Method that reads the datareader and extracts the template and field info
        /// </summary>
        /// <param name="dataReader"></param>
        private void ReadTemplateData(IDnaDataReader dataReader)
        {
            if (dataReader.HasRows)
            {
                //Clear existing field data List ready for new set
                _uiFieldData.Clear();
                if (dataReader.Read())
                {
                    _name = dataReader.GetStringNullAsEmpty("TemplateName");
                    _UITemplateID = dataReader.GetInt32NullAsZero("UITemplateID");
                    _builderGUID = dataReader.GetGuid("BuilderGUID");

                    if (dataReader.NextResult())
                    {
                        while (dataReader.Read())
                        {
                            UIField uiField = new UIField(InputContext);
                            uiField.LoadFieldFromDatabase(dataReader);
                            _uiFieldData.Add(uiField.Name, uiField);
                        }
                    }
                }
            }
            else
            {
                AddErrorXml("ReadTemplateData", "No template data returned, invalid UI Template ID.", null);
                _hasErrors = true;
            }
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:33,代码来源:UITemplate.cs


注:本文中的IDnaDataReader.GetGuid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。