private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            // Check if all the text boxes have been properly filled in
            if (string.IsNullOrWhiteSpace(FirstNameTextBox.Text) || string.IsNullOrWhiteSpace(LastNameTextBox.Text) || string.IsNullOrWhiteSpace(DOBTextbox.Text))
            {
                MessageBox.Show("Please fill in all appropriate fields");
                return;
            }

            // Assign all the values to the current patient model to be saved
            PatientModel patientModel = new PatientModel()
            {
                FirstName   = FirstNameTextBox.Text,
                LastName    = LastNameTextBox.Text,
                DOB         = DOBTextbox.Text,
                Address     = AddressTextbox.Text,
                DateCreated = DateTime.Now.ToString("MMMM dd, yyyy"),
                LastUpdate  = DateTime.Now.ToString("MMMM dd, yyyy"),
            };

            using (SQLiteConnection connection = new SQLiteConnection(DatabaseHelper.databasePath))
            {
                // Check if the table is present
                connection.CreateTable <PatientModel>();

                // Insert the patient into the table
                connection.Insert(patientModel);
            }

            Close();
            CentralViewModel.RefreshPatientSearch();
        }
 protected void setViewModels()
 {
     ViewModels[0] = new NorthWestViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[1] = new NorthViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[2] = new NorthEastViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[3] = new WestViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[4] = new CentralViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[5] = new EastViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[6] = new SouthWestViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[7] = new SouthViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[8] = new SouthEastViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
     ViewModels[9] = new ExceptionalViewModel(this, Mvx.IoCProvider.Resolve <IMvxNavigationService>());
 }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     Close();
     CentralViewModel.RefreshPatientSearch();
 }
Ejemplo n.º 4
0
 public void RefreshClicked_Always_ReturnMoreThanOneArtist()
 {
     centralVM = new CentralViewModel();
     centralVM.RefreshClicked();
     Assert.AreNotEqual(centralVM.Items.Count, 0);
 }
Ejemplo n.º 5
0
 public void InitializeCentralMVVM_Always_ReturnMoreThanOneArtist()
 {
     centralVM = new CentralViewModel();
     Assert.AreNotEqual(centralVM.Items.Count, 0);
 }
Ejemplo n.º 6
0
        public void GetArtists_Always_ExpectAtLeastOneArtist()
        {
            var CentralVM = new CentralViewModel();

            Assert.That(CentralVM.Items.Count, Is.AtLeast(1));
        }