private void btnSearch_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; serviceDAA = new DBControllerWSClient(); p = serviceDAA.queryProductBySKUCode(txtProduct.Text); if (p.name != null) { UpdateProductForm updateForm1 = new UpdateProductForm(); updateForm1.currentProduct = new product(); updateForm1.currentProduct = p; updateForm1.SetParent(this); updateForm1.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("No existe el producto con ese elemento SKU"); updateDataGridView(); } } catch { MessageBox.Show("No existe producto con ese elemento SKU no es correcta"); } }
private void btnUpdateProduct_Click(object sender, EventArgs e) { UpdateProductForm updateForm = new UpdateProductForm(); if (updateForm.ShowDialog() == DialogResult.OK) { } updateDataGridView(); //componentsState(State.Start); }
private void btnUpdateProduct_Click(object sender, EventArgs e) { int i = dgvProducts.CurrentCell.RowIndex; if (i >= 0) { UpdateProductForm updateForm1 = new UpdateProductForm(); updateForm1.currentProduct = new product(); product e1 = new product(); e1 = serviceDAA.queryProductBySKUCode(dgvProducts.Rows[i].Cells[0].Value.ToString()); updateForm1.currentProduct = e1; updateForm1.ShowDialog(); updateDataGridView(); } else { MessageBox.Show("Seleccione un producto"); } }