public FrmRole(Role role, ChildMainRole father) { InitializeComponent(); _father = father; this._role = role; _edit = true; }
private void btnAddRole_Click(object sender, EventArgs e) { var childRoles = new ChildMainRole(); if (pnlDashboard.Controls.Count > 0) //Si el panel principal contiene un Formulario hijo { if (pnlDashboard.Controls[0].GetType() != typeof(ChildMainRole)) //Si el tipo de formulario es diferente a ChildMenuProducts { OpenChildForm(childRoles); //Agrega un nuevo formulario de childMenuProducts } else { childRoles = (ChildMainRole)pnlDashboard.Controls[0]; } } else { OpenChildForm(childRoles); } var form = new FrmRole(childRoles); form.Show(); }
public FrmRole(ChildMainRole father) { InitializeComponent(); _father = father; _edit = false; }