Пример #1
0
        /// <summary>
        /// Method to call the web service for advertisememnt images
        /// </summary>
        private void GetAdvtImages()
        {
            string apiUrl = RxConstants.getPharmacyInformations;
            GetPharmacyInformationRequest objInputParameters = new GetPharmacyInformationRequest
            {
                Pharmacyid       = App.LoginPharId.ToUpper(),
                Deviceid         = string.Empty,
                Model            = string.Empty,
                Os               = string.Empty,
                Branding_hash    = string.Empty,
                Advert_hash      = string.Empty,
                Drugs_hash       = string.Empty,
                system_version   = "android",
                app_version      = "1.6",
                branding_version = "MLP"
            };

            WebClient pharmacyinfoadvtimageswebservicecall = new WebClient();
            var       uri = new Uri(apiUrl, UriKind.RelativeOrAbsolute);

            var json = JsonHelper.Serialize(objInputParameters);

            pharmacyinfoadvtimageswebservicecall.Headers["Content-type"] = "application/json";
            pharmacyinfoadvtimageswebservicecall.UploadStringCompleted  += pharmacyinfoadvtimageswebservicecall_UploadStringCompleted;

            pharmacyinfoadvtimageswebservicecall.UploadStringAsync(uri, "POST", json);
        }
Пример #2
0
        /// <summary>
        /// Get pharmacy information in signup screen
        /// </summary>
        public void CheckPharmacyIdWebservice()
        {
            string apiUrl = RxConstants.getPharmacyInformations;

            try
            {
                GetPharmacyInformationRequest objInputParameters = new GetPharmacyInformationRequest
                {
                    Pharmacyid       = objSignUpViewModel.SignUpPharmacyID.ToUpper(),
                    Deviceid         = string.Empty,
                    Model            = string.Empty,
                    Os               = string.Empty,
                    Branding_hash    = string.Empty,
                    Advert_hash      = string.Empty,
                    Drugs_hash       = string.Empty,
                    system_version   = "android",
                    app_version      = "1.6",
                    branding_version = "MLP"
                };

                WebClient checkpharmacyinfowebservicecall = new WebClient();
                var       uri = new Uri(apiUrl, UriKind.RelativeOrAbsolute);

                var json = JsonHelper.Serialize(objInputParameters);
                checkpharmacyinfowebservicecall.Headers["Content-type"] = "application/json";
                checkpharmacyinfowebservicecall.UploadStringCompleted  += checkpharmacyinfowebservicecall_UploadStringCompleted;

                checkpharmacyinfowebservicecall.UploadStringAsync(uri, "POST", json);
            }
            catch (Exception)
            {
                MessageBox.Show("Sorry, Unable to process your request.");
            }
        }
Пример #3
0
        /// <summary>
        /// Web service to get the branding info
        /// </summary>
        private void BrandingInfoWebService()
        {
            try
            {
                string apiUrl = RxConstants.getPharmacyInformations;
                objInputParameters = new GetPharmacyInformationRequest
                {
                    Pharmacyid       = App.LoginPharId.ToUpper(),
                    Deviceid         = string.Empty,
                    Model            = string.Empty,
                    Os               = string.Empty,
                    Branding_hash    = string.Empty,
                    Advert_hash      = string.Empty,
                    Drugs_hash       = string.Empty,
                    system_version   = "android",
                    app_version      = "1.6",
                    branding_version = "MLP"
                };
                WebClient pharmacyinfoforbrandingwebservicecall = new WebClient();
                var       uri = new Uri(apiUrl, UriKind.RelativeOrAbsolute);

                var json = JsonHelper.Serialize(objInputParameters);
                pharmacyinfoforbrandingwebservicecall.Headers["Content-type"] = "application/json";
                pharmacyinfoforbrandingwebservicecall.UploadStringCompleted  += pharmacyinfoforbrandingwebservicecall_UploadStringCompleted;

                pharmacyinfoforbrandingwebservicecall.UploadStringAsync(uri, "POST", json);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Sorry, Unable to process your request.");
            }
        }
        /// <summary>
        /// Web service to get the Pharmacy Details
        /// </summary>
        private void PharmacyDetailsWebService()
        {
            string apiUrl         = RxConstants.getPharmacyInformations;
            string deviceUniqueID = string.Empty;
            object deviceID;

            if (DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out deviceID))
            {
                deviceUniqueID = deviceID.ToString();
            }

            string deviceName = string.Empty;
            object devicename;

            if (DeviceExtendedProperties.TryGetValue("DeviceName", out devicename))
            {
                deviceName = devicename.ToString();
            }
            GetPharmacyInformationRequest objInputParameters = new GetPharmacyInformationRequest
            {
                Pharmacyid       = App.LoginPharId.ToUpper(),
                Deviceid         = ((!string.IsNullOrWhiteSpace(deviceUniqueID)) && (!string.IsNullOrEmpty(deviceUniqueID))) ? deviceUniqueID : string.Empty,
                Model            = ((!string.IsNullOrWhiteSpace(DeviceModel)) && (!string.IsNullOrEmpty(DeviceModel))) ? DeviceModel : string.Empty,
                Os               = "Windows Phone",
                Branding_hash    = string.Empty,
                Advert_hash      = ((!string.IsNullOrWhiteSpace(App.AdvtHash)) && (!string.IsNullOrEmpty(App.AdvtHash))) ? App.AdvtHash : string.Empty,
                Drugs_hash       = ((!string.IsNullOrWhiteSpace(App.DrugDBHash)) && (!string.IsNullOrEmpty(App.DrugDBHash))) ? App.DrugDBHash : string.Empty,
                system_version   = "android",
                app_version      = "1.6",
                branding_version = "MLP"
            };

            WebClient pharmacydetailswebservicecall = new WebClient();
            var       uri = new Uri(apiUrl, UriKind.RelativeOrAbsolute);

            var json = JsonHelper.Serialize(objInputParameters);

            pharmacydetailswebservicecall.Headers["Content-type"] = "application/json";
            pharmacydetailswebservicecall.UploadStringCompleted  += pharmacydetailswebservicecall_UploadStringCompleted;

            pharmacydetailswebservicecall.UploadStringAsync(uri, "POST", json);
        }