示例#1
0
        public string LaunchProviderPortal()
        {
            if (!System.IO.Directory.Exists(LaunchDirectory))
            {
                System.IO.Directory.CreateDirectory(LaunchDirectory);
            }
            ConfigProfileCollection ConfigProfileList = SerializerSupport.DeserializeFrom <ConfigProfileCollection>(ConfigProfileFilePath);
            var CurrentProfile             = ConfigProfileList.ProfileList.SingleOrDefault(x => x.Key == ConfigProfileList.SelectedProfileKey);
            X509Certificate2      Cert     = CertificateSupport.GetCertificate(CurrentProfile.CertificateFingerPrint, X509FindType.FindByThumbprint, StoreName.My, StoreLocation.CurrentUser, true);
            MhrRestClient         Client   = new MhrRestClient(CurrentProfile.Endpoint, CurrentProfile.ClientId, Cert, CurrentProfile.ProductName, CurrentProfile.ProductVersion);
            MhrRestClientResponse Response = Client.GetAccessToNpp(CurrentProfile.Hpio, CurrentProfile.Hpii, LauncherVM.Dob.ToString("dd-MM-yyyy"), LauncherVM.Gender, LauncherVM.Family, LauncherVM.Ihi, LauncherVM.MedicareNumber, LauncherVM.DvaNumber);

            if (Response.HttpStatus == System.Net.HttpStatusCode.OK)
            {
                System.IO.StreamWriter sw = new System.IO.StreamWriter(FastPassLauncherHtmlFileName);
                sw.WriteLine(Response.Content);
                sw.Close();
                System.Diagnostics.Process.Start(FastPassLauncherHtmlFileName);
                return(string.Empty);
            }
            else
            {
                return($"{Response.Message}");
            }
        }
示例#2
0
        public void LoadProfiles()
        {
            LauncherProfileCollection LoadedProfiles = SerializerSupport.DeserializeFrom <LauncherProfileCollection>(PatientProfileFilePath);

            if (LoadedProfiles != null)
            {
                var LauncherProfileList = new System.Collections.ObjectModel.ObservableCollection <LauncherProfile>(LoadedProfiles.ProfileList);
                LauncherVM.SelectedProfileName     = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey).ProfileName;
                LauncherVM.LauncherProfileList     = LauncherProfileList;
                LauncherVM.SelectedLauncherProfile = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey);
                LauncherVM.ProfileName             = LauncherVM.SelectedLauncherProfile.ProfileName;
                LauncherVM.Dob            = LauncherVM.Dob;
                LauncherVM.DvaNumber      = LauncherVM.SelectedLauncherProfile.DvaNumber;
                LauncherVM.Family         = LauncherVM.SelectedLauncherProfile.Family;
                LauncherVM.Gender         = LauncherVM.SelectedLauncherProfile.Gender;
                LauncherVM.Ihi            = LauncherVM.SelectedLauncherProfile.Ihi;
                LauncherVM.MedicareNumber = LauncherVM.SelectedLauncherProfile.MedicareNumber;
            }
            else
            {
                NewProfile();
            }
        }
示例#3
0
        public void LoadProfiles()
        {
            ConfigProfileCollection LoadedProfiles = SerializerSupport.DeserializeFrom <ConfigProfileCollection>(ConfigProfileFilePath);

            if (LoadedProfiles != null)
            {
                var ConfigProfileList = new System.Collections.ObjectModel.ObservableCollection <ConfigProfile>(LoadedProfiles.ProfileList);
                ConfigVM.SelectedProfileName   = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey).ProfileName;
                ConfigVM.ConfigProfileList     = ConfigProfileList;
                ConfigVM.SelectedConfigProfile = LoadedProfiles.ProfileList.Single(x => x.Key == LoadedProfiles.SelectedProfileKey);
                ConfigVM.ProfileName           = ConfigVM.SelectedConfigProfile.ProfileName;
                ConfigVM.Cert           = ConfigVM.HpioCertList.SingleOrDefault(x => x.FingerPrint == ConfigVM.SelectedConfigProfile.CertificateFingerPrint);
                ConfigVM.Hpii           = ConfigVM.SelectedConfigProfile.Hpii;
                ConfigVM.ProductName    = ConfigVM.SelectedConfigProfile.ProductName;
                ConfigVM.ProductVersion = ConfigVM.SelectedConfigProfile.ProductVersion;
                ConfigVM.ClientId       = ConfigVM.SelectedConfigProfile.ClientId;
                ConfigVM.Endpoint       = ConfigVM.SelectedConfigProfile.Endpoint;
            }
            else
            {
                NewProfile();
            }
        }