Esempio n. 1
0
        private void btAddDoc_Click(object sender, EventArgs e)
        {
            Doctor doc = new Doctor();

            doc.FirstName  = tbDocName.Text;
            doc.LastName   = tbLastName.Text;
            doc.SecondName = tbSecondName.Text;
            doc.LoginD     = tbDocLogin.Text;
            doc.Role       = "Doctor";


            DaysOfReceiving dor = new DaysOfReceiving();

            if (clbDay.GetItemCheckState(0) == CheckState.Checked)
            {
                dor.Mondey = true;
            }
            if (clbDay.GetItemCheckState(1) == CheckState.Checked)
            {
                dor.Tuesday = true;
            }
            if (clbDay.GetItemCheckState(2) == CheckState.Checked)
            {
                dor.Wednesday = true;
            }
            if (clbDay.GetItemCheckState(3) == CheckState.Checked)
            {
                dor.Thursday = true;
            }
            if (clbDay.GetItemCheckState(4) == CheckState.Checked)
            {
                dor.Friday = true;
            }
            if (clbDay.GetItemCheckState(5) == CheckState.Checked)
            {
                dor.Satarday = true;
            }
            if (clbDay.GetItemCheckState(6) == CheckState.Checked)
            {
                dor.Sunday = true;
            }

            TimeOfReceiving time = new TimeOfReceiving();

            if (clbTime.GetItemCheckState(0) == CheckState.Checked)
            {
                time.T10_00 = true;
            }
            if (clbTime.GetItemCheckState(1) == CheckState.Checked)
            {
                time.T10_20 = true;
            }
            if (clbTime.GetItemCheckState(2) == CheckState.Checked)
            {
                time.T10_40 = true;
            }
            if (clbTime.GetItemCheckState(3) == CheckState.Checked)
            {
                time.T11_00 = true;
            }
            if (clbTime.GetItemCheckState(4) == CheckState.Checked)
            {
                time.T12_00 = true;
            }

            dor.TimeOfReceiving = time;
            doc.DaysOfReceiving = dor;

            using (var client = new HaServiceClient())
            {
                //doc.Specialty = client.GetSpecialtyByName(cbChoseSpesialty.SelectedItem.ToString());//. SelectedText);
                doc.HashD = client.CreateHashOnServer(tbDocPassword.Text);
                client.AddDoctorOnContext(doc,
                                          client.GetSpecialtyByName(cbChoseSpesialty.SelectedItem.ToString()).SpecialtyId);
            }
            FillDoctorListView();
        }