示例#1
0
        private void btn_AddPatient_Click(object sender, EventArgs e)
        {
            if (txtbx_AddNameField == null || txtbx_AddAddressField == null || dtp_AddDobSelector == null)
            {
                MessageBox.Show("Error!", "Please Fill all Required Fields Before Adding Patient",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else
            {
                var dob     = dtp_AddDobSelector.Value;
                var name    = txtbx_AddNameField.Text;
                var address = txtbx_AddAddressField.Text;

                var allAppointments = PatientController.AddPatient(name, address, dob);

                if (allAppointments == true)
                {
                    MessageBox.Show("Success!", "Patient added.",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    MessageBox.Show("Error!", "Patient couldn't be added.",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
        }
示例#2
0
        private void addPatientDialog_Click(object sender, EventArgs e)
        {
            Patient patient = new Patient();

            if (!this.ErrorCheck())
            {
                try
                {
                    ZipcodeController zipcodeController = new ZipcodeController();
                    patient.FirstName            = this.firstname_textbox.Text;
                    patient.LastName             = this.lastname_textbox.Text;
                    patient.Phone                = this.phoneNumber_textbox.Text;
                    patient.SocialSecurityNumber = this.ssn_textbox.Text;
                    patient.Zipcode              = this.zipcode_textbox.Text;
                    patient.State                = zipcodeController.GetStateFromZipcode(patient.Zipcode);
                    patient.City          = zipcodeController.GetCityFromZipcode(patient.Zipcode);
                    patient.DateOfBirth   = this.dateOfBirth_DateTimePicker.Value;
                    patient.Gender        = this.gender_ComboBox.Text;
                    patient.StreetAddress = this.streetAddress_textbox.Text;
                    patient.Status        = 1;
                    PatientController patientController = new PatientController();
                    patientController.AddPatient(patient);

                    this.DialogResult = DialogResult.Yes;
                    this.Close();
                }
                catch (Exception)
                {
                    this.ErrorCheck();
                }
            }
        }
示例#3
0
        public void IntegrationTest_EnsureDatabaseIsWritable_ReturnsTrueIfPatientCreated()
        {
            var expected = true;
            var name     = patientForCommands[NAME_COLUMN].ToString();
            var dob      = patientForCommands[DOB_COLUMN].ToString();
            var address  = patientForCommands[ADDRESS_COLUMN].ToString();

            var isSuccessful = PatientController.AddPatient(name, address, Convert.ToDateTime(dob));

            Assert.That(isSuccessful, Is.EqualTo(expected));
        }
        public void GivenPatientInfoThenAddNewPatientToDatabaseAndReturnOk()
        {
            var test = new Patient()
            {
                Name    = "Subject Z",
                Contact = "1111777790",
                IcuId   = 2,
                BedId   = 1
            };
            var res = controller.AddPatient(test);

            Assert.True(res == HttpStatusCode.OK);
        }
        public void AddPatient_ShouldAdd()
        {
            Patient expected = new Patient("Foo", "To Add");
            Patient actual;

            _controller.AddPatient(expected);
            actual = _controller.GetPatient(expected.Id);

            Assert.Equal(expected, actual);
        }
        private void btnSignUp_Click(object sender, EventArgs e)
        {
            Patient patient = new Patient
            {
                PatientFirstName = txtSignUpName.Text,
                PatientLastName  = txtSignUpSurname.Text,
                PatientEmail     = txtSignUpEmail.Text,
                PatientPassword  = txtSignUpPassword.Text
            };

            if (patientController.isNullPatient(patient))
            {
                MessageBox.Show("Ad ve Soyad alanı boş geçilemez");
            }
            else if (!patientController.SignUpControl(patient))
            {
                MessageBox.Show("Email biçimi geçersiz");
            }
            else if (!patientController.PasswordLengthControl(patient))
            {
                MessageBox.Show("Parolanız 8-16 Karakter uzunluğunda olmalı. Özel karakter içermemeli !");
            }
            else
            {
                if (patientController.IsExistsPatientEmail(patient))
                {
                    if (patientController.AddPatient(patient))
                    {
                        MessageBox.Show("Kayıt başarılıdır.");
                    }
                    else
                    {
                        MessageBox.Show("Kayıt başarısız.");
                    }
                }
                else
                {
                    MessageBox.Show("Kayıtlı email hesabı.");
                }
            }
        }
        private void btnPatientMemberSave_Click(object sender, EventArgs e)
        {
            long   tc       = Convert.ToInt64(txtPatientPersonelIdentifyNumber.Text);
            string username = txtNewPatientEmail.Text.Trim();
            string password = txtNewPatientPassword.Text.Trim();

            Patient patient = new Patient
            {
                FirstName = txtPatientName.Text.Trim(),
                LastName  = txtPatientSurname.Text.Trim(),
                Phone     = txtPatientPhone.Text.Trim(),
                BirthDate = Convert.ToDateTime(dateTimePicker1.Value.ToShortDateString()),
                TCNumber  = tc,
                Gender    = Convert.ToBoolean(cmbGender.SelectedValue),
            };
            var result = patientController.AddPatient(patient);



            if (LoginDetailCheck(username, password) == false)
            {
                lblWarning.Text = "E-Mail/Şifreyi Düzgün Formatta Giriniz!";
            }
            else
            {
                var result2 = patientManagement.SearchPatient(tc);
                PatientLoginDetail patientLoginDetail = new PatientLoginDetail
                {
                    PatientId = result2,
                    UserName  = username,
                    Password  = password,
                    Status    = true
                };

                patientLoginDetailManagement.AddPatientLoginDetail(patientLoginDetail);
            }

            //Gb_PatientDetailClear();
        }
示例#8
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (isValidData())
     {
         person  = new Person();
         patient = new Patient();
         this.PutPersonData(person);
         try
         {
             //Inserts the Person into the table and stores PersonID
             person.PersonID = inController.AddPerson(person);
             //Passes PersonID from Person to Patient
             patient.PersonID = person.PersonID;
             //Inserts Patient by using PersonID
             inController.AddPatient(patient);
             MessageBox.Show("The patient was successfully added.");
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, ex.GetType().ToString());
         }
     }
 }