private void LoginPersonnel(string tc, string pass, bool isAdmin) { SystemSolClient client = Extensions.Extensions.GetSystemManager(); Personnel personnel = client.LoginPersonnel(tc, pass); if (personnel.IsNull()) { LoggedIn = false; clossingAfterError = true; ErrorMessage(); } else { if (personnel.Degree.IsAdmin != isAdmin) { LoggedIn = false; clossingAfterError = true; ErrorMessage(); return; } GlobalVariables.Personnel = personnel; LoggedIn = true; SplashScreenManager.CloseForm(false); } }
private void LoginDoctor(string tc, string pass) { SystemSolClient client = Extensions.Extensions.GetSystemManager(); Doctor doctor = client.LoginDoctor(tc, pass); if (doctor.IsNull()) { LoggedIn = false; clossingAfterError = true; ErrorMessage(); } else { GlobalVariables.Doctor = doctor; LoggedIn = true; SplashScreenManager.CloseForm(false); } }
public static SystemSolClient GetSystemManager() { SystemSolClient client; try { client = new SystemSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "systemservice.svc"))); client.Test(); } catch (Exception) { bool b = Program.TestService(); if (!b) { Application.Exit(); } client = new SystemSolClient(binding, new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "systemservice.svc"))); } return(client); }