public IEnumerable <Contact> Get() { JsonDataAccess da = new JsonDataAccess(); Phonebook.Contacts = new List <Contact>(); da.LoadData(); return(Phonebook.Contacts); }
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; }
private void ReadButton_Click(object sender, EventArgs e) { if (Phonebook.Contacts.Count == 0) { var jsonDataAccess = new JsonDataAccess(); jsonDataAccess.LoadData(); } phonebookGridView.DataSource = Phonebook.Contacts; }
static void Main(string[] args) { UserInteraction.Intro(); var jsonDataAccess = new JsonDataAccess(); jsonDataAccess.LoadData(); do { UserInteraction.GetMainAction(); } while (true); }