Exemplo n.º 1
0
        public void AddAppointmentTest()
        {
            // Arrange
            Appointments appointments = new Appointments();
            Appointment  appointment  = new Appointment();

            appointment.DoctorId            = 4;
            appointment.PatientId           = 6;
            appointment.AppointmentTimeId   = 1;
            appointment.AppointmentStatusId = 1;
            appointment.Date    = DateTime.Parse("12-14-2019");
            appointment.Details = "Test Appointment";

            // Act
            var result = appointments.AddAppointment(appointment);

            // Assert
            Assert.IsTrue(result);
        }
Exemplo n.º 2
0
 private void btnAssign_Click(object sender, EventArgs e)
 {
     if (tvPersonnel.SelectedNode != null)
     {
         if (string.IsNullOrEmpty(cmboUnassigned.Text))
         {
             MessageBox.Show("Please select unassigned order", "Select order", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             tvPersonnel.SelectedNode.Nodes.Add(cmboUnassigned.SelectedItem.ToString());
             Installation.AddInstallation(tvPersonnel.SelectedNode.Text);
             Appointments.AddAppointment(dateTimePicker1.Value, cmboAppType.Text, tvPersonnel.SelectedNode.Text);
         }
     }
     else
     {
         MessageBox.Show("Please select technician", "Select Technician", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     //tvPersonnel.SelectedNode.Nodes.Add(cmboUnassigned.SelectedItem.ToString());
     //Installation.AddInstallation(tvPersonnel.SelectedNode.Text);
 }
        private void btnSubmitAppoi_Click(object sender, EventArgs e)
        {
            //validations
            if (txtPatientID.Text == "")
            {
                label16.Visible = true;
            }
            else
            {
                label16.Visible = false;
            }


            if (txtDocID.Text == "")
            {
                label18.Visible = true;
            }
            else
            {
                label18.Visible = false;
            }


            if (txtDocID.Text == "" &&
                txtPatientID.Text == "" &&
                bunifuDatepickerAppoint.Text == "")
            {
                MessageBox.Show("Not Created!! Something error!");
            }

            else
            {
                //------------
                try
                {
                    appoint.AppointmentID = Convert.ToInt32(txtAppointID.Text);
                    appoint.DoctorID      = Convert.ToInt32(txtDocID.Text);
                    appoint.PatientID     = Convert.ToInt32(txtPatientID.Text);
                    appoint.Date          = bunifuDatepickerAppoint.Text;
                    appoint.Time          = comboBoxTime.SelectedItem.ToString();


                    if (appoint.AddAppointment() > 0)
                    {
                        MessageBox.Show("Appointment added successfully!!!");

                        appoint.search();
                        txtAppointID.Text = (appoint.AppointmentID + 1).ToString();
                    }

                    else
                    {
                        MessageBox.Show("Not Added!! Something error!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error" + ex.Message);
                }
            }
        }