private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { DataGridViewRow dr = dataGridView1.SelectedRows[0]; this.Hide(); frmStock frm = new frmStock(); frm.Show(); frm.txtInventoryID.Text = dr.Cells[0].Value.ToString(); frm.txtConfigID.Text = dr.Cells[1].Value.ToString(); frm.txtProductname.Text = dr.Cells[2].Value.ToString(); frm.txtThickness.Text = dr.Cells[3].Value.ToString(); frm.txtColour.Text = dr.Cells[4].Value.ToString(); frm.txtSize.Text = dr.Cells[5].Value.ToString(); frm.txtPrice.Text = dr.Cells[6].Value.ToString(); frm.txtQty.Text = dr.Cells[7].Value.ToString(); frm.txtTotalPrice.Text = dr.Cells[8].Value.ToString(); // frm.dtpInventoryDate.Text = DateTime.Parse(dr.Cells[9].Value.ToString()).ToString(); frm.btnUpdate.Enabled = true; frm.btnDelete.Enabled = true; frm.btnSave.Enabled = false; frm.label8.Text = label1.Text; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmStockRecord_FormClosing(object sender, FormClosingEventArgs e) { this.Hide(); frmStock frm = new frmStock(); frm.label8.Text = label1.Text; frm.Show(); }
private void stockToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); frmStock frm = new frmStock(); frm.label8.Text = lblUser.Text; frm.Show(); }
private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { DataGridViewRow dr = dataGridView1.SelectedRows[0]; this.Hide(); frmStock frm = new frmStock(); frm.Show(); frm.txtProductname.Text = dr.Cells[0].Value.ToString(); frm.txtConfigID.Text = dr.Cells[1].Value.ToString(); frm.txtThickness.Text = dr.Cells[2].Value.ToString(); frm.txtColour.Text = dr.Cells[3].Value.ToString(); frm.txtSize.Text = dr.Cells[4].Value.ToString(); frm.txtPrice.Text = dr.Cells[5].Value.ToString(); frm.label8.Text = label1.Text; frm.txtQty.Focus(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }