コード例 #1
0
        public async Task <GetAllDataResponse> GetAllData(string email, int languageId)
        {
            var request = new GetAllDataRequest
            {
                email      = email,
                languageId = languageId
            };
            //var response = await WebServiceClientBase.Get<GetAllDataRequest, GetAllDataResponse>(Constants.GetAllDataUri, request, true);

            //return response;

            var response = await WebServiceClientBase.Get <GetAllDataResponse>(Constants.GetAllDataUri + "?email=" + email + "&languageId=" + languageId, true);

            return(response);
        }
コード例 #2
0
        public async Task <RateCardResponse> GetRateCards()
        {
            var response = await WebServiceClientBase.Get <RateCardResponse>(Constants.RateCardUri, true);

            if (response != null && !response.ErrorStatusCode.IsErrorCode())
            {
                //Need to loop through returned rate cards and create RateCardLocals
                response.RateCardsLocal = new List <RateCardLocal>();

                foreach (RateCard card in response.RateCards)
                {
                    RateCardLocal local = new RateCardLocal();
                    local.AdvancePayments          = card.AdvancePayments;
                    local.AvailablePoints          = card.AvailablePoints;
                    local.EquipmentType            = card.EquipmentType;
                    local.EquipmentTypeDescription = card.EquipmentTypeDescription;
                    local.MaintenanceTypes         = card.MaintenanceTypes;
                    local.PurchaseOptions          = new List <PurchaseOption>();
                    foreach (string option in card.PurchaseOptions)
                    {
                        local.PurchaseOptions.Add(new PurchaseOption {
                            PurchaseOptionDesc = option
                        });
                    }
                    local.RateCardID    = card.RateCardID;
                    local.RateCardName  = card.RateCardName;
                    local.MaximumAmount = card.MaximumAmount;
                    local.MinimumAmount = card.MinimumAmount;
                    local.Terms         = new List <TermItem> ();
                    foreach (int t in card.Terms)
                    {
                        local.Terms.Add(new TermItem {
                            Term = t
                        });
                    }

                    response.RateCardsLocal.Add(local);
                }
            }

            return(response);
        }