예제 #1
0
 public static double CalQualProgress(string studentId, string qualCode)
 {
     try
     {
         proxy = new StudentServiceClient(StudentServiceClient.EndpointConfiguration.BasicHttpsBinding_IStudentService);
         if (proxy != null)
         {
             if (proxy.State != CommunicationState.Faulted)
             {
                 proxy = new StudentServiceClient(StudentServiceClient.EndpointConfiguration.BasicHttpsBinding_IStudentService);
                 double progress = 0.00d;
                 progress = proxy.CalQualProgress(studentId, qualCode);
                 if (progress >= 1)
                 {
                     proxy.CloseAsync();
                     return(1.00d);
                 }
                 else
                 {
                     proxy.CloseAsync();
                     return(progress);
                 }
             }
             else
             {
                 proxy.Abort();
                 return(0);
             }
         }
         else
         {
             proxy.Abort();
             return(0);
         }
     }
     catch (CommunicationException)
     {
         proxy.Abort();
         return(0);
     }
     catch (TimeoutException)
     {
         proxy.Abort();
         return(0);
     }
     catch (Exception)
     {
         throw;
     }
 }