//Khi click vao datagrid se hien thi dong tien chi tiet tuong ung voi hop dong private void cmdEdit_Click(object sender, EventArgs e) { string mahd; DataGridViewRow dtGridRow; NhapthongtinHD frmEditContracts = new NhapthongtinHD(); Boolean datra; if (dtGridContracts.RowCount == 0) { return; } if (dtGridContracts.SelectedRows.Count == 0) { MessageBox.Show("Ban phai chon hang can sua..."); return; } dtGridRow = dtGridContracts.SelectedRows[0]; datra = (Boolean)dtGridRow.Cells["Hoanthanh"].Value; if (datra == true) { MessageBox.Show("Hop dong da hoan thanh ban khong the chinh sua duoc!"); return; } mahd = dtGridRow.Cells["MaHD"].Value.ToString(); frmEditContracts.init(dbname, mahd, workingdir); frmEditContracts.ShowDialog(); }
private void cmdAdd_Click(object sender, EventArgs e) { NhapthongtinHD frmNhapHD = new NhapthongtinHD(); frmNhapHD.init(dbname, workingdir); frmNhapHD.ShowDialog(); clear(); Refresh_Data(); }
private void nhapHopDongMoiToolStripMenuItem_Click(object sender, EventArgs e) { NhapthongtinHD frmNhapHD = new NhapthongtinHD(); if (frmNhapHD.init(dbFileName, workingDir)) { frmNhapHD.ShowDialog(); } }
//Khi click vao datagrid se hien thi dong tien chi tiet tuong ung voi hop dong private void cmdEdit_Click(object sender, EventArgs e) { string mahd; DataGridViewRow dtGridRow; NhapthongtinHD frmEditContracts = new NhapthongtinHD(); Boolean datra; if (dtGridContracts.RowCount == 0) return; if (dtGridContracts.SelectedRows.Count == 0) { MessageBox.Show("Ban phai chon hang can sua..."); return; } dtGridRow = dtGridContracts.SelectedRows[0]; datra = (Boolean)dtGridRow.Cells["Hoanthanh"].Value; if (datra == true) { MessageBox.Show("Hop dong da hoan thanh ban khong the chinh sua duoc!"); return; } mahd = dtGridRow.Cells["MaHD"].Value.ToString(); frmEditContracts.init(dbname, mahd, workingdir); frmEditContracts.ShowDialog(); }
private void nhapHopDongMoiToolStripMenuItem_Click(object sender, EventArgs e) { NhapthongtinHD frmNhapHD = new NhapthongtinHD(); if (frmNhapHD.init(dbFileName, workingDir)) frmNhapHD.ShowDialog(); }