Esempio n. 1
0
 /// <summary>
 /// Get the data version of this Ren auth binding COrgan.
 /// </summary>
 public static String GetDataVersion()
 {
     try
     {
         NetClient.PostData(GlobalContext.URL_GetDataVersion, new Dictionary <string, string>
         {
             { "token", MPController.CurrentTransaction.AuthToken },
             { "renid", MPController.CurrentTransaction.RenUsername }
         },
                            out var retStr);
         var response = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         return(ReturnDataHelper.DecodeString(response));
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("Submit process, exception occurred" + ex, "MPController", LogLevel.Error);
         return(null);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Authorization connect.
 /// </summary>
 /// <param name="username">user unique name</param>
 /// <param name="password">pure password</param>
 /// <returns>KVP (successflag, token)</returns>
 public static KeyValuePair <bool, string> Login(string username, string password)
 {
     try
     {
         NetClient.PostData(GlobalContext.URL_Auth_Connect,
                            new Dictionary <string, string>
         {
             { "username", username },
             { "password", password }
         },
                            out string retStr);
         var response    = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         var retToken    = ReturnDataHelper.DecodeString(response);
         var successFlag = !retToken.StartsWith("#");
         return(new KeyValuePair <bool, string>(successFlag, successFlag ? retToken : ""));
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("LoginForm exception occurred" + ex, "MPController", LogLevel.Error);
         return(new KeyValuePair <bool, string>(false, ""));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Register mappings to NS.
 /// </summary>
 public static String RegisterMappings()
 {
     try
     {
         NetClient.PostData(GlobalContext.URL_UploadMapping, new Dictionary <string, string>
         {
             { "token", MPController.CurrentTransaction.AuthToken },
             { "rtid", GlobalContext.CurrentRTID },
             { "organgid", GlobalContext.ResourcesCOrganGid },
             { "dataversion", GlobalContext.ResourcesDataVersion },
             { "map", MPController.GeneratePostMapStringOfMappings() }
         },
                            out var retStr);
         var response = JsonConvert.DeserializeObject <StdResponseEntity>(retStr);
         return(ReturnDataHelper.DecodeString(response));
     }
     catch (Exception ex)
     {
         LogUtils.LogLine("Register mappings, exception occurred" + ex, "MPController", LogLevel.Error);
         return(null);
     }
 }