Beispiel #1
0
        public HttpResponseMessage GetPharmacySearchResult(DoseSpotPharmacySearch oModel)
        {
            PharmacySearchMessageResult oResult = DoseSpotHelper.SearchPharmacy(oModel);

            var oRetRes = new List <PharmacyEntry>();

            if (oResult.Pharmacies != null)
            {
                foreach (var item in oResult.Pharmacies)
                {
                    oRetRes.Add(new PharmacyEntry
                    {
                        PharmacyId       = item.PharmacyId,
                        StoreName        = item.StoreName,
                        Address1         = item.Address1,
                        Address2         = item.Address2,
                        City             = item.City,
                        State            = item.State,
                        ZipCode          = item.ZipCode,
                        PrimaryPhone     = item.PrimaryPhone,
                        PrimaryPhoneType = item.PrimaryPhoneType
                    });
                }
            }

            HttpResponseMessage oResp = Request.CreateResponse(HttpStatusCode.OK, oRetRes);

            return(oResp);
        }
Beispiel #2
0
        public static PharmacySearchMessageResult SearchPharmacy(DoseSpotPharmacySearch oModel)
        {
            APISoapClient api = new DoseSpotApi.APISoapClient("APISoap12");
            SingleSignOn  sso = new DoseSpotApi.SingleSignOn();

            var oCredentials = CreateSingleSignOnCodeAndUserIdVerify();

            sso.SingleSignOnClinicId     = 664;
            sso.SingleSignOnUserId       = 2844;
            sso.SingleSignOnCode         = oCredentials.Key;
            sso.SingleSignOnUserIdVerify = oCredentials.Value;

            PharmacySearchMessage oSrch = new PharmacySearchMessage
            {
                PharmacyNameSearch      = oModel.Name,
                PharmacyCity            = oModel.City,
                PharmacyStateTwoLetters = oModel.State,
                PharmacyZipCode         = oModel.Zip,
                SingleSignOn            = sso
            };

            PharmacySearchMessageResult oRes = api.PharmacySearch(oSrch);

            return(oRes);
        }