private void dataGridViewCat_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { edit = 1; DataGridViewRow row = dataGridViewCat.Rows[e.RowIndex]; CategoryId = Convert.ToInt32(row.Cells[0].Value.ToString()); textBoxCategoryName.Text = row.Cells[1].Value.ToString(); comboBoxIsSales.SelectedItem = row.Cells[2].Value.ToString(); MainClass.Disable(panelRightSlider); } }
private void dataGridViewUsers_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { edit = 1; DataGridViewRow row = dataGridViewUsers.Rows[e.RowIndex]; userId = Convert.ToInt32(row.Cells[0].Value.ToString()); textBoxUserName.Text = row.Cells[1].Value.ToString(); textBoxPasword.Text = row.Cells[2].Value.ToString(); textBoxContact.Text = row.Cells[3].Value.ToString(); textBoxEmail.Text = row.Cells[4].Value.ToString(); comboBoxSelectRole.SelectedValue = row.Cells[6].Value.ToString(); MainClass.Disable(panelRightSlider); } }
private void dataGridViewProduct_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { edit = 1; DataGridViewRow row = dataGridViewProduct.Rows[e.RowIndex]; ProductId = Convert.ToInt32(row.Cells[0].Value.ToString()); textBoxProductName.Text = row.Cells[1].Value.ToString(); textBoxProductCode.Text = row.Cells[2].Value.ToString(); textBoxPrice.Text = row.Cells[3].Value.ToString(); textBoxUnit.Text = row.Cells[4].Value.ToString(); textBoxMinimumValue.Text = row.Cells[6].Value.ToString(); comboBoxCategory.SelectedValue = row.Cells["ProductCatIdGv"].Value.ToString(); CategoryId = Convert.ToInt32(row.Cells["ProductCatIdGv"].Value.ToString()); comboBoxCategory.Text = row.Cells[7].Value.ToString(); MainClass.Disable(panelRightSlider); } }
private void dataGridViewSupplier_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { edit = 1; DataGridViewRow row = dataGridViewSupplier.Rows[e.RowIndex]; SupplierId = Convert.ToInt32(row.Cells[0].Value.ToString()); textBoxSupplierName.Text = row.Cells[1].Value.ToString(); textBoxSupplierCode.Text = row.Cells[2].Value.ToString(); textBoxSupplierContactNumber.Text = row.Cells[3].Value.ToString(); textBoxSupplierEmail.Text = row.Cells[4].Value.ToString(); textBoxAddress.Text = row.Cells[5].Value.ToString(); textBoxSupplierCity.Text = row.Cells[6].Value.ToString(); textBoxCountry.Text = row.Cells[7].Value.ToString(); textBoxPayment.Text = row.Cells[8].Value.ToString(); textBoxDeliveryMethod.Text = row.Cells[9].Value.ToString(); textBoxDelLeadTime.Text = row.Cells[10].Value.ToString(); MainClass.Disable(panelRightSlider); } }