예제 #1
0
        private void pbXoa_DP_Click(object sender, EventArgs e)
        {
            pbXoa_DP.Focus();
            frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin_DP.SelectedItems.Count + " dữ liệu?");
            if (frm_Confirm.Yes)
            {
                for (int i = 0; i < lvThongTin_DP.SelectedItems.Count; i++)
                {
                    if (SuKien_DieuPhoi_BUS.Delete(iMaSuKien, int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text)))
                    {
                        if (!DieuPhoi_BUS.Delete(int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text)))
                        {
                            SuKien_DieuPhoi dto_Temp = new SuKien_DieuPhoi();
                            dto_Temp.MaSuKien = iMaSuKien;
                            dto_Temp.MaDieuPhoi = int.Parse(lvThongTin_DP.SelectedItems[i].SubItems[0].Text);
                            SuKien_DieuPhoi_BUS.Insert(dto_Temp);

                            frm_Notice = new Form_Notice("Không thể xóa Hồ Sơ " + lvThongTin_DP.SelectedItems[i].SubItems[0].Text + "!", false);
                            break;
                        }
                    }
                    else
                    {
                        frm_Notice = new Form_Notice("Không thể xóa Hồ Sơ " + lvThongTin_DP.SelectedItems[i].SubItems[0].Text + "!", false);
                        break;
                    }
                }

                refreshListView_DP(list_DonViHanhChanh[cbDonViHanhChanh.SelectedIndex], list_TrachVuSuKien[cbTrachVuSuKien.SelectedIndex]);
            }
        }
예제 #2
0
 private void pbXoa_Click(object sender, EventArgs e)
 {
     frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?");
     if (frm_Confirm.Yes)
     {
         for (int i = 0; i < lvThongTin.SelectedItems.Count; i++)
         {
             if (!DeleteHoSo(lvThongTin.SelectedItems[i].SubItems[0].Text))
             {
                 frm_Notice = new Form_Notice("Không thể xóa Hồ Sơ " + lvThongTin.SelectedItems[i].SubItems[0].Text + "!", "Vẫn còn ...!", false);
                 break;
             }
         }
         refreshListView();
     }
 }
예제 #3
0
 private void pbXoa_Click(object sender, EventArgs e)
 {
     Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?");
     if (frm_Confirm.Yes)
     {
         for (int i = 0; i < lvThongTin.SelectedItems.Count; i++)
         {
             if (!NhomTrachVu_BUS.Delete(lvThongTin.SelectedItems[i].SubItems[0].Text))
             {
                 Form_Notice frm = new Form_Notice("Không thể xóa!", "Vẫn còn Trách vụ có Nhóm trách vụ này!", false);
                 break;
             }
         }
         refreshListView();
     }
 }
예제 #4
0
 private void pbXoa_Click(object sender, EventArgs e)
 {
     Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?");
     if (frm_Confirm.Yes)
     {
         for (int i = 0; i < lvThongTin.SelectedItems.Count; i++)
         {
             if (!SuKien_BUS.Delete(int.Parse(lvThongTin.SelectedItems[i].SubItems[0].Text)))
             {
                 Form_Notice frm_Notice = new Form_Notice("Không thể xóa!", "Vẫn còn Hồ sơ có sự kiện này!", false);
                 break;
             }
         }
         refreshListView();
     }
 }
예제 #5
0
 private void pbDelete_Click(object sender, EventArgs e)
 {
     Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa Khóa này?");
     if (frm_Confirm.Yes)
     {
         this.Visible = false;
     }
 }
예제 #6
0
        private void pbXoa_Click(object sender, EventArgs e)
        {
            Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?");
            if (frm_Confirm.Yes)
            {
                for (int i = 0; i < lvThongTin.SelectedItems.Count; i++)
                {
                    if (SuKien_DonViHanhChanh_BUS.Delete(iMaSuKien, int.Parse(lvThongTin.SelectedItems[i].SubItems[0].Text)))
                    {
                        if (!DonViHanhChanh_BUS.Delete(int.Parse(lvThongTin.SelectedItems[i].SubItems[0].Text)))
                        {
                            SuKien_DonViHanhChanh dto_Temp = new SuKien_DonViHanhChanh();
                            dto_Temp.MaSuKien = iMaSuKien;
                            dto_Temp.MaDonViHanhChanh = int.Parse(lvThongTin.SelectedItems[i].SubItems[0].Text);
                            SuKien_DonViHanhChanh_BUS.Insert(dto_Temp);

                            Form_Notice frm = new Form_Notice("Không thể xóa!", "Vẫn còn TVSK có ĐVHC này!", false);
                            break;
                        }
                    }
                    else
                    {
                        Form_Notice frm = new Form_Notice("Không thể xóa!", "Vui lòng thử lại!", false);
                        break;
                    }
                }

                refreshListView();
            }
        }
예제 #7
0
        private void pbDelete_Click(object sender, EventArgs e)
        {
            Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa Lưu trữ này?");
            if (frm_Confirm.Yes)
            {
                if (!deleteLuuTru())
                {
                    Form_Notice frm_Notice = new Form_Notice("Không thể xóa Lưu trữ này!", false);
                }
                else
                {
                    setLuuTruTheoMaHoSo(sMaHoSo);

                    if (lvLuuTru.Items.Count > 0)
                    {
                        lvLuuTru.SelectedItems.Clear();
                        lvLuuTru.Items[lvLuuTru.Items.Count - 1].Selected = true;
                    }
                }
            }
        }
예제 #8
0
        private void pbXoa_Click(object sender, EventArgs e)
        {
            Form_Confirm frm_Confirm = new Form_Confirm("Đồng ý xóa " + lvThongTin.SelectedItems.Count + " dữ liệu?");

            if (frm_Confirm.Yes)
            {
                string sPath = Application.StartupPath + @"\Addin\" + Form_Main.list_Plugin[lvThongTin.SelectedIndices[0]].GetPluginFullName() + ".addin";
                Form_Main.list_Plugin.RemoveAt(lvThongTin.SelectedIndices[0]);

                if (File.Exists(sPath))
                {
                    try
                    {
                        File.Delete(sPath);

                        refreshListView();
                    }
                    catch
                    {
                        Form_Notice frm = new Form_Notice("Không thể xóa Plugin!", "Vui lòng thử lại.", false);
                    }
                }
            }
        }