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


C# Category.LoadByPrimaryKey方法代码示例

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


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

示例1: LoadTitle

 private void LoadTitle()
 {
     Category c = new Category();
     if (c.LoadByPrimaryKey(CategoryID))
     {
         this.m_Name = c.GetColumn("Name" + Utils.LangPrefix).ToString(); ;
         lblTitle.Text = this.m_Name;
     }
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:9,代码来源:GalleryPhotoView.ascx.cs

示例2: btnSaveSEO_Click

 protected void btnSaveSEO_Click(object sender, EventArgs e)
 {
     Category cat = new Category();
     if (cat.LoadByPrimaryKey(CategoryID))
     {
         cat.s_Keywords = tbKeywords.Text;
         cat.s_Keywords_pl = tbKeywords_pl.Text;
         cat.s_Keywords_en = tbKeywords_en.Text;
         cat.s_Description = tbDescription.Text;
         cat.s_Description_pl = tbDescription_pl.Text;
         cat.s_Description_en = tbDescription_en.Text;
         cat.Save();
     }
     RedirectBackToList();
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:15,代码来源:CategoryEdit.ascx.cs

示例3: LoadTitle

 private void LoadTitle()
 {
     Category c = new Category();
     if (c.LoadByPrimaryKey(CategoryID))
     {
         string title = "";
         if (!c.IsColumnNull("Title" + Utils.LangPrefix))
         {
             title = c.GetColumn("Title" + Utils.LangPrefix).ToString();
         }
         if (title.Trim() == "")
         {
             title = c.GetColumn("Name" + Utils.LangPrefix).ToString();
         }
         this.m_Name = title;
     }
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:17,代码来源:GalleryTableView.ascx.cs

示例4: LoadCommonPageData

 private void LoadCommonPageData()
 {
     Settings s = new Settings();
     if (s.LoadByPrimaryKey(1))
     {
         Category c = new Category();
         if (c.LoadByPrimaryKey(CategoryID))
         {
             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_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();
         }
         if (m_Keywords.TrimEnd().Length == 0)
         {
             m_Keywords = Resources.Vikkisoft.MetaKeywords;
         }
         if (m_Description.TrimEnd().Length == 0)
         {
             m_Description = Resources.Vikkisoft.MetaDescription;
         }
     }
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:35,代码来源:DefaultMP.master.cs

示例5: LoadSEO

 private void LoadSEO()
 {
     Category cat = new Category();
     if(cat.LoadByPrimaryKey(CategoryID))
     {
         tbKeywords.Text = cat.s_Keywords;
         tbKeywords_pl.Text = cat.s_Keywords_pl;
         tbKeywords_en.Text = cat.s_Keywords_en;
         tbDescription.Text = cat.s_Description;
         tbDescription_pl.Text = cat.s_Description_pl;
         tbDescription_en.Text = cat.s_Description_en;
     }
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:13,代码来源:CategoryEdit.ascx.cs

示例6: GenerateFriendlyURL

 public static string GenerateFriendlyURL(int id)
 {
     Category cat = new Category();
     if(cat.LoadByPrimaryKey(id))
     {
         return GenerateFriendlyURL(cat.s_Name_en, id.ToString());
     }
     return "Default.aspx";
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:9,代码来源:Utils.cs

示例7: ShowChildCategories

 private void ShowChildCategories()
 {
     if (CategoryID > 1)
     {
         Menu menu = ((MasterPageBase)Page.Master).TopMenuControl;
         foreach (MenuItem item in menu.Items)
         {
             if (item.NavigateUrl.IndexOf("/hotel-" + CategoryID + "/") >= 0
                 || item.NavigateUrl.IndexOf("&CategoryID=" + CategoryID) >= 0)
             {
                 if (item.ChildItems.Count > 0)
                 {
                     pnlChildCategories.Visible = true;
                     foreach (MenuItem childItem in item.ChildItems)
                     {
                         int childCategoryID = int.Parse(childItem.Value);
                         Gallery g = new Gallery();
                         if (g.LoadCoverByCategoryID(childCategoryID))
                         {
                             if (g.s_PhotoName.Length > 0)
                             {
                                 HtmlGenericControl li = new HtmlGenericControl("li");
                                 HtmlGenericControl divTitle = new HtmlGenericControl("div");
                                 divTitle.Attributes["class"] = "subpagetitle";
                                 HtmlGenericControl h4 = new HtmlGenericControl("h4");
                                 Category c = new Category();
                                 if (c.LoadByPrimaryKey(childCategoryID))
                                 {
                                     h4.InnerHtml = c.GetColumn("Name" + Utils.LangPrefix).ToString(); ;
                                 }
                                 divTitle.Controls.Add(h4);
                                 HyperLink hl = new HyperLink();
                                 hl.NavigateUrl = childItem.NavigateUrl;
                                 System.Web.UI.WebControls.Image image = new System.Web.UI.WebControls.Image();
                                 if (item.ChildItems.Count == 4)
                                 {
                                     image.Width = Unit.Pixel(180);
                                 }
                                 else
                                 {
                                     image.Width = Unit.Pixel(180);
                                 }
                                 image.ImageUrl = Path.Combine(Utils.GaleryImagePath, g.s_PhotoName.Substring(0, g.s_PhotoName.ToString().Length - 4) + "_s.jpg");
                                 hl.Controls.Add(image);
                                 hl.Controls.Add(divTitle);
                                 li.Controls.Add(hl);
                                 /*if (g.GetColumn("PriceRange").ToString().Length > 0)
                                 {
                                     HtmlGenericControl div = new HtmlGenericControl("div");
                                     div.InnerHtml = g.GetColumn("PriceRange").ToString() + " " + Resources.Vikkisoft.Grn;
                                     if (item.ChildItems.Count == 4)
                                     {
                                         div.Style["width"] = "150px";
                                         div.Style["padding"] = "0";
                                         div.Style["margin"] = "0";
                                     }
                                     li.Controls.Add(div);
                                 }*/
                                 ulChildCategories.Controls.Add(li);
                             }
                         }
                     }
                 }
                 return;
             }
         }
     }
 }
开发者ID:ivladyka,项目名称:Ekran,代码行数:68,代码来源:CategoryView.ascx.cs


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