private void button1_Click(object sender, EventArgs e) { ChiTietThietBi chiTietThietBi = new ChiTietThietBi(); chiTietThietBi.ShowDialog(); LoadData(); }
private void detailToolStripMenuItem_Click(object sender, EventArgs e) { Class.trangThietBi thietBi = new Class.trangThietBi(); int currentRowIndex = dtgv_ThietBiList.CurrentCellAddress.Y;// 'current row selected if (-1 < currentRowIndex && currentRowIndex < dtgv_ThietBiList.RowCount) { thietBi.ten = dtgv_ThietBiList.Rows[currentRowIndex].Cells["ten"].Value.ToString(); thietBi.ma = dtgv_ThietBiList.Rows[currentRowIndex].Cells["ma"].Value.ToString(); thietBi.tinhTrang = dtgv_ThietBiList.Rows[currentRowIndex].Cells["tinhTrang"].Value.ToString(); //invisible part--------- thietBi.ngayMua = Convert.ToDateTime(dtgv_ThietBiList.Rows[currentRowIndex].Cells["ngayMua"].Value.ToString()); thietBi.giaThanh = int.Parse(dtgv_ThietBiList.Rows[currentRowIndex].Cells["giaThanh"].Value.ToString()); thietBi.baoHanh = int.Parse(dtgv_ThietBiList.Rows[currentRowIndex].Cells["baoHanh"].Value.ToString()); thietBi.ngayHetHanBaoHanh = Convert.ToDateTime(dtgv_ThietBiList.Rows[currentRowIndex].Cells["ngayHetHanBaoHanh"].Value.ToString()); thietBi.hangSanXuat = dtgv_ThietBiList.Rows[currentRowIndex].Cells["hangSanXuat"].Value.ToString(); } ChiTietThietBi chiTietThietBi = new ChiTietThietBi(thietBi); chiTietThietBi.ShowDialog(); LoadData(); }