Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/27/11 19:09:49 (13 years ago)
Author:
jwolfing
Message:

#1433 code formatted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBAdminPlugin/Helpers/Admin.cs

    r6050 r6317  
    77
    88namespace HLWebOKBAdminPlugin.Helpers {
    9     public class Admin {
     9  public class Admin {
    1010
    11         public static AdministrationServiceClient GetClientFactory() {
    12             return GetClientFactory(GetSessionString("Username"), GetSessionString("Password"));
     11    public static AdministrationServiceClient GetClientFactory() {
     12      return GetClientFactory(GetSessionString("Username"), GetSessionString("Password"));
     13    }
     14
     15    public static AdministrationServiceClient GetClientFactory(string username, string password) {
     16      try {
     17        AdministrationServiceClient adminClient = new AdministrationServiceClient();
     18        adminClient.ClientCredentials.UserName.UserName = username;
     19        adminClient.ClientCredentials.UserName.Password = password;
     20        adminClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
     21        return adminClient;
     22      }
     23      catch {
     24      }
     25      return null;
     26    }
     27
     28    public static string GetSessionString(string name) {
     29      if (name != null) {
     30        object o = HttpContext.Current.Session[name];
     31        if (o != null) {
     32          return o.ToString();
    1333        }
    14 
    15         public static AdministrationServiceClient GetClientFactory(string username, string password) {
    16             try {
    17                 AdministrationServiceClient adminClient = new AdministrationServiceClient();
    18                 adminClient.ClientCredentials.UserName.UserName = username;
    19                 adminClient.ClientCredentials.UserName.Password = password;
    20                 adminClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
    21                 return adminClient;
    22             }
    23             catch {
    24             }
    25             return null;
    26         }
    27 
    28         public static string GetSessionString(string name) {
    29             if (name != null) {
    30                 object o = HttpContext.Current.Session[name];
    31                 if (o != null) {
    32                     return o.ToString();
    33                 }
    34             }
    35             return string.Empty;
    36         }
     34      }
     35      return string.Empty;
    3736    }
     37  }
    3838}
Note: See TracChangeset for help on using the changeset viewer.