private void barButtonItemDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            Patient patient = bindingSourcePatients.Current as Patient;

            if (patient.IsNotNull() &&
                Extensions.Extensions.DeletingAlert(patient.Name + " " + patient.Surname) != DialogResult.Yes)
            {
                if (patient.IsNull())
                {
                    Extensions.Extensions.ObjectNotSelectedForDelete();
                    return;
                }
            }

            Extensions.Extensions.ShowWaitForm(description: "Hasta siliniyor...");
            PatientSolClient client = Extensions.Extensions.GetPatientClient();

            ProcessResult processResult = client.Delete(patient.Id);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            if (processResult.Result == ExtensionsBLLResult.Success)
            {
                RefreshData();
            }
        }
Пример #2
0
        private void simpleButtonPatientInfos_Click(object sender, EventArgs e)
        {
            Extensions.Extensions.ShowWaitForm(description: "Hasta bilgisi sorgulanıyor...");
            PatientSolClient client = Extensions.Extensions.GetPatientClient();

            patient = client.PatientByTc(textEditTCNO.Text.Trim());
            SplashScreenManager.CloseForm(false);
            if (patient.IsNotNull())
            {
                labelControlPatientName.Text = patient.NameSurname;
            }
            else
            {
                XtraMessageBox.Show("Girilen kimlik numarası ile kişi bulunamadı", "Kişi Bulunamadı",
                                    MessageBoxButtons.OK, MessageBoxIcon.None);
            }
        }
        private void RefreshData()
        {
            PatientSolClient client = Extensions.Extensions.GetPatientClient();

            if (client.IsNull())
            {
                DialogResult result =
                    XtraMessageBox.Show("Servise bağlantı kurmada hata oluştu. Lütfen daha sonra tekrar deneyinizi.",
                                        "Hata",
                                        MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                if (result == DialogResult.Retry)
                {
                    RefreshData();
                }
            }
            List <Patient> patients = client.Patients(true).ToList();

            bindingSourcePatients.DataSource = patients;
        }
Пример #4
0
        public static PatientSolClient GetPatientClient()
        {
            PatientSolClient client;

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

            return(client);
        }
Пример #5
0
        private void barButtonItemSave_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (!GetPatientValues())
            {
                return;
            }
            Extensions.Extensions.ShowWaitForm(description: "Hasta kaydediliyor...");
            PatientSolClient client        = Extensions.Extensions.GetPatientClient();
            ProcessResult    processResult = update ? client.Update(patient) : client.Insert(patient);

            if (getPatientId)
            {
                patient = client.PatientByTc(patient.TcNo);
            }
            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors.ToArray(), (int)processResult.Result);
            if (processResult.Result != ExtensionsBLLResult.Success)
            {
                return;
            }
            Result = true;
            Close();
        }