public IEnumerable <Contact> Get()
        {
            JsonDataAccess da = new JsonDataAccess();

            Phonebook.Contacts = new List <Contact>();
            da.LoadData();
            return(Phonebook.Contacts);
        }
示例#2
0
        private void RefreshDataButton_Click(object sender, EventArgs e)
        {
            var dataAccess = new JsonDataAccess();

            Phonebook.Contacts = new List <Contact>();
            dataAccess.LoadData();
            phonebookGridView.DataSource = null;
            phonebookGridView.DataSource = Phonebook.Contacts;
        }
示例#3
0
        private void ReadButton_Click(object sender, EventArgs e)
        {
            if (Phonebook.Contacts.Count == 0)
            {
                var jsonDataAccess = new JsonDataAccess();
                jsonDataAccess.LoadData();
            }

            phonebookGridView.DataSource = Phonebook.Contacts;
        }
示例#4
0
        static void Main(string[] args)
        {
            UserInteraction.Intro();
            var jsonDataAccess = new JsonDataAccess();

            jsonDataAccess.LoadData();
            do
            {
                UserInteraction.GetMainAction();
            } while (true);
        }