void OnNewButtonClicked(object sender, EventArgs e)
        {
            string dpath = Path.Combine
                               (Environment.GetFolderPath
                                   (Environment.SpecialFolder.LocalApplicationData), "dbpeople.db");

            PersonRepositoryCRUD PersonRepo = new PersonRepositoryCRUD(dpath);

            string name = EntPersonName.Text;

            Person newPerson = new Person();

            newPerson.Name = name;

            PersonRepo.CreatePerson(newPerson);

            labelStatusMassage.Text = PersonRepo.StatusMessage;
        }
Beispiel #2
0
        void OnNewButtonClicked(object sender, EventArgs e)
        {
            // Get data base path
            string dbPath =
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "dbPeople.db");
            PersonRepositoryCRUD PersonRepo = //NombreVariable.Miembro
                                              new PersonRepositoryCRUD(dbPath);

            string Name = EntryPersonName.Text;

            //Crear un objeto person
            Person newPerson = new Person();

            newPerson.name = Name;

            PersonRepo.CreatePerson(newPerson);

            LabelStatusMessage.Text = PersonRepo.StatusMessage;
        }