Пример #1
0
        private void cbChoseDoctor_SelectedIndexChanged(object sender, EventArgs e)
        {
            ResetRadioButtons();
            RadioButtonsEnabledFalse();

            using (var client = new HaServiceClient())
            {
                var item = cbChoseDoctor.SelectedItem as Doctor;

                _doctor = client.GetDoctorById(item.DoctorId); // cbChoseDoctor.SelectedItem.V  Value.ToString());
            }

            mcThisMonth.Enabled = true;

            mcThisMonth.RemoveAllBoldedDates();
            DateTime today   = DateTime.Now;
            DateTime endDate = today.AddMonths(1);

            while (today <= endDate)
            {
                if (today.DayOfWeek == DayOfWeek.Monday && _doctor.DaysOfReceiving.Mondey == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Tuesday && _doctor.DaysOfReceiving.Tuesday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Wednesday && _doctor.DaysOfReceiving.Wednesday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Thursday && _doctor.DaysOfReceiving.Thursday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Friday && _doctor.DaysOfReceiving.Friday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Saturday && _doctor.DaysOfReceiving.Satarday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                if (today.DayOfWeek == DayOfWeek.Sunday && _doctor.DaysOfReceiving.Sunday == true)
                {
                    mcThisMonth.AddBoldedDate(today);
                }
                today = today.AddDays(1);
            }
            mcThisMonth.UpdateBoldedDates();
        }
Пример #2
0
        private void btEditDocPasConfirm_Click(object sender, EventArgs e)
        {
            using (var client = new HaServiceClient())
            {
                _doctor = client.GetDoctorById(_doctorId);
                string confirm = tbEditDocCurrentPassword.Text.Trim();
                var    hash    = client.VerefyAuthDoc(_doctor.LoginD, confirm)?.HashD;
                if (confirm.Length < 6 || confirm.Length > 30 || hash == null)
                {
                    tsslEditDocPas.ForeColor = Color.Crimson;
                    tsslEditDocPas.Text      = "Invadid password";
                    return;
                }

                if (hash == _doctor.HashD)
                {
                    tbEditDocPassword.Enabled       = true;
                    tbEditDocPasswordRepeat.Enabled = true;
                    tsslEditDocPas.ForeColor        = Color.Blue;
                    tsslEditDocPas.Text             = "Enter new password";
                }
            }
        }
Пример #3
0
        public void RefreshUcDoc()
        {
            FillDoctorListView();
            //Doctor doc = new Doctor();
            using (var client = new HaServiceClient())
            {
                _doctor = client.GetDoctorById(_doctor.DoctorId);
            }
            labelDocName.Text  = _doctor.FirstName;
            labelWorkDays.Text = "";

            if (_doctor.DaysOfReceiving.Mondey == true)
            {
                labelWorkDays.Text = "M";
            }
            if (_doctor.DaysOfReceiving.Tuesday == true)
            {
                labelWorkDays.Text += "  T";
            }
            if (_doctor.DaysOfReceiving.Wednesday == true)
            {
                labelWorkDays.Text += "  W";
            }
            if (_doctor.DaysOfReceiving.Thursday == true)
            {
                labelWorkDays.Text += "  Th";
            }
            if (_doctor.DaysOfReceiving.Friday == true)
            {
                labelWorkDays.Text += "  F";
            }
            if (_doctor.DaysOfReceiving.Satarday == true)
            {
                labelWorkDays.Text += "  St";
            }
            if (_doctor.DaysOfReceiving.Sunday == true)
            {
                labelWorkDays.Text += "  S";
            }

            labelTimeDoc.Text = "";
            if (_doctor.DaysOfReceiving.TimeOfReceiving.T10_00 == true)
            {
                labelTimeDoc.Text = "10:00";
            }
            if (_doctor.DaysOfReceiving.TimeOfReceiving.T10_20 == true)
            {
                labelTimeDoc.Text += "  10:20";
            }
            if (_doctor.DaysOfReceiving.TimeOfReceiving.T10_40 == true)
            {
                labelTimeDoc.Text += "  10:40";
            }
            if (_doctor.DaysOfReceiving.TimeOfReceiving.T11_00 == true)
            {
                labelTimeDoc.Text += "  11:00";
            }
            if (_doctor.DaysOfReceiving.TimeOfReceiving.T12_00 == true)
            {
                labelTimeDoc.Text += "  12:00";
            }
        }