private void buttonEdit_Click(object sender, EventArgs e) { fUpdateDeleteCar frm = new fUpdateDeleteCar(); frm.textBoxID.Text = textBoxSearch.Text; frm.ShowDialog(this); }
private void dataGridViewCarList_CellContentClick(object sender, DataGridViewCellEventArgs e) { //id - fname - lnane - bd - gdr - phn - adrs - pic fUpdateDeleteCar fm = new fUpdateDeleteCar(); fm.textBoxID.Text = dataGridViewCarList.CurrentRow.Cells[0].Value.ToString(); fm.textBoxNameOwner.Text = dataGridViewCarList.CurrentRow.Cells[3].Value.ToString(); fm.textBoxAddress.Text = dataGridViewCarList.CurrentRow.Cells[4].Value.ToString(); fm.textBoxPhone.Text = dataGridViewCarList.CurrentRow.Cells[5].Value.ToString(); fm.numericUpDownTimeRent.Value = (int)dataGridViewCarList.CurrentRow.Cells[6].Value; fm.dateTimePicker1.Value = (DateTime)dataGridViewCarList.CurrentRow.Cells[7].Value; if ((dataGridViewCarList.CurrentRow.Cells[8].Value.ToString().Trim() == "Hour")) { fm.radioButtonHour.Checked = true; } else if ((dataGridViewCarList.CurrentRow.Cells[8].Value.ToString().Trim() == "Week")) { fm.radioButtonWeek.Checked = true; } else { fm.radioButtonMonth.Checked = true; } // code xu ly hinh anh up len, version 01, chay OK, tim hieu them de code nhe hon byte[] pic1; pic1 = (byte[])dataGridViewCarList.CurrentRow.Cells[1].Value; MemoryStream picture1 = new MemoryStream(pic1); fm.pictureBoxNumberPlate.Image = Image.FromStream(picture1); byte[] pic2; pic2 = (byte[])dataGridViewCarList.CurrentRow.Cells[2].Value; MemoryStream picture2 = new MemoryStream(pic2); fm.pictureBoxType.Image = Image.FromStream(picture2); this.Show(); fm.Show(); }
private void editRemoveToolStripMenuItem1_Click(object sender, EventArgs e) { fUpdateDeleteCar fr = new fUpdateDeleteCar(); fr.ShowDialog(this); }