Exemplo n.º 1
0
        private async void SetCategoryTree(long?MarkedId = null)
        {
            RadioButtonWithID all = new RadioButtonWithID(null);

            all.Checked         = true;
            all.Text            = "Wszystkie";
            all.CheckedChanged += All_CheckedChanged;
            categoryFlowPanel.Controls.Add(all);
            InterfaceToDataBaseCategoryMethods Methods = new InterfaceToDataBaseCategoryMethods();
            List <Category> Categories = await Methods.GetAllCategories();

            foreach (Category category in Categories)
            {
                RadioButtonWithID add = new RadioButtonWithID(category.CategoryID);
                if (category.CategoryID == MarkedId)
                {
                    all.Checked = false;
                    add.Checked = true;
                }
                else
                {
                    add.Checked = false;
                }
                add.Text            = category.Name;
                add.CheckedChanged += All_CheckedChanged;
                categoryFlowPanel.Controls.Add(add);
            }
        }
Exemplo n.º 2
0
        private async void GenerateCategoryLabelChain()
        {
            try
            {
                InterfaceToDataBaseCategoryMethods Methods = new InterfaceToDataBaseCategoryMethods();
                Category category = await Methods.GetCategory(productDataObject.CategoryID);

                currentCategoryLabel.Text = ">" + category.Name;
            }
            catch (NullReferenceException)
            {
                currentCategoryLabel.Visible = false;
            }
            currentObjectLabel.Text = ">" + productDataObject.ProductName;
        }