Beispiel #1
0
        public int NewCustomer(string username, string password, string firstName, string lastName, string phone, int?country, string ip, ref string error)
        {
            using (var client = new ICUTechClient())
            {
                WcfConfigure.Authorize(client);

                var request  = client.RegisterNewCustomer(username, password, firstName, lastName, phone, country ?? 1, 1, ip);
                var response = request.Decode <ResultResponse>();
                if (response.ResultCode == -1)
                {
                    error = response.ResultMessage;
                    return(-1);
                }

                var result = request.Decode <NewCustomerResponse>();

                return(result.EntityId);
            }
        }
Beispiel #2
0
        public CustomerInfoResponse GetByEntity(string username, string password, int id, ref string error)
        {
            using (var client = new ICUTechClient())
            {
                WcfConfigure.Authorize(client);

                var request  = client.GetCustomerInfo(id, username, password);
                var response = request.Decode <ResultResponse>();

                if (response.ResultCode == -1)
                {
                    error = response.ResultMessage;
                    return(null);
                }

                var result = request.Decode <CustomerInfoResponse>();

                return(result);
            }
        }
Beispiel #3
0
        public LoginResponse GetByLogin(string username, string password, string ip, ref string error)
        {
            using (var client = new ICUTechClient())
            {
                WcfConfigure.Authorize(client);

                var request  = client.Login(username, password, ip);
                var response = request.Decode <ResultResponse>();

                if (response.ResultCode == -1)
                {
                    error = response.ResultMessage;
                    return(null);
                }

                var result = request.Decode <LoginResponse>();

                return(result);
            }
        }