public static LaboratoryRequestTypeSolClient GetLaboratoryRequestType() { LaboratoryRequestTypeSolClient client; try { client = new LaboratoryRequestTypeSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "LaboratoryRequestTypeService.svc"))); client.Select(-1); } catch (Exception) { bool b = Program.TestService(); if (!b) { Application.Exit(); } client = new LaboratoryRequestTypeSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "LaboratoryRequestTypeService.svc"))); } return(client); }
private void XtraFormLaboratuvarRequest_Load(object sender, EventArgs e) { if (GlobalVariables.LaboratoryRequestTypes.IsNull()) { LaboratoryRequestTypeSolClient client = Extensions.Extensions.GetLaboratoryRequestType(); GlobalVariables.LaboratoryRequestTypes = client.LaboratoryRequestTypes(true).ToList(); client.Close(); } bindingSourceItems.DataSource = GlobalVariables.LaboratoryRequestTypes; SplashScreenManager.CloseForm(false); }