コード例 #1
0
 public FrmProduct(Product product, ChildMainProducts father)
 {
     InitializeComponent();
     _product = product;
     _edit    = true;
     _father  = father;
 }
コード例 #2
0
        private void btnAddProduct_Click(object sender, EventArgs e)
        {
            var childProducts = new ChildMainProducts();

            if (pnlDashboard.Controls.Count > 0)                                     //Si el panel principal contiene un Formulario hijo
            {
                if (pnlDashboard.Controls[0].GetType() != typeof(ChildMainProducts)) //Si el tipo de formulario es diferente a ChildMenuProducts
                {
                    OpenChildForm(childProducts);                                    //Agrega un nuevo formulario de childMenuProducts
                }
                else
                {
                    childProducts = (ChildMainProducts)pnlDashboard.Controls[0];
                }
            }
            else
            {
                OpenChildForm(childProducts);
            }
            var form = new FrmProduct(childProducts);

            form.Show();
        }
コード例 #3
0
 public FrmProduct(ChildMainProducts father)
 {
     InitializeComponent();
     _edit   = false;
     _father = father;
 }