當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。