Ejemplo n.º 1
0
        public void TestMethod1()
        {
            DBConnection      con  = new DBConnection();
            DatabaseConverter test = new DatabaseConverter(con, new Patient());

            Patient p = test.findPatientByName("as", "as");

            Assert.AreEqual(p.ID, 210);
        }
Ejemplo n.º 2
0
        /**
         * This button returns one patient from the database as an object
         * can be by name or nhs number
         * */
        private void OK_Click(object sender, EventArgs e)
        {
            //local string
            string firstName = firstText.Text;
            string lastName  = lastText.Text;



            if (!firstName.Equals("") && !lastName.Equals(""))
            {
                //get patient from the database (find method)
                found = converter.findPatientByName(firstName, lastName);

                //add patient details to the search box
                searchBox.Items.Add(found.FirstName + " " + found.LastName);
                textBoxCleaner(firstText);
                textBoxCleaner(lastText);
            }
            else
            {
                MessageBox.Show("Please enter patient name");
            }
        }