private void btnHuy_Click(object sender, EventArgs e) { this.Hide(); FCongViec fcv = new FCongViec(); fcv.MdiParent = main; fcv.main = main; fcv.Show(); }
private void côngViệcToolStripMenuItem_Click(object sender, EventArgs e) { Form form = CheckTonTai(typeof(FCongViec)); if (form != null) { form.Activate(); } else { FCongViec newform = new FCongViec(); newform.MdiParent = this; newform.main = this; newform.Show(); } }
private void btnThucHien_Click(object sender, EventArgs e) { if (labTacVu.Text == "Thêm") { if (txtTenCV.Text != "") { if (txtMaCV.Text != "") { try { //byte[] imageData = ReadFile(lbimgpath.Text); CongViec.MaCV = txtMaCV.Text; CongViec.TenCV = txtTenCV.Text; Act.AddCV(CongViec); AutoID.UpdateAutoID(11); MessageBox.Show("Đã Thêm Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Mã Không được để trống", "Chú Ý", MessageBoxButtons.OK); txtMaCV.Focus(); } } else { MessageBox.Show("Tên Không được để trống", "Chú Ý", MessageBoxButtons.OK); txtTenCV.Focus(); } } else if (labTacVu.Text == "Sửa") { if (txtTenCV.Text != "") { try { //byte[] imageData = ReadFile(lbimgpath.Text); CongViec.MaCV = txtMaCV.Text; CongViec.TenCV = txtTenCV.Text; Act.UpdateCV(CongViec); MessageBox.Show("Đã Sửa Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Tên Không được để trống", "Chú Ý", MessageBoxButtons.OK); txtTenCV.Focus(); } } else { try { CongViec.MaCV = txtMaCV.Text; CongViec.TenCV = txtTenCV.Text; Act.DeleteCV(CongViec); MessageBox.Show("Đã Xóa Thành Công", "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Chú Ý", MessageBoxButtons.OK, MessageBoxIcon.Information); } } this.Hide(); FCongViec fcv = new FCongViec(); fcv.MdiParent = main; fcv.main = main; fcv.Show(); }