Ejemplo n.º 1
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;
     }
 }
Ejemplo n.º 2
0
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in this.dgvtenlienlac.SelectedRows)
     {
         DialogResult dlr = MessageBox.Show("Liên lạc 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)
         {
             QuanlyTenLienLac.XoaTenLienLac(pathDataFile2, row.Cells[2].Value.ToString());
             Activate();
         }
     }
 }
Ejemplo n.º 3
0
 private void dgvtenlienlac_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.dgvtenlienlac.Rows[e.RowIndex];
         txtTenGoi.Text = row.Cells[0].Value.ToString();
         txtEmail.Text  = row.Cells[1].Value.ToString();
         txtSDT.Text    = row.Cells[2].Value.ToString();
         QuanlyTenLienLac TenLienLac = QuanlyTenLienLac.GetTenLienLac(pathDataFile2, row.Cells[0].Value.ToString());
         txtDiaChi.Text = TenLienLac.DiaChi.ToString();
     }
 }
Ejemplo n.º 4
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;
     }
 }
Ejemplo n.º 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            int    ma         = Int32.Parse(QuanlyTenLienLac.getma(pathDataFile)) + 1;
            string malienlac  = "" + ma;
            string tenlienlac = txttenlienlac.Text;
            string diachi     = txtDiaChi.Text;
            string email      = txtEmail.Text;
            string sdt        = txtSoDT.Text;
            string nhom       = txtNhom.Text;
            string lienlacmoi = malienlac + "#" + tenlienlac + "#" + diachi + "#" + email + "#" + sdt + "#" + nhom;

            using (StreamWriter sw = new StreamWriter("C:/Users/VTA/Documents/Visual Studio 2015/Projects/QuanLyDaBa/QuanLyDaBa/Data/TenLienLac.txt", true))
            {
                sw.WriteLine(lienlacmoi);
                MessageBox.Show("Thêm nhóm thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }