public object Create(ForteAddress forteAddressFull)
        {
            ForteException errGetAddr = new ForteException()
            {
                HttpStatusCode = System.Net.HttpStatusCode.OK,
                Source = "CreateAddress"
            };
            var response = Requestor.PostString(_url, forteAddressFull, _strUser, _strPassword, _strAuthAccountID);

            if (!(response.IndexOf("#ERROR#") == -1))
            {
                errGetAddr.ForteError.ErrorType = "#ERROR#";
                errGetAddr.ForteError.Message = response;
                throw errGetAddr;
            }
            else if (!(response.IndexOf("NotFound") == -1))
            {
                errGetAddr.ForteError.ErrorType = "NotFound";
                errGetAddr.ForteError.Message = response;
                throw errGetAddr;
            }
            else if (!(response.IndexOf("BadRequest") == -1))
            {
                errGetAddr.ForteError.ErrorType = "BadRequest";
                errGetAddr.ForteError.Message = response;
                throw errGetAddr;
            }
            else
            {
                return response;
            }
        }
Example #2
0
        public object Create(ForteAddress forteAddressFull)
        {
            ForteException errGetAddr = new ForteException()
            {
                HttpStatusCode = System.Net.HttpStatusCode.OK,
                Source         = "CreateAddress"
            };
            var response = Requestor.PostString(_url, forteAddressFull, _strUser, _strPassword, _strAuthAccountID);

            if (!(response.IndexOf("#ERROR#") == -1))
            {
                errGetAddr.ForteError.ErrorType = "#ERROR#";
                errGetAddr.ForteError.Message   = response;
                throw errGetAddr;
            }
            else if (!(response.IndexOf("NotFound") == -1))
            {
                errGetAddr.ForteError.ErrorType = "NotFound";
                errGetAddr.ForteError.Message   = response;
                throw errGetAddr;
            }
            else if (!(response.IndexOf("BadRequest") == -1))
            {
                errGetAddr.ForteError.ErrorType = "BadRequest";
                errGetAddr.ForteError.Message   = response;
                throw errGetAddr;
            }
            else
            {
                return(response);
            }
        }
Example #3
0
        public ForteAddress GetAddress()
        {
            ForteAddress forteaddr = new ForteAddress();

            ForteException errGetAddr = new ForteException()
            {
                HttpStatusCode = System.Net.HttpStatusCode.OK,
                Source         = "GetAddress"
            };

            string strAddrResult = Requestor.Get(_url, _strUser, _strPassword, _strAuthAccountID);


            if (!(strAddrResult.IndexOf("#ERROR#") == -1))
            {
                errGetAddr.ForteError.ErrorType = "#ERROR#";
                errGetAddr.ForteError.Message   = strAddrResult;
                throw errGetAddr;
            }
            else if (!(strAddrResult.IndexOf("NotFound") == -1))
            {
                errGetAddr.ForteError.ErrorType = "NotFound";
                errGetAddr.ForteError.Message   = strAddrResult;
                throw errGetAddr;
            }
            else if (!(strAddrResult.IndexOf("BadRequest") == -1))
            {
                errGetAddr.ForteError.ErrorType = "BadRequest";
                errGetAddr.ForteError.Message   = strAddrResult;
                throw errGetAddr;
            }
            else
            {
                forteaddr = Mapper <ForteAddress> .MapFromJson(strAddrResult);

                return(forteaddr);
            }
        }
        public ForteAddress GetAddress()
        {
            ForteAddress forteaddr = new ForteAddress();

            ForteException errGetAddr = new ForteException()
            {
                HttpStatusCode = System.Net.HttpStatusCode.OK,
                Source = "GetAddress"
            };

            string strAddrResult = Requestor.Get(_url, _strUser, _strPassword, _strAuthAccountID);

            if (!(strAddrResult.IndexOf("#ERROR#") == -1))
            {
                errGetAddr.ForteError.ErrorType = "#ERROR#";
                errGetAddr.ForteError.Message = strAddrResult;
                throw errGetAddr;
            }
            else if (!(strAddrResult.IndexOf("NotFound") == -1))
            {
                errGetAddr.ForteError.ErrorType = "NotFound";
                errGetAddr.ForteError.Message = strAddrResult;
                throw errGetAddr;
            }
            else if (!(strAddrResult.IndexOf("BadRequest") == -1))
            {
                errGetAddr.ForteError.ErrorType = "BadRequest";
                errGetAddr.ForteError.Message = strAddrResult;
                throw errGetAddr;
            }
            else
            {
                forteaddr = Mapper<ForteAddress>.MapFromJson(strAddrResult);
                return forteaddr;
            }
        }