예제 #1
0
 private void tsbXoaNhom_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in this.dgvnhom.SelectedRows)
     {
         DialogResult dlr = MessageBox.Show("Nhóm bị xóa sẽ không thể khôi phục lại dc : " + row.Cells[0].Value.ToString(), "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (dlr == DialogResult.Yes)
         {
             QuanLyNhom.XoaNhom(pathDataFile, row.Cells[0].Value.ToString());
         }
     }
 }
예제 #2
0
 private void txtTimKiem_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         string tennhom = txtTimKiem.Text;
         quanlynhom2 = QuanLyNhom.GetFromFile(pathDataFile, tennhom);
         quanlynhom2.ListTenLienLac = QuanlyTenLienLac.GetNhom(pathDataFile2, quanlynhom2.TenNhom);
         bdstenlienlac.DataSource   = quanlynhom2.ListTenLienLac;
         dgvtenlienlac.DataSource   = bdstenlienlac;
     }
 }
예제 #3
0
 private void dgvnhom_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         //Lưu lại dòng dữ liệu vừa kích chọn
         DataGridViewRow row = this.dgvnhom.Rows[e.RowIndex];
         //Đưa dữ liệu vào textbox
         string tennhom = row.Cells[0].Value.ToString();
         quanlynhom2 = QuanLyNhom.GetFromFile(pathDataFile, tennhom);
         quanlynhom2.ListTenLienLac = QuanlyTenLienLac.GetNhom(pathDataFile2, quanlynhom2.TenNhom);
         bdstenlienlac.DataSource   = quanlynhom2.ListTenLienLac;
         dgvtenlienlac.DataSource   = bdstenlienlac;
     }
 }
예제 #4
0
        public ftmQuanLyDaBa()
        {
            InitializeComponent();

            pathDataFile  = Application.StartupPath + @"\Data\Nhom.txt";
            pathDataFile2 = Application.StartupPath + @"\Data\TenLienLac.txt";
            quanlynhom    = QuanLyNhom.GetListFromFile(pathDataFile);
            dgvnhom.AutoGenerateColumns       = false;
            dgvtenlienlac.AutoGenerateColumns = false;
            if (quanlynhom == null)
            {
                throw new Exception(" Không tồn tại ");
            }
            else
            {
                bdsNhom.DataSource = quanlynhom;
                dgvnhom.DataSource = bdsNhom;
            }
        }