private void barButtonItemDeleteMedicament_ItemClick(object sender, ItemClickEventArgs e) { Medicament medicament = bindingSourceMedicament.Current as Medicament; if (medicament.IsNull()) { Extensions.Extensions.ObjectNotSelectedForDelete(); return; } if (Extensions.Extensions.DeletingAlert(medicament.Name) != DialogResult.Yes) { return; } Extensions.Extensions.ShowWaitForm(description: "Hastalık ismi siliniyor..."); MedicamentSolClient client = Extensions.Extensions.GetMedicamentSolClient(); MedicamentService.ProcessResult processResult = client.Delete(medicament.Id); SplashScreenManager.CloseForm(false); Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result); if (processResult.Result == MedicamentService.ExtensionsBLLResult.Success) { RefreshData(2); } }
private void barButtonItemSave_ItemClick(object sender, ItemClickEventArgs e) { if (_medicament == null) { _medicament = new Medicament { Name = textEditName.Text, Note = textEditNote.Text, UsePerDay = Convert.ToDouble(String.Format("{0},{1}", textBoxUseDay.Text.Trim(), textBoxUsePer.Text.Trim())), IsActive = checkEditIsActive.Checked }; } else { _medicament.Name = textEditName.Text; _medicament.Note = textEditNote.Text; _medicament.UsePerDay = Convert.ToDouble(String.Format("{0},{1}", textBoxUseDay.Text.Trim(), textBoxUsePer.Text.Trim())); _medicament.IsActive = checkEditIsActive.Checked; } Extensions.Extensions.ShowWaitForm(description: "İlaç kaydediliyor..."); MedicamentSolClient client = Extensions.Extensions.GetMedicamentSolClient(); ProcessResult processResult = update ? client.Update(_medicament) : client.Insert(_medicament); SplashScreenManager.CloseForm(false); Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result); if (processResult.Result == ExtensionsBLLResult.Success) { Close(); } }
public XtraFormPrescription(Examination examination) { _examination = examination; prescription.ExaminationId = _examination.Id; prescription.Examination = new PrescriptionService.Examination { Id = _examination.Id, PatientId = _examination.PatientId, DoctorId = _examination.DoctorId, Time = _examination.Time, DoctorNote = _examination.DoctorNote, CanSendMessage = _examination.CanSendMessage, NextTime = _examination.NextTime, RendezvousId = _examination.RendezvousId, IsActive = _examination.IsActive, DiagnosisId = _examination.DiagnosisId }; InitializeComponent(); Text = String.Format("Reçete Yaz: {0}", _examination.Patient.NameSurname); if (GlobalVariables.Medicaments.IsNull()) { MedicamentSolClient client = Extensions.Extensions.GetMedicamentSolClient(); GlobalVariables.Medicaments = client.Medicaments(true).ToList(); client.Close(); SplashScreenManager.CloseForm(false); } bindingSourceAllMedicaments.DataSource = GlobalVariables.Medicaments; }
private void RefreshData(int i) { if (i == 0 || i == 1) { DiagnosisSolClient client = Extensions.Extensions.GetDiagnosisSolClient(); bindingSourceDiagnosis.DataSource = client.Diagnoses(null, true).ToList(); client.Close(); } if (i == 0 || i == 2) { MedicamentSolClient client1 = Extensions.Extensions.GetMedicamentSolClient(); bindingSourceMedicament.DataSource = client1.Medicaments(true); client1.Close(); } }
internal static MedicamentSolClient GetMedicamentSolClient() { MedicamentSolClient client; try { client = new MedicamentSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "medicamentservice.svc"))); client.Select(-1); } catch (Exception) { bool b = Program.TestService(); if (!b) { Application.Exit(); } client = new MedicamentSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "medicamentservice.svc"))); } return(client); }