コード例 #1
0
ファイル: ProductsUserControl.cs プロジェクト: Gvyn/SOSM
        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);
            }
        }
コード例 #2
0
ファイル: ProductWindowUserControl.cs プロジェクト: Gvyn/SOSM
        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;
        }