示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            doctor = new DoctorServiceRef.Doctor();
            string message = "";
            int zip;
            Int32.TryParse(zipTxt.Text, out zip);
            int streetNr;
            Int32.TryParse(streetNrTxt.Text, out streetNr);
            doctor.firstName = firstNameTxt.Text;
            doctor.lastName = lastNameTxt.Text;
            doctor.city = cityTxt.Text;
            doctor.zip = zip;
            doctor.street = streetTxt.Text;
            doctor.streetNr = streetNr;
            doctor.phoneNr = phoneTxt.Text;
            doctor.specialty = specialtyTxt.Text;
            doctor.description = descriptionTxt.Text;
            doctor.login = usernameTxt.Text;
            doctor.pass = passwordTxt.Text;

            var client = new DoctorServiceRef.DoctorServiceClient();
            if (client.SaveDoctor(ref doctor, ref message))
            {
                Dispose();
            }
            else
            {
                new Thread(() => new ErrorWindow(message).ShowDialog()).Start();
            }
        }
示例#2
0
        private void CreateCells(int id)
        {
            doc = doctorService.GetDoctor(id);

            for (int i = 1; i < 8; i++)
            {

                for (int i2 = 0; i2 < dataGridView1.RowCount; i2++)
                {
                    dataGridView1.Rows[i2].Cells[0].Style.BackColor = Color.FromArgb(208, 221, 238);
                    int i3 = 0;
                    Boolean found = false;
                    while (i3 < appointmentList.Count && found == false)
                    {
                        if (appointmentList.ElementAt(i3).doctor.id == doc.id)
                        {
                            string row = dataGridView1.Rows[i2].Cells[0].Value.ToString();
                            string colum = dataGridView1.Columns[i].HeaderCell.Value.ToString();
                            DateTime myDate = DateTime.Parse(colum + row);
                            if (myDate.Equals(appointmentList.ElementAt(i3).time))
                            {
                                dataGridView1.Rows[i2].Cells[i].Style.BackColor = Color.Red;
                                found = true;
                            }
                            else
                            {
                                dataGridView1.Rows[i2].Cells[i].Style.BackColor = Color.Green;
                                i3++;
                            }
                        }
                        else
                        {
                            dataGridView1.Rows[i2].Cells[i].Style.BackColor = Color.Green;
                            i3++;
                        }
                    }
                }
            }
        }
示例#3
0
 public DoctorMenu(DoctorServiceRef.Doctor doctor)
 {
     InitializeComponent();
     this.CenterToScreen();
     this.doctor = doctor;
 }
示例#4
0
        private void setDoctor(int id)
        {
            var doctorService = new DoctorServiceRef.DoctorServiceClient();
            doc = doctorService.GetDoctor(id);

            firstname.Text = doc.firstName;
            lastname.Text = doc.lastName;
            city.Text = doc.city;
            zip.Text = doc.zip.ToString();
            street.Text = doc.street;
            streetnr.Text = doc.streetNr.ToString();
            phonenr.Text = doc.phoneNr;
            description.Text = doc.description;
            speciality.Text = doc.specialty;
        }