Ejemplo n.º 1
0
        private void dgvArticulos_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Dictionary <int, string> ordenes = new Dictionary <int, string>();
            int idpack = (int)(dgvArticulos.Rows[e.RowIndex].Cells["ID"].Value);

            ordenes = conex.ListaOrden(idpack);
            FRMPacking F = new FRMPacking(true);

            F.AgregarTap(ordenes, idpack);
            F.TopLevel      = false;
            F.StartPosition = FormStartPosition.CenterScreen;
            F.Parent        = Frm.PnlPrincipal;
            F.Show();
            F.BringToFront();
        }
Ejemplo n.º 2
0
        private void btn_Click(object sender, EventArgs e)
        {
            if (dgvXOrdenes.Rows.Count > 0)
            {
                Dictionary <int, string> ordenes = new Dictionary <int, string>();
                bool Open = false;
                if (dgvXOrdenes.Rows.Count > 0)
                {
                    foreach (DataGridViewRow row in dgvXOrdenes.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells["Checking"].Value))
                        {
                            ordenes.Add(Convert.ToInt32(row.Cells["ID"].Value), row.Cells["OrdSurt"].Value.ToString());
                        }
                    }
                }



                foreach (Form frm in Application.OpenForms)
                {
                    if (frm.GetType() == typeof(FRMPacking)) // busca si esta abierto el FRMPacking
                    {
                        Open = true;
                    }
                }

                if (!Open) // si falso: no esta abierto, inicializa el tab y muestra el form
                {
                    ID_packing = conex.GeneraIDpacking();
                    F          = new FRMPacking(false);
                    F.AgregarTap(ordenes, ID_packing);
                    F.Show();
                    //F.BringToFront();
                    this.Visible = false;

                    //FRMPacking F = new FRMPacking(true);
                    //F.AgregarTap(ordenes, ID_packing);
                    //F.TopLevel = false;
                    //F.StartPosition = FormStartPosition.CenterScreen;
                    //F.Parent = prins.PnlPrincipal;
                    //F.Show();
                    //F.BringToFront();
                    //this.Visible = false;
                }
                else
                {
                    if (!esPendiente)
                    {
                        F.AgregarTap(ordenes, ID_packing); // si esta abierto solo inserta la odern para generar un nuevo tab si esque no existe
                                                           //F.TopLevel = false;
                                                           //F.Parent = prins.PnlPrincipal;
                        F.Refresh();
                        F.BringToFront();
                    }
                    else
                    {
                        Frmpack.AgregarTap(ordenes, ID_packing);
                    }

                    this.Visible = false;
                }

                dgvXOrdenes.Rows.Clear();
            }
        }