private void tsbthemCTHD_Click(object sender, EventArgs e) { CTHD frm = new CTHD(); frm.THEM = true; frm.MACTHD = DEMCTHD2.ToString(); frm.SOLUONG = "1"; frm.ShowDialog(); LoadDataCTHD(); }
private void tsbsuaCTHD_Click(object sender, EventArgs e) { CTHD frm = new CTHD(); frm.THEM = false; if (DEMCTHD1 == 0) { frm.MACTHD = ""; frm.ShowDialog(); } else { if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MACTHD") != null) { frm.MACTHD = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MACTHD").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAHD") != null) { frm.MAHD = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAHD").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAMH") != null) { frm.MAMH = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAMH").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MANV") != null) { frm.MANV = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MANV").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "SOLUONG") != null) { frm.SOLUONG = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "SOLUONG").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "THANHTIEN") != null) { frm.THANHTIEN = float.Parse(gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "THANHTIEN").ToString()); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "DONVITINH") != null) { frm.DONVITINH = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "DONVITINH").ToString(); } if (gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAKH") != null) { frm.MAKH = gvchitiethoadon.GetRowCellValue(gvchitiethoadon.FocusedRowHandle, "MAKH").ToString(); } frm.ShowDialog(); } LoadDataCTHD(); }