private void btnLuuMoi_Click(object sender, EventArgs e) { Object obj = checkAndReturnThuongHieu(); if (obj is String) { MessageBox.Show(obj.ToString()); return; } if (busThuongHieu.editThuongHieu((DTO_ThuongHieu)obj)) { String thongBao = "Sửa mới thành công!"; TBThemSuaXoa tBSua = new TBThemSuaXoa(thongBao); tBSua.ShowDialog(); this.Close(); this.isClickSua = true; } else { MessageBox.Show("Lỗi phần mềm!"); } }
private void btnXoa_Click(object sender, EventArgs e) { if (lvwGiay.SelectedItems.Count > 0) { TBXoa tbXoa = new TBXoa(); tbXoa.ShowDialog(); if (tbXoa.isClickXoa) { ListViewItem item = lvwGiay.SelectedItems[0]; if (busGiay.deleteGiay(item.SubItems[2].Text)) { String thongBao = "Xóa thành công!"; TBThemSuaXoa tBThemSuaXoa = new TBThemSuaXoa(thongBao); tBThemSuaXoa.ShowDialog(); loadDataGiay(); } else { MessageBox.Show("Lỗi phần mềm!"); } } } }