コード例 #1
0
        private void productTypesTreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            var localProductTypeId = int.Parse(e.Node.Name);

            using (var productTypeEditor = new ProductTypeEditor(localProductTypeId))
            {
                productTypeEditor.ShowDialog(this);
                BindProductType();
            }
        }
コード例 #2
0
 private void newButton_Click(object sender, EventArgs e)
 {
     if (tabControl.SelectedTab.Name == "brands")
     {
         var brand = new Brand();
         using (var brandEditor = new BrandEditor(brand))
         {
             brandEditor.ShowDialog(this);
         }
     }
     else if (tabControl.SelectedTab.Name == "productTypes")
     {
         var productType = new ProductType();
         using (var productTypeEditor = new ProductTypeEditor(productType))
         {
             productTypeEditor.ShowDialog(this);
             BindProductType();
         }
     }
 }