示例#1
0
        private void CreateDatabase()
        {
            Globals.CurrentPasswordDb = SaveAsDatabase();

            _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
            //_data = _repo.Read();
            _data = new PasswordDatabase();

            var dbSetupForm = new PasswordForm();

            if (dbSetupForm.ShowDialog() == DialogResult.OK)
            {
                _data.Password = dbSetupForm.Password;
                _data.Items.Add(new Entry
                {
                    Title = "Sample",
                    Notes = "Notes go here"
                            //Created = DateTime.Now,
                            //Modified = DateTime.Now
                });

                SaveDatabase();
            }

            LoadData();
        }
示例#2
0
        private void CreateDatabase()
        {
            Globals.CurrentPasswordDb = SaveAsDatabase();

            _repo = new PasswordDatabaseRepository(Globals.CurrentPasswordDb);
            //_data = _repo.Read();
            _data = new PasswordDatabase();

            var dbSetupForm = new PasswordForm();
            if (dbSetupForm.ShowDialog() == DialogResult.OK)
            {
                _data.Password = dbSetupForm.Password;
                _data.Items.Add(new Entry
                {
                    Title = "Sample",
                    Notes = "Notes go here"
                    //Created = DateTime.Now,
                    //Modified = DateTime.Now
                });

                SaveDatabase();
            }

            LoadData();
        }