public void NwpzValidationTestPos()
 {
     if (!Physiotherapist.NwpzValidation("1234"))
     {
         Assert.Fail();
     }
 }
 public void NwpzValidationTestNeg4()
 {
     if (Physiotherapist.NwpzValidation(""))
     {
         Assert.Fail();
     }
 }
Exemplo n.º 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Physiotherapist physiotherapist = db.Physiotherapist.Find(id);

            db.Physiotherapist.Remove(physiotherapist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "Id,Email,Npwz,Name,Surname,Adress,Phone")] Physiotherapist physiotherapist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(physiotherapist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(physiotherapist));
 }
 public async void OnAppear(ExerciseViewModel exercise)
 {
     BindingContext = exercise;
     if (exercise.IsRecommended)
     {
         note.Text = exercise.Recommendation.Note;
         Physiotherapist physiotherapist = await new PhysiotherapistController().GetPhysiotherapistAsync(exercise.Recommendation.PhysiotherapistId);
         physName.Text = physiotherapist.FullName;
     }
 }
Exemplo n.º 6
0
        public ActionResult Create([Bind(Include = "Id,Email,Npwz,Name,Surname,Adress,Phone")] Physiotherapist physiotherapist)
        {
            if (ModelState.IsValid)
            {
                db.Physiotherapist.Add(physiotherapist);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(physiotherapist));
        }
Exemplo n.º 7
0
        // GET: Physiotherapists/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Physiotherapist physiotherapist = db.Physiotherapist.Find(id);

            if (physiotherapist == null)
            {
                return(HttpNotFound());
            }
            return(View(physiotherapist));
        }
        private void BtDeletePhysio_Click(object sender, RoutedEventArgs e)
        {
            Physiotherapist p1 = (Physiotherapist)physiotherapistDataGrid.SelectedItem;

            if (p1 != null)
            {
                MessageBoxResult result = System.Windows.MessageBox.Show("Czy usunąć fizjoterapeutę " + TbPhysioName.Text + " " + TbPhysioSurname.Text + "?", "Usuwanie pacjenta", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    Physiotherapist.DeletePhysiotherapist(p1, dbcontext);
                }
            }
            physiotherapistDataGrid.Items.Refresh();
        }
        public void GetPhysiotherapist_Patient_Successful()
        {
            // Arrange
            Helpers.PatientLogin();

            // Act
            Physiotherapist physiotherapist = PhysiotherapistResource.GetPhysiotherapist(6);

            // Assert
            Assert.AreEqual(6, physiotherapist.Id);
            Assert.AreEqual("Hans", physiotherapist.FirstName);
            Assert.AreEqual("Petersen", physiotherapist.LastName);
            Assert.AreEqual("*****@*****.**", physiotherapist.Email);
            Assert.AreEqual(1, physiotherapist.OrganisationId);
        }
Exemplo n.º 10
0
 private void BtAddPhysio_Click(object sender, RoutedEventArgs e)
 {
     if (TbPhysioName.Text != "" && TbPhysioSurname.Text != "")
     {
         if (Physiotherapist.NwpzValidation(TbPhysioNpwz.Text) && TbPhysioNpwz.Text != "")
         {
             MessageBoxResult result = MessageBox.Show("Czy zapisać fizjoterapeutę " + TbPhysioName.Text + " " + TbPhysioSurname.Text + "?", "Zapis", MessageBoxButton.YesNo);
             if (result == MessageBoxResult.Yes)
             {
                 Physiotherapist.AddPhysiotherapist(TbPhysioName.Text, TbPhysioSurname.Text, TbPhysioAdress.Text, TbPhysioPhone.Text, TbPhysioEmail.Text, int.Parse(TbPhysioNpwz.Text), dbcontext);
                 physiotherapistDataGrid.Items.Refresh();
                 TbPhysioName.Clear(); TbPhysioAdress.Clear(); TbPhysioNpwz.Clear(); TbPhysioPhone.Clear(); TbPhysioSurname.Clear(); TbPhysioEmail.Clear();
             }
         }
         else
         {
             MessageBox.Show("Podaj poprawny numer Numer Prawa Wykonywania Zawodu!");
         }
     }
     else
     {
         MessageBox.Show("Podaj imię i nazwisko!");
     }
 }
Exemplo n.º 11
0
 private void BtSearchPhysio_Click(object sender, RoutedEventArgs e)
 {
     physiotherapistViewSource.Source = Physiotherapist.SearchPhysiotherapist(TbPhysioName.Text, TbPhysioSurname.Text, TbPhysioAdress.Text, TbPhysioPhone.Text, TbPhysioEmail.Text, TbPhysioNpwz.Text, dbcontext).ToList();
 }