Exemple #1
0
 private void editProfileButton_Click(object sender, EventArgs e)
 {
     if (firstNameTextBox.Enabled == false)
     {
         firstNameTextBox.Enabled = true;
         lastNameTextBox.Enabled  = true;
         editProfileButton.Text   = "Подтвердить изменения";
     }
     else
     {
         Person person = new Person()
         {
             FirstName = firstNameTextBox.Text,
             LastName  = lastNameTextBox.Text,
             Login     = loginLabel.Text.Split()[1]
         };
         PersonStorage personStorage = new PersonStorage();
         List <Person> persons       = personStorage.EditPerson(Person, person);
         personStorage.SavePersons();
         firstNameTextBox.Enabled = false;
         lastNameTextBox.Enabled  = false;
         editProfileButton.Text   = "Изменить данные";
         MessageBox.Show("Изменения вступят после перезагрузки");
     }
 }
Exemple #2
0
        public void SaveStatistic(List <PersonStatistic> personStatistics)
        {
            PersonStorage personStorage = new PersonStorage();

            personStorage.persons[personStorage.LoginSearch(Login)].PersonStatistics = personStatistics;
            personStorage.SavePersons();
        }
Exemple #3
0
        public List <Section> LoadSections()
        {
            PersonStorage personStorage = new PersonStorage();

            Sections = personStorage.persons[personStorage.LoginSearch(Login)].Sections;
            return(Sections);
        }
Exemple #4
0
        public void SaveSections(List <Section> sections)
        {
            PersonStorage personStorage = new PersonStorage();

            personStorage.persons[personStorage.LoginSearch(Login)].Sections = sections;
            personStorage.SavePersons();
        }
Exemple #5
0
        private void deletePersonButton_Click(object sender, EventArgs e)
        {
            PersonStorage personStorage = new PersonStorage();
            List <Person> persons       = personStorage.DeletePerson(Person);

            personStorage.SavePersons();
            Person.FirstName = null;
            this.Close();
        }