Ejemplo n.º 1
0
        public ContentResult UserLogin(string userName, string userPassword)
        {
            ICUTechClient svc    = new ICUTechClient();
            LoginResponse result = svc.Login(new LoginRequest(userName, userPassword, "0.0.0.0"));

            // LoginResultData jsonSerializer = JsonSerializer.Deserialize<LoginResultData>([email protected]());

            // return Json(jsonSerializer);

            ContentResult response = new ContentResult();

            response.Content     = [email protected]();
            response.ContentType = "application/json";
            return(response);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
 public ICUTechClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(ICUTechClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
 }
Ejemplo n.º 6
0
 public ICUTechClient(EndpointConfiguration endpointConfiguration) :
     base(ICUTechClient.GetBindingForEndpoint(endpointConfiguration), ICUTechClient.GetEndpointAddress(endpointConfiguration))
 {
 }
Ejemplo n.º 7
0
 public ICUTechClient() :
     base(ICUTechClient.GetDefaultBinding(), ICUTechClient.GetDefaultEndpointAddress())
 {
 }
Ejemplo n.º 8
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(ICUTechClient.GetEndpointAddress(EndpointConfiguration.IICUTechPort));
 }
Ejemplo n.º 9
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(ICUTechClient.GetBindingForEndpoint(EndpointConfiguration.IICUTechPort));
 }
Ejemplo n.º 10
0
 public AccountService()
 {
     _client = new ICUTechClient();
 }