Example #1
0
        private void buttonEditFindRendezvous_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            Extensions.Extensions.ShowWaitForm(description: "Randevu bilgisi isteniyor...");
            int    id;
            object value = buttonEditFindRendezvous.EditValue;

            try
            {
                id = Convert.ToInt32(value);
            }
            catch (Exception)
            {
                XtraMessageBox.Show("Randevu numarası hatalı girildi.", "Hata", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                return;
            }

            RendezvousSolClient client = Extensions.Extensions.GetRendezvousService();

            rendezvous = client.Select(id);
            simpleButtonDelete.Enabled = rendezvous.IsNotNull();
            simpleButtonUpdate.Enabled = rendezvous.IsNotNull();
            if (rendezvous.IsNull())
            {
                XtraMessageBox.Show(String.Format("{0} numaralı bir randevu bulunamadı.", id), "Uyarı!",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                SplashScreenManager.CloseForm(false);
                return;
            }
            textEditPatientName.Text = String.Format("{0} {1}", rendezvous.Patient.Name, rendezvous.Patient.Surname);
            textEditDoctorName.Text  = String.Format("{0} {1}", rendezvous.Doctor.Name, rendezvous.Doctor.Surname);
            textEditDate.Text        = rendezvous.Date.ToString("D");
            textEditTime.Text        = rendezvous.RendezvousTime.StartTime.ToString(@"hh\:mm");
            SplashScreenManager.CloseForm(false);
        }
        private void ShowInfos()
        {
            flowLayoutPanel1.Controls.Clear();
            RendezvousSolClient client = Extensions.Extensions.GetRendezvousService();

            RendezvousInfo[] infos = client.RendezvousInfos().OrderBy(r => r.Max - r.Value).ToArray();

            foreach (XtraUserControlDepInfo depInfo in infos.Select(info => new XtraUserControlDepInfo(info)))
            {
                flowLayoutPanel1.Controls.Add(depInfo);
            }
        }
Example #3
0
        private void simpleButtonDelete_Click(object sender, EventArgs e)
        {
            DialogResult alert =
                Extensions.Extensions.DeletingAlert(String.Format("{0} {1} kişisi {2} numaralı randevusu",
                                                                  rendezvous.Patient.Name, rendezvous.Patient.Surname, rendezvous.Id));

            if (alert != DialogResult.Yes)
            {
                return;
            }

            RendezvousSolClient client = Extensions.Extensions.GetRendezvousService();
            ProcessResult       result = client.Delete(rendezvous.Id);

            Extensions.Extensions.ProcessResultMessage(result.Errors, (int)result.Result);
            if (result.Result == ExtensionsBLLResult.Success)
            {
                Close();
            }
        }
Example #4
0
        private void barButtonItemSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            Rendezvous rendezvous = new Rendezvous();

            rendezvous.Date             = DateTime.Today;
            rendezvous.RendezvousTimeId = bindingSourceTimes.Current.IsNull()
                ? 0
                : (bindingSourceTimes.Current as RendezvousTime).Id;
            rendezvous.PatientId = patient.IsNull() ? 0 : patient.Id;
            rendezvous.DoctorId  = (int)(lookUpEditDoctor.EditValue.IsNull() ? 0 : lookUpEditDoctor.EditValue);

            Extensions.Extensions.ShowWaitForm(description: "Randevu kaydediliyor...");
            RendezvousSolClient client = Extensions.Extensions.GetRendezvousService();

            result = client.Insert(rendezvous, true);
            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(result.Errors.ToArray(), (int)result.Result);
            if (result.Result == ExtensionsBLLResult.Success)
            {
                Close();
            }
        }
Example #5
0
        public static RendezvousSolClient GetRendezvousService()
        {
            RendezvousSolClient client;

            try
            {
                client = new RendezvousSolClient(binding,
                                                 new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "RendezvousService.svc")));
                client.Select(-1);
            }
            catch (Exception)
            {
                bool b = Program.TestService();
                if (!b)
                {
                    Application.Exit();
                }
                client = new RendezvousSolClient(binding,
                                                 new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "RendezvousService.svc")));
            }

            return(client);
        }