コード例 #1
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Catalogue..");
            this.dictionary_0 = new Dictionary <int, CatalogPage>();
            this.list_0       = new List <EcotronReward>();
            DataTable dataTable  = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num >= '0' ORDER BY order_num ASC");
            DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM ecotron_rewards ORDER BY item_id");
            DataTable dataTable4 = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num = '-1' ORDER BY caption ASC");

            try
            {
                this.uint_0 = (uint)class6_0.ReadDataRow("SELECT ID FROM items ORDER BY ID DESC LIMIT 1")[0];
            }
            catch
            {
                this.uint_0 = 0u;
            }
            this.uint_0 += 1u;
            Hashtable hashtable  = new Hashtable();
            DataTable dataTable3 = class6_0.ReadDataTable("SELECT * FROM catalog_items");

            if (dataTable3 != null)
            {
                foreach (DataRow dataRow in dataTable3.Rows)
                {
                    if (!(dataRow["item_ids"].ToString() == "") && (int)dataRow["amount"] > 0)
                    {
                        string BadgeID = dataRow["BadgeID"].ToString();
                        if (string.IsNullOrEmpty(BadgeID) || string.IsNullOrWhiteSpace(BadgeID))
                        {
                            BadgeID = string.Empty;
                        }
                        hashtable.Add((uint)dataRow["Id"], new CatalogItem((uint)dataRow["Id"], (string)dataRow["catalog_name"], (string)dataRow["item_ids"], (int)dataRow["cost_credits"], (int)dataRow["cost_pixels"], (int)dataRow["cost_snow"], (int)dataRow["amount"], (int)dataRow["page_id"], GoldTree.smethod_2(dataRow["vip"].ToString()), (uint)dataRow["achievement"], (int)dataRow["song_id"], BadgeID));
                    }
                }
            }
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    bool bool_  = false;
                    bool bool_2 = false;
                    if (dataRow["visible"].ToString() == "1")
                    {
                        bool_ = true;
                    }
                    if (dataRow["enabled"].ToString() == "1")
                    {
                        bool_2 = true;
                    }
                    this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], GoldTree.smethod_3(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable));
                }
            }
            if (dataTable4 != null)
            {
                foreach (DataRow dataRow in dataTable4.Rows)
                {
                    bool bool_  = false;
                    bool bool_2 = false;
                    if (dataRow["visible"].ToString() == "1")
                    {
                        bool_ = true;
                    }
                    if (dataRow["enabled"].ToString() == "1")
                    {
                        bool_2 = true;
                    }
                    this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], GoldTree.smethod_3(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable));
                }
            }
            if (dataTable2 != null)
            {
                foreach (DataRow dataRow in dataTable2.Rows)
                {
                    this.list_0.Add(new EcotronReward((uint)dataRow["Id"], (uint)dataRow["display_id"], (uint)dataRow["item_id"], (uint)dataRow["reward_level"]));
                }
            }
            Logging.WriteLine("completed!");
        }