Exemplo n.º 1
0
        private void btn_Add_Add_Click(object sender, EventArgs e)
        {
            try{
                var _category = new Category();

                _category.CategoryName        = tb_Add_Name.Text;
                _category.AppGroupCode        = "bnsgrnTH";
                _category.IsDisplayable       = 1;
                _category.DisplayOrder        = 1;
                _category.ChangerAdminAccount = "CashShopEditor";
                _category.CurrencyGroupId     = "71";
                _category.ParentCategory      = tb_Add_Parent.Text;
                _category.CategoryData        = "{\"CategoryType\":[\"01\"]}";

                var id = _category.Add(dbHelper.dbConnection);

                var _categoryDisplay = new CategoryDisplay();

                _categoryDisplay.CategoryID                 = id;
                _categoryDisplay.LanguageCode               = 1;
                _categoryDisplay.CategoryDisplayName        = tb_Add_Name.Text;
                _categoryDisplay.CategoryDisplayDescription = tb_Add_Desc.Text;

                _categoryDisplay.Add(dbHelper.dbConnection);

                _categoryDisplay.LanguageCode = 11;

                _categoryDisplay.Add(dbHelper.dbConnection);


                dbHelper.ClearCache(dbHelper.dbConnection.DataSource);
                CreateCategoryTree();
            }
            catch { }
        }
Exemplo n.º 2
0
        private void btn_InsertCategory_Click(object sender, EventArgs e)
        {
            try
            {
                SetSelectedCategoryData();
                var ID = _SelectedCategory.Add(dbHelper.dbConnection);

                SetSelectedCategoryDisplay(ID, 11);
                _SelectedCategoryDisplay.Add(dbHelper.dbConnection);

                SetSelectedCategoryDisplay(ID);
                _SelectedCategoryDisplay.Add(dbHelper.dbConnection);

                dbHelper.ClearCache(dbHelper.dbConnection.DataSource);
                CreateCategoryTree();
            }
            catch {}
        }