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); }
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); } }
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); } }
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); } }
public ICUTechClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(ICUTechClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { }
public ICUTechClient(EndpointConfiguration endpointConfiguration) : base(ICUTechClient.GetBindingForEndpoint(endpointConfiguration), ICUTechClient.GetEndpointAddress(endpointConfiguration)) { }
public ICUTechClient() : base(ICUTechClient.GetDefaultBinding(), ICUTechClient.GetDefaultEndpointAddress()) { }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(ICUTechClient.GetEndpointAddress(EndpointConfiguration.IICUTechPort)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(ICUTechClient.GetBindingForEndpoint(EndpointConfiguration.IICUTechPort)); }
public AccountService() { _client = new ICUTechClient(); }