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


C# City.LoadByPrimaryKey方法代码示例

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


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

示例1: InitOnFirstLoading

 protected override void InitOnFirstLoading()
 {
     base.InitOnFirstLoading();
     if (!IsNew)
     {
         BlogPageCity bpc = (BlogPageCity)this.EditableEntity;
         City c = new City();
         if (c.LoadByPrimaryKey(bpc.CityID))
         {
             ddlCountryChoice.SelectedValue = c.CountryID.ToString();
             choice_CityID.LoadCityDDL(c.CountryID);
             choice_CityID.SelectedValue = bpc.CityID.ToString();
         }
     }
 }
开发者ID:ivladyka,项目名称:OurTravels,代码行数:15,代码来源:BlogPageCityEdit.ascx.cs

示例2: LoadCommonPageData

 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         if (IsCountryPage)
         {
             Country c = new Country();
             if (c.LoadByPrimaryKey(CountryID))
             {
                 m_Title = c.GetColumn("Name" + Utils.LangPrefix).ToString();
                 if (!s.IsColumnNull("TitleSuffix" + Utils.LangPrefix))
                 {
                     m_Title += " - " + s.GetColumn("TitleSuffix" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Keywords" + Utils.LangPrefix))
                 {
                     m_Keywords = c.GetColumn("Keywords" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Description" + Utils.LangPrefix))
                 {
                     m_Description = c.GetColumn("Description" + Utils.LangPrefix).ToString();
                 }
             }
         }
         else if (IsCityPage)
         {
             City c = new City();
             if (c.LoadByPrimaryKey(CityID))
             {
                 m_Title = c.GetColumn("Name" + Utils.LangPrefix).ToString();
                 if (!s.IsColumnNull("TitleSuffix" + Utils.LangPrefix))
                 {
                     m_Title += " - " + s.GetColumn("TitleSuffix" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Keywords" + Utils.LangPrefix))
                 {
                     m_Keywords = c.GetColumn("Keywords" + Utils.LangPrefix).ToString();
                 }
                 if (!c.IsColumnNull("Description" + Utils.LangPrefix))
                 {
                     m_Description = c.GetColumn("Description" + Utils.LangPrefix).ToString();
                 }
             }
         }
         if (m_Title.TrimEnd().Length == 0 && !s.IsColumnNull("Title" + Utils.LangPrefix))
         {
             m_Title = s.GetColumn("Title" + Utils.LangPrefix).ToString();
         }
         if (m_Keywords.TrimEnd().Length == 0 && !s.IsColumnNull("Keywords" + Utils.LangPrefix))
         {
             m_Keywords = s.GetColumn("Keywords" + Utils.LangPrefix).ToString();
         }
         if (m_Description.TrimEnd().Length == 0 && !s.IsColumnNull("Description" + Utils.LangPrefix))
         {
             m_Description = s.GetColumn("Description" + Utils.LangPrefix).ToString();
         }
     }
 }
开发者ID:ivladyka,项目名称:YourTravel,代码行数:59,代码来源:DefaultMP.master.cs

示例3: LoadCommonPageData

 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         if (IsCountryPage)
         {
             Country c = new Country();
             if (c.LoadByPrimaryKey(CountryID))
             {
                 m_Title = c.GetColumn(Country.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!c.IsColumnNull(Country.ColumnNames.Keywords))
                 {
                     m_Keywords = c.GetColumn(Country.ColumnNames.Keywords).ToString();
                 }
                 if (!c.IsColumnNull(Country.ColumnNames.Description))
                 {
                     m_Description = c.GetColumn(Country.ColumnNames.Description).ToString();
                 }
             }
         }
         else if (IsCityPage)
         {
             City c = new City();
             if (c.LoadByPrimaryKey(CityID))
             {
                 m_Title = c.GetColumn(City.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!c.IsColumnNull(City.ColumnNames.Keywords))
                 {
                     m_Keywords = c.GetColumn(City.ColumnNames.Keywords).ToString();
                 }
                 if (!c.IsColumnNull(City.ColumnNames.Description))
                 {
                     m_Description = c.GetColumn(City.ColumnNames.Description).ToString();
                 }
             }
         }
         else if (IsBlogPagePage)
         {
             BlogPage bp = new BlogPage();
             if (bp.LoadByPrimaryKey(BlogPageID))
             {
                 m_Title = bp.GetColumn(BlogPage.ColumnNames.Name).ToString();
                 if (!s.IsColumnNull(Settings.ColumnNames.TitleSuffix))
                 {
                     m_Title += " - " + s.GetColumn(Settings.ColumnNames.TitleSuffix).ToString();
                 }
                 if (!bp.IsColumnNull(BlogPage.ColumnNames.Keywords))
                 {
                     m_Keywords = bp.GetColumn(BlogPage.ColumnNames.Keywords).ToString();
                 }
                 if (!bp.IsColumnNull(BlogPage.ColumnNames.Description))
                 {
                     m_Description = bp.GetColumn(BlogPage.ColumnNames.Description).ToString();
                 }
             }
         }
         if (m_Title.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Title))
         {
             m_Title = s.GetColumn(Settings.ColumnNames.Title).ToString();
         }
         if (m_Keywords.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Keywords))
         {
             m_Keywords = s.GetColumn(Settings.ColumnNames.Keywords).ToString();
         }
         if (m_Description.TrimEnd().Length == 0 && !s.IsColumnNull(Settings.ColumnNames.Description))
         {
             m_Description = s.GetColumn(Settings.ColumnNames.Description).ToString();
         }
     }
 }
开发者ID:ivladyka,项目名称:OurTravels,代码行数:79,代码来源:DefaultMP.master.cs


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