public Form2(int id, String Prov) { InitializeComponent(); dataGridView1.DataSource = SQLCONN.getped(id); this.ID = id; this.Prov = Prov; txtProveedor.Text = Prov; txtProveedor.Enabled = false; txtFecha.Text = hoy.ToString("d"); txtFecha.Enabled = false; }
private void btnGuardar_Click(object sender, EventArgs e) { if (!txtProducto.Text.Equals("") && !txtCant.Text.Equals("") && !txtFecha.Text.Equals("")) { if (SQLCONN.NewPred(ID.ToString(), txtProducto.Text, txtCant.Text, txtFecha.Text)) { MessageBox.Show("Pedido Guardado"); dataGridView1.DataSource = SQLCONN.getped(ID); txtProducto.Text = ""; txtCant.Text = ""; } } else { MessageBox.Show("Llene todos los campos"); } }