private void btn_Xoa_Click(object sender, EventArgs e) { try { if (ExpressionMethod.CheckAuth(this.auth)) { DialogResult result = MessageBox.Show("Xác nhận xóa khách hàng", "Xóa khách hàng", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { if (db.DeleteCustomer(Int32.Parse(pictureBox1.Tag.ToString()))) { MessageBox.Show("Xóa thành công", "Xóa khách hàng", MessageBoxButtons.OK, MessageBoxIcon.Information); binding.DataSource = db.GetCustomers(); } else { MessageBox.Show("Xóa khách hàng thất bại", "Xóa khách hàng", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnHuyKhoanTre_Click(object sender, EventArgs e) { if (ExpressionMethod.CheckAuth(this.auth)) { DialogResult result = MessageBox.Show("Xác nhận xóa khoản trễ này", "Xóa khoản trễ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { ThucHienXoaKhoanTre(); } } }
private void btn_ThemTieuDe_Click(object sender, EventArgs e) { try { if (ExpressionMethod.CheckAuth(this.auth)) { FormThemTD frm = new FormThemTD(); frm.Show(); frm.FormClosing += Frm_FormClosing; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_ThemDia_Click(object sender, EventArgs e) { try { if (ExpressionMethod.CheckAuth(this.auth)) { FormThemDiaBS frm = new FormThemDiaBS(Int32.Parse(pictureBox1.Tag.ToString())); frm.Show(); frm.FormClosing += Frm_FormClosing; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_Xoa_Click(object sender, EventArgs e) { if (ExpressionMethod.CheckAuth(this.auth)) { DialogResult result = MessageBox.Show("Xác nhận xóa đĩa bản sao này", "Xóa đĩa bản sao", MessageBoxButtons.YesNo, MessageBoxIcon.Error); if (result == DialogResult.Yes) { if (db.Delete(Int32.Parse(pictureBox1.Tag.ToString()))) { MessageBox.Show("Xóa thành công", "Xóa đĩa bản sao", MessageBoxButtons.OK, MessageBoxIcon.Information); binding.DataSource = db.GetDisks(); } else { MessageBox.Show("Xóa thất bại", "Xóa đĩa bản sao", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }
private void btn_CapNhat_Click(object sender, EventArgs e) { if (ExpressionMethod.CheckAuth(auth) == true) { if (btn_CapNhat.Text == "Cập nhật") { cbx_TrangThaiDia.Enabled = true; txt_TenTieuDe.ReadOnly = false; btn_CapNhat.Text = "Hủy"; btn_XacNhan.Enabled = true; } else { cbx_TrangThaiDia.Enabled = false; btn_XacNhan.Enabled = false; txt_TenTieuDe.ReadOnly = true; btn_CapNhat.Text = "Cập nhật"; } } }
private void btn_CapNhat_Click(object sender, EventArgs e) { if (ExpressionMethod.CheckAuth(this.auth)) { if (btn_CapNhat.Text == "Cập nhật") { btn_XacNhan.Enabled = true; txt_GiaThue.ReadOnly = false; txt_SoNgayThue.ReadOnly = false; btn_CapNhat.Text = "Hủy"; } else { btn_XacNhan.Enabled = false; txt_GiaThue.ReadOnly = true; txt_SoNgayThue.ReadOnly = true; btn_CapNhat.Text = "Cập nhật"; } } }