Example #1
0
        private void btn_surtir_Click(object sender, EventArgs e)
        {
            //SetCursor(LoadCursor(NULL, IDC_WAIT));
            try
            {
                Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //Cursor.Show();

                frm_leer_articulos1 f = new frm_leer_articulos1();
                f.invcnbr = lbl_factura.Text.Trim();
                f.invtid  = txt_cve.Text.Trim();
                //f.lbl_clave.Text = lbl_clave.Text.Trim();
                //f.lbl_desc.Text = lbl_desc.Text.Trim();
                f.txt_cve.Text  = txt_cve.Text.Trim();
                f.txt_desc.Text = txt_desc.Text.Trim();
                //f.desc = lbl_desc.Text.Trim();
                f.shipperid = lbl_shipperid.Text.Trim();
                f.cant_sol  = Convert.ToDecimal(lbl_cant_sol.Text.Trim());
                //f.Text = lbl_clave.Text.Trim() + "-" + lbl_desc.Text.Trim();
                //this.Hide();
                f.ShowDialog();
                //this.ShowDialog();
            }
            catch (Exception)
            {
                Cursor.Current = Cursors.Default;
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        private void timer2_Tick(object sender, EventArgs e)
        {
            if (lbl_factura.Text != "")
            {
                lista_cajas(lbl_factura.Text, int.Parse(lbl_id_zona.Text));
                lbl_tot_rec.Text   = total_cajas_rec(lbl_factura.Text.Trim(), int.Parse(lbl_id_zona.Text)).ToString();
                lbl_tot_cajas.Text = total_cajas_factura(lbl_factura.Text.Trim()).ToString();
                if (tot_rec == tot_Cajas)
                {
                    timer2.Enabled = false;
                    timer1.Enabled = false;
                    lbl_msj.Text   = "Recepcion Terminada De Cajas De Factura";
                    if (Global.picking == 1)
                    {
                        int    tot_ps   = Global.total_articulos_ps_zonas(lbl_factura.Text.Trim());
                        int    id_zona  = 0;
                        string area     = "";
                        int    tot_arts = 0;
                        if (tot_ps > 0)
                        {
                            //Global.obtener_zona_area_por_surtir(lbl_factura.Text.Trim(), out id_zona, out area, out tot_arts);
                            //Global.agregar_status_zona_area(Global.invcnbr, id_zona, area, "SO");
                            //MessageBox.Show("Tiene " + tot_ps.ToString() + " Articulos Para Surtir En La Zona:" + id_zona.ToString() + " " + area);
                            MessageBox.Show("Tiene " + tot_ps.ToString() + " Articulos Para Surtir de la Factura: " + lbl_factura.Text.Trim());
                            frm_leer_articulos1 f = new frm_leer_articulos1();
                            f.invcnbr          = Global.invcnbr;
                            f.lbl_factura.Text = invcnbr.Trim();
                            f.tipocaja         = "CAJA";
                            f.timer1.Enabled   = true;
                            f.ShowDialog();
                            f.Dispose();
                            Cursor.Current = Cursors.Default;
                            this.Close();
                            //return;
                        }
                        else
                        {
                            MessageBox.Show("Recepcion  Terminada no tiene articulos para surtir");
                            this.Close();
                        }
                    }
                    else if (Global.picking == 2)
                    {
                        int tot_ps = Global.total_articulos_por_surtir_picking2(lbl_factura.Text.Trim());
                        //int id_zona=0;
                        //string area="";
                        //int tot_arts=0;
                        if (tot_ps > 0)
                        {
                            //Global.obtener_zona_area_por_surtir(lbl_factura.Text.Trim(), out id_zona, out area, out tot_arts);
                            MessageBox.Show("Tiene " + tot_ps.ToString() + " Articulos Para Surtir En PICKING2, Seleccionar Medio Para Surtir");
                            this.Close();
                            //if (Global.cajap2 == "")
                            //{
                            //    frm_leer_carrito f1 = new frm_leer_carrito();
                            //    f1.invcnbr = Global.invcnbr;
                            //    this.Visible = false;
                            //    f1.ShowDialog();
                            //    if (Global.cajap2 == "")
                            //    {
                            //        MessageBox.Show("Seleccionar Carrito o Canasta Correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                            //        this.Visible = true;
                            //        timer1.Enabled = true;
                            //        return;
                            //    }
                            //else
                            //{
                            //    Global.obtener_zona_area_por_surtir(lbl_factura.Text.Trim(), out id_zona, out area, out tot_arts);
                            //    Global.agregar_status_zona_area(Global.invcnbr, id_zona, area, "SO");
                            //    frm_leer_articulos1 f = new frm_leer_articulos1();
                            //    f.invcnbr = invcnbr.Trim();
                            //    //f.invcnbr_status = false;
                            //    f.lbl_factura.Text = invcnbr.Trim();
                            //    //f.lbl_shipperid.Text = lbl_shiperid.Text;
                            //    f.tipocaja = "CARRITO";
                            //    f.timer1.Enabled = true;
                            //    this.Close();
                            //    f.Show();

                            //}


                            //}
                            //else
                            //{
                            //    Global.obtener_zona_area_por_surtir(lbl_factura.Text.Trim(), out id_zona, out area, out tot_arts);
                            //    Global.agregar_status_zona_area(Global.invcnbr, id_zona, area, "SO");
                            //    frm_leer_articulos1 f = new frm_leer_articulos1();
                            //    f.invcnbr = invcnbr.Trim();
                            //    //f.invcnbr_status = false;
                            //    f.lbl_factura.Text = invcnbr.Trim();
                            //    //f.lbl_shipperid.Text = lbl_shiperid.Text;
                            //    f.tipocaja = "CARRITO";
                            //    f.timer1.Enabled = true;
                            //    this.Close();
                            //    f.Show();

                            //}
                        }
                        else
                        {
                            MessageBox.Show("Recepcion  Terminada no tiene articulos para surtir");
                            this.Close();
                        }
                    }
                }
                else
                {
                    lbl_msj.Text = "Recibir Cajas..";
                }
            }
        }