Ejemplo n.º 1
0
        public GetAgencyBalanceReponse GetAgencyBalance()
        {
            GetAgencyBalanceReponse agencyBal = new GetAgencyBalanceReponse();

            try
            {
                GetAgencyBalanceRequest agency = new GetAgencyBalanceRequest();
                agency.ClientId      = apiClientId;
                agency.EndUserIp     = IPAddress;
                agency.TokenId       = BLFunction.GetTokenID();
                agency.TokenAgencyId = BLFunction.GetAgencyID();
                agency.TokenMemberId = BLFunction.GetMemberID();
                var    jsonStringObject = JsonConvert.SerializeObject(agency);
                String Qualifiedurl     = Baseurl + "SharedServices/SharedData.svc/rest/GetAgencyBalance";
                var    result           = APIHotel.Instance().GetResponse(Qualifiedurl, Verbs.POST, jsonStringObject);
                if (result != null)
                {
                    agencyBal = JsonConvert.DeserializeObject <GetAgencyBalanceReponse>(result);
                }
                return(agencyBal);
            }
            catch (Exception ex)
            {
                agencyBal.Error.ErrorMessage = ex.Message;
                return(agencyBal);
            }
        }
Ejemplo n.º 2
0
        public LogoutResponse Logout()
        {
            LogoutResponse logout = new LogoutResponse();

            try
            {
                LogoutRequest requestLogout = new LogoutRequest();
                requestLogout.ClientId      = apiClientId;
                requestLogout.EndUserIp     = IPAddress;
                requestLogout.TokenAgencyId = BLFunction.GetAgencyID();
                requestLogout.TokenMemberId = BLFunction.GetMemberID();
                requestLogout.TokenId       = BLFunction.GetTokenID();
                var    jsonStringObject = JsonConvert.SerializeObject(requestLogout);
                String Qualifiedurl     = Baseurl + "SharedServices/SharedData.svc/rest/Logout";
                var    result           = APIHotel.Instance().GetResponse(Qualifiedurl, Verbs.POST, jsonStringObject);
                if (result != null)
                {
                    logout = JsonConvert.DeserializeObject <LogoutResponse>(result);
                }
                return(logout);
            }
            catch (Exception ex)
            {
                logout.Error.ErrorMessage = ex.Message;
                return(logout);
            }
        }