Exemplo n.º 1
0
        public async Task<Poraba> GetData(MobileCredentials mobileCredentials)
        {
            var stopwatch = new Stopwatch();
            stopwatch.Start();

            var serviceClient = new MDFServiceSoapClient();            
            var result = await serviceClient.MonitorAsync(mobileCredentials.MobileNumber, mobileCredentials.Password);

            var poraba = new Poraba(result.Body.MonitorResult);

            stopwatch.Stop();
            _tc.TrackMetric("Background Task", stopwatch.ElapsedMilliseconds);

            return poraba;
        }
Exemplo n.º 2
0
 internal static async Task<LoginResult> TryLogin(MobileCredentials mobileCredentials)
 {
     var service = new MDFServiceSoapClient();
     try
     {                
         var result = await service.AuthenticateUserAsync(mobileCredentials.MobileNumber, mobileCredentials.Password);
         return result.Body.AuthenticateUserResult == 0 ? LoginResult.Success : LoginResult.LoginFailed;
     }
     catch (Exception)
     {
         // TODO: reason - network not present, host not found, etc
         return LoginResult.CallFailed;
     }
 }