private void btnFinalizar_Click(object sender, EventArgs e)
 {
     try
     {
         if (evnt == 0)
         {
             //dataGrid1.Dispose();
             int PxT = met.PiezasVentana(epc);
             if (PxT == 0)
             {
                 Huecos_NoRack hnr = new Huecos_NoRack(info, user, 0);
                 hnr.Show();
                 this.Close();
                 GC.Collect();
             }
             else if (PxT > 0)
             {
                 //Paneles_Conteo pc = new Paneles_Conteo(tr, int.Parse(id), fol, epc, user, info, reader,PxT);
                 //pc.Show();
                 //if(ultimoRack==1) JLMQ
                 Huecos_Racks hr = new Huecos_Racks(info, user, rack, epc, reader, evnt, tr, newId);
                 hr.Show();
                 this.Close();
                 GC.Collect();
             }
             else
             {
             }
         }
         else if (evnt == 1)
         {
             int PxT = met.PiezasVentana(epc);
             if (PxT == 0)
             {
                 Huecos_NoRack hnr = new Huecos_NoRack(info, user, 1);
                 hnr.Show();
                 this.Close();
                 GC.Collect();
             }
             else if (PxT > 0)
             {
                 //Paneles_Conteo pc = new Paneles_Conteo(tr, int.Parse(id), fol, epc, user, info, reader,PxT);
                 //pc.Show();
                 Huecos_Racks hr = new Huecos_Racks(info, user, rack, epc, reader, evnt, tr, newId);
                 hr.Show();
                 this.Close();
                 GC.Collect();
             }
             else
             {
             }
         }
     }
     catch (ObjectDisposedException odex)
     {
         //MessageBox.Show(odex.Message);
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 2
0
        private void menuItem2_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;//AQUI PASAR INFORMACION PARA QUE ACTUALICE PARCIALIDADES
            string status = lblEstatus.Text.Trim();

            if (status == "PRODUCCION" || status == "PENDIENTE")
            {
                if (asignado > 0)
                {
                    //LiberarControles(this);
                    this.Dispose();
                    GC.Collect();
                    Contar_Huecos ch = new Contar_Huecos(user, detalle, 0, cantidadParcialidad, newId);
                    ch.Show();
                    //Pasar_Curado pc = new Pasar_Curado(user,detalle);
                    //pc.Show();
                }
                else
                {
                    //LiberarControles(this);
                    this.Dispose();
                    GC.Collect();
                    Huecos_NoRack hn = new Huecos_NoRack(detalle, user, 0);
                    hn.Show();
                    //Pasar_Curado pc = new Pasar_Curado(user,detalle);
                    //pc.Show();
                }
            }
            if (status == "CURADO")
            {
                if (asignado > 0)//se cambia a < para probar el formulario de Huecos_NoRack
                {
                    this.Dispose();
                    GC.Collect();
                    Contar_Huecos ch = new Contar_Huecos(user, detalle, 1, cantidadParcialidad, newId);
                    ch.Show();
                }
                else
                {
                    this.Dispose();
                    GC.Collect();
                    Huecos_NoRack hn = new Huecos_NoRack(detalle, user, 1);
                    hn.Show();
                }
            }
            if (status == "LIBERADO")
            {
                /*if (asignado == 2) JLMQ SE COMENTA ESTO PARA QUE TODAS LAS ORDENES DE PRODUCCION PASEN A LIBERAR PRODUCTO Y NO A LIBERAR GRANEL
                 * {
                 *  this.Dispose();
                 *  GC.Collect();
                 *  //frmUbicacion fu = new frmUbicacion(detalle[8], detalle, int.Parse(detalle[16]), user);
                 *  //fu.Show();
                 *  Liberar_Granel lg = new Liberar_Granel(detalle, user);
                 *  lg.Show();
                 * }
                 * else
                 * {*/
                //LiberarControles(this);
                this.Dispose();
                GC.Collect();
                //Liberar_Producto lp = new Liberar_Producto(detalle, user); se quita para probar
                Liberar_Producto lp = new Liberar_Producto(user, detalle, newId);   //SE AGREGO NEWID JLMQ 15NOV2018
                lp.Show();
                //}
            }
            Cursor.Current = Cursors.Default;
        }