private void buttonEdit_Click(object sender, EventArgs e) { fUpdateDeleteMoto frm = new fUpdateDeleteMoto(); frm.textBoxID.Text = textBoxSearch.Text; frm.ShowDialog(this); }
private void dataGridViewMotoList_CellContentClick(object sender, DataGridViewCellEventArgs e) { //id - fname - lnane - bd - gdr - phn - adrs - pic fUpdateDeleteMoto fm = new fUpdateDeleteMoto(); fm.textBoxID.Text = dataGridViewMotoList.CurrentRow.Cells[0].Value.ToString(); fm.textBoxNameOwner.Text = dataGridViewMotoList.CurrentRow.Cells[3].Value.ToString(); fm.textBoxAddress.Text = dataGridViewMotoList.CurrentRow.Cells[4].Value.ToString(); fm.textBoxPhone.Text = dataGridViewMotoList.CurrentRow.Cells[5].Value.ToString(); fm.numericUpDownTimeRent.Value = (int)dataGridViewMotoList.CurrentRow.Cells[6].Value; fm.dateTimePicker1.Value = (DateTime)dataGridViewMotoList.CurrentRow.Cells[7].Value; if ((dataGridViewMotoList.CurrentRow.Cells[8].Value.ToString().Trim() == "Hour")) { fm.radioButtonHour.Checked = true; } else if ((dataGridViewMotoList.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[])dataGridViewMotoList.CurrentRow.Cells[1].Value; MemoryStream picture1 = new MemoryStream(pic1); fm.pictureBoxNumberPlate.Image = Image.FromStream(picture1); byte[] pic2; pic2 = (byte[])dataGridViewMotoList.CurrentRow.Cells[2].Value; MemoryStream picture2 = new MemoryStream(pic2); fm.pictureBoxOwner.Image = Image.FromStream(picture2); this.Show(); fm.Show(); }
private void editRemoveToolStripMenuItem_Click(object sender, EventArgs e) { fUpdateDeleteMoto frm = new fUpdateDeleteMoto(); frm.ShowDialog(this); }