コード例 #1
0
        private void dgv_productGroups_SelectionChanged(object sender, EventArgs e)
        {
            ClsProductGroup copyOfSelectedProductGroup = (ClsProductGroup)dgv_productGroups.CurrentRow.DataBoundItem;

            if (ClsDataManager.ProductGroups.ContainsKey(copyOfSelectedProductGroup.UID))
            {
                _selectedProductGroup = ClsDataManager.ProductGroups[copyOfSelectedProductGroup.UID];
                updateProductGroupProducts();
            }
        }
コード例 #2
0
        private void btn_newProductGroup_Click(object sender, EventArgs e)
        {
            if (txt_newGroupName.TextLength < 2)
            {
                MessageBox.Show("New Group Name should be atleast two characters long", "Invalid Input");
                return;
            }
            ClsProductGroup newProductGroup = new ClsProductGroup(txt_newGroupName.Text);

            ClsDataManager.SetProductGroup(newProductGroup);
            _selectedProductGroup = newProductGroup;
            updateDisplay();
        }