Beispiel #1
0
        private void pbook_del_btn_Click(object sender, EventArgs e)
        {
            string name        = name_txt.Text;
            string surname     = surname_txt.Text;
            string phonenumber = phone_txt.Text;
            string address     = address_txt.Text;
            string email       = mail_txt.Text;
            string description = description_txt.Text;

            Person person = new Person(name, surname, phonenumber, address, description, email);

            for (int i = 0; i < people.Count; i++)
            {
                Person person1 = people[i];

                if (person1.IsValidP(name, surname, phonenumber))
                {
                    people.RemoveAt(people.IndexOf(person1));
                    File_Operation.setp_csv(people, Personpath);
                }
            }

            show_userlist();

            personlist.SelectedItems[0].SubItems[0].Text = name;
            personlist.SelectedItems[0].SubItems[1].Text = surname;
            personlist.SelectedItems[0].SubItems[2].Text = phonenumber;
            personlist.SelectedItems[0].SubItems[3].Text = address;
            personlist.SelectedItems[0].SubItems[4].Text = description;
            personlist.SelectedItems[0].SubItems[5].Text = email;
        }
Beispiel #2
0
        private void pbook_add_btn_Click(object sender, EventArgs e)
        {
            string name        = name_txt.Text;
            string surname     = surname_txt.Text;
            string phonenumber = phone_txt.Text;
            string address     = address_txt.Text;
            string email       = mail_txt.Text;
            string description = description_txt.Text;
            Person person      = new Person(name, surname, phonenumber, address, description, email);

            people.Add(person);
            File_Operation.setp_csv(people, Personpath);
            show_userlist();
        }