Пример #1
0
        //thêm liên lạc
        private void Btnthemlienlac_Click(object sender, EventArgs e)
        {
            dtgvnhom.CurrentRow.Selected = true;
            string tennhom = dtgvnhom.SelectedCells[0].Value.ToString();
            string manhom  = Nhom.getMaTuTenNhom(tennhom, path);

            var addlienlac = new Addlienlac(this, manhom);

            addlienlac.Show();
        }
Пример #2
0
        // Refresh dtgvLienLac
        public void refreshDtgvLienLac()
        {
            dtgvnhom.CurrentRow.Selected = true;
            string tenNhom = dtgvnhom.SelectedCells[0].Value.ToString();
            string maNhom  = Nhom.getMaTuTenNhom(tenNhom, path);

            dtgvlienlac.AutoGenerateColumns = false;
            dtgvlienlac.DataSource          = LienLac.getLienLacTuMaNhom(maNhom, path1);
            dtgvlienlac.Refresh();
        }
Пример #3
0
        //kích chuột vào tên nhóm và hiển thị thông tin ra dtgv liên lạc
        private void Dtgvnhom_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int index = e.RowIndex;

            if (index >= 0)
            {
                DataGridViewRow selectRow = dtgvnhom.Rows[index];
                string          tenNhom   = selectRow.Cells["TenNhom"].Value.ToString();
                string          maNhom    = Nhom.getMaTuTenNhom(tenNhom, path);

                dtgvlienlac.AutoGenerateColumns = false;
                dtgvlienlac.DataSource          = LienLac.getLienLacTuMaNhom(maNhom, path1);
            }
        }
Пример #4
0
        //xóa nhóm
        private void Btnxoanhom_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(
                    "Ban co that su muon xoa khong?",
                    "Thong bao",
                    MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.OK)
            {
                bool flag = dtgvnhom.CurrentRow.Selected;
                if (flag)
                {
                    string tenNhom = dtgvnhom.SelectedCells[0].Value.ToString();
                    string maNhom  = Nhom.getMaTuTenNhom(tenNhom, path);
                    Nhom.xoaNhom(path, maNhom);
                }

                MessageBox.Show("Da xoa thanh cong!",
                                "Thong bao", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //refresh
            refreshdtgvnhom();
        }