Пример #1
0
        public static AuthorizationConfig CreateNew(string email, string LinnworksUniqueIdentifier, string accountName)
        {
            AuthorizationConfig output = new AuthorizationConfig();

            output.AuthorizationToken = Guid.NewGuid();
            output.Email = email;
            output.LinnworksUniqueIdentifier = LinnworksUniqueIdentifier;
            output.AccountName = accountName;
            output.Save();
            return(output);
        }
Пример #2
0
 public static AuthorizationConfig Load(string AuthorizationToken)
 {
     if (System.IO.File.Exists(AppSettings.ConfigStoragePath + "\\" + AuthorizationToken + ".json"))
     {
         string json = System.IO.File.ReadAllText(AppSettings.ConfigStoragePath + "\\" + AuthorizationToken + ".json");
         AuthorizationConfig output = Newtonsoft.Json.JsonConvert.DeserializeObject <AuthorizationConfig>(json);
         return(output);
     }
     else
     {
         return(null);
     }
 }