Exemplo n.º 1
0
        public ProductForm(ProductViewMode productViewMode, int cat3_id)
        {
            InitializeComponent();

            switch (productViewMode)
            {
                case ProductViewMode.LIST:
                    {
                        ProductItemCtl foodItemControl = new ProductItemCtl();
                        panelUCHolder.Controls.Add(foodItemControl);
                        foodItemControl.Dock = DockStyle.Fill;
                        ScreenTitle = "Product List";

                    }
                    break;

                case ProductViewMode.INSERT:
                    {
                        AddProductItemCtl foodItemControl = new AddProductItemCtl();
                        panelUCHolder.Controls.Add(foodItemControl);
                        foodItemControl.Dock = DockStyle.Fill;
                        ScreenTitle = "Add New Product";

                    }
                    break;

                case ProductViewMode.UPDATE:
                    {
                        AddProductItemCtl foodItemControl = new AddProductItemCtl(cat3_id);
                        panelUCHolder.Controls.Add(foodItemControl);
                        foodItemControl.Dock = DockStyle.Fill;
                        ScreenTitle = "Update Product";

                    }
                    break;
            }
        }
Exemplo n.º 2
0
 private void btnClose_Click_1(object sender, EventArgs e)
 {
     ProductItemCtl foodItemControl = new ProductItemCtl();
     Panel pnl = (Panel)this.ParentForm.Controls["panelUCHolder"];
     pnl.Controls.Clear();
     foodItemControl.isViewList = true;
     foodItemControl.CCategory3Data = categoryData;
     pnl.Controls.Add(foodItemControl);
     foodItemControl.Dock = DockStyle.Fill;
 }