Ejemplo n.º 1
0
        private void BtnThem_Click(object sender, EventArgs e)
        {
            var f = new frmContactInfo(null);;

            if (f.ShowDialog() == DialogResult.OK)
            {
                var newContactListNoSort = ContactService.GetAllContact(pathContactFile);
                var newContactList       = newContactListNoSort.OrderBy(x => x.Name);
                bdsContact.DataSource = newContactList;
                bdsContact.ResetBindings(true);
            }
        }
Ejemplo n.º 2
0
        private void BtnThem_Click(object sender, EventArgs e)
        {
            var f = new frmContactInfo(null);;

            if (f.ShowDialog() == DialogResult.OK)
            {
                //Tiến hành nạp lại dữ liệu lên lưới
                var            newContactListNoSort = ContactService.GetAllContact(pathContactFile);
                List <Contact> newContactList       = newContactListNoSort.OrderBy(x => x.Name).ToList();
                bdsContact.DataSource = newContactList;
                bdsContact.ResetBindings(true);
                AddNewLabel();
            }
        }
        private void BtnThem_Click(object sender, EventArgs e)
        {
            //var  = (HistoryLearning)bdsQuaTrinhHocTap.Current;
            //var idStudent = hl.IDStudent;
            var f = new frmContactInfo(null);;

            if (f.ShowDialog() == DialogResult.OK)
            {
                //Tiến hành nạp lại dữ liệu lên lưới
                var newContactListNoSort = ContactService.GetAllContact(pathContactFile);
                var newContactList       = newContactListNoSort.OrderBy(x => x.Name);
                bdsContact.DataSource = newContactList;
                bdsContact.ResetBindings(true);
            }
        }
        private void BtnSua_Click(object sender, EventArgs e)
        {
            var contact = bdsContact.Current as Contact;

            if (contact != null)
            {
                var f = new frmContactInfo(contact);
                if (f.ShowDialog() == DialogResult.OK)
                {
                    //Tiến hành nạp lại dữ liệu lên lưới
                    var newContactListNoSort = ContactService.GetAllContact(pathContactFile);
                    var newContactList       = newContactListNoSort.OrderBy(x => x.Name);
                    bdsContact.DataSource = newContactList;
                    bdsContact.ResetBindings(true);
                }
            }
        }