Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Category cat = new Category();
         cat.Where.CategoryID.Value = CategoryID;
         if (cat.Query.Load())
         {
             lblName.Text = cat.GetColumn("Name" + Utils.LangPrefix).ToString();
             if (!cat.IsColumnNull("CategoryContent" + Utils.LangPrefix))
             {
                 lblCategoryContent.Text = cat.GetColumn("CategoryContent" + Utils.LangPrefix).ToString();
             }
         }
     }
 }
Пример #2
0
 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;
     }
 }
Пример #3
0
 private void LoadCategories()
 {
     const int countCells = 2;
     HtmlTableRow row = new HtmlTableRow();
     Category c = new Category();
     //c.Where.IsGallery.Value = true;
     if(c.Query.Load())
     {
         do
         {
             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();
             }
             if (row.Cells.Count < countCells)
             {
                 row.Cells.Add(AddCategoryCellInnerHTML(c.CategoryID, title));
             }
             else
             {
                 tblCategory.Rows.Add(row);
                 row = new HtmlTableRow();
                 row.Cells.Add(AddCategoryCellInnerHTML(c.CategoryID, title));
             }
         } while (c.MoveNext());
     }
     for (int i = row.Cells.Count; i < countCells; i++)
     {
         row.Cells.Add(AddTableCell("&nbsp;"));
     }
     tblCategory.Rows.Add(row);
 }
Пример #4
0
 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;
         }
     }
 }
Пример #5
0
 private void LoadCategory()
 {
     Category c = new Category();
     c.Where.CategoryID.Value = CategoryID;
     if (c.Query.Load())
     {
         if (CategoryID > 1)
         {
             lblName.Text = c.GetColumn("Name" + Utils.LangPrefix).ToString();
         }
         this.m_Name = c.GetColumn("Name" + Utils.LangPrefix).ToString();
         if (!c.IsColumnNull("CategoryContent" + Utils.LangPrefix))
         {
             lblCategoryContent.Text = c.GetColumn("CategoryContent" + Utils.LangPrefix).ToString();
         }
         if (!c.IsColumnNull(Category.ColumnNames.RoomCategoryID))
         {
             LoadRoomPrice(c.RoomCategoryID);
         }
     }
 }