示例#1
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (textBox1.Text.Length > 10)
                {
                    textBox1.Text = textBox1.Text.Replace(" ", "");
                    if (es_numerico(textBox1.Text))
                    {
                        materia_prima Materia = new materia_prima(textBox1.Text, conexion_q.ConnectionString, terminal);
                        DataTable     a       = new DataTable();
                        if (Materia.existe() == false)
                        {
                            MessageBox.Show("La Matricula no existe", "Atencion!!");
                        }
                        else if (Materia.tiene_stock() == false)
                        {
                            MessageBox.Show("La Matricula no tiene Stock", "Atencion!!");
                        }
                        else if (Materia.ya_existe())
                        {
                            MessageBox.Show("La Matricula ya la has añadido", "Atencion!!");
                        }
                        else if (Materia.es_fifo())
                        {
                            a = Materia.Get_datos_matricula();
                            En_pantalla.Insertar(a);
                        }
                        else
                        {
                            Form_Leido popup = new Form_Leido(textBox1.Text, conexion_q.ConnectionString, terminal);
                            popup.getForm = this;
                            this.Hide();

                            if (popup.ShowDialog() == DialogResult.OK)
                            {
                                a = popup.Get_datos_matricula();
                                foreach (DataRow row in a.Rows)
                                {
                                    if (row[11].ToString() == "False")
                                    {
                                        label3.Text = "No Fifo";
                                    }
                                    else
                                    {
                                        label3.Text = "Fifo Ok";
                                    }
                                }
                                En_pantalla.Insertar(a);
                            }
                        }
                        materialSkinManager.ColorScheme = new ColorScheme(Primary.Green600, Primary.Green700, Primary.Green200, Accent.Red100, TextShade.WHITE);

                        Actualiza();
                        //rellenaListview(En_pantalla.Get_Datos());
                    }
                }
                //EjecutarFuncion();
            }
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            // Traspaso_Almacen tras = new Traspaso_Almacen(conexion_q.ConnectionString);
            int termi = 0;

            int.TryParse(terminal, out termi);
            if (dataGridView1.RowCount > 0)
            {
                if (termi > 0)
                {
                    Form5 reporte = new Form5(termi);
                    reporte.getForm = this;
                    this.Hide();
                    if (DialogResult.OK == reporte.ShowDialog())
                    {
                        En_pantalla.Validar();
                        reporte.Dispose();
                        reporte = null;
                        Actualiza();
                    }
                }
            }
            else
            {
                MessageBox.Show("No hay matriculas que validad.", "Atencion!!");
            }

            //tras.Intern_TraspasaStockPartidas(2016,1,"D", 152774,0, 366, 6, 100,100);
        }
示例#3
0
        private void materialFlatButton1_Click(object sender, EventArgs e)
        {
            if (dataGridView1.RowCount > 0)
            {
                int          fila    = this.dataGridView1.SelectedCells[0].RowIndex;
                string       sscc    = this.dataGridView1.Rows[fila].Cells[3].Value.ToString();
                string       mensaje = "Deseas Borrar, la matricula:\r\n" + sscc;
                DialogResult boton   = MessageBox.Show(mensaje, "Alerta", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
                if (boton == DialogResult.OK)
                {
                    En_pantalla.Borrar(sscc);
                    Actualiza();
                }
            }

            /*  else
             *
             * MessageBox.Show(sscc);*/
        }
示例#4
0
 private void Actualiza()
 {
     dataGridView1.DataSource = En_pantalla.Get_Datos();
 }