Beispiel #1
0
 private static void SetPayPalSettings(UserSettingCollection settings, string token, DateTime expiration, string payerId, string payer, int userId)
 {
     RemovePayPalSettings(settings);
     if (!string.IsNullOrEmpty(token))
     {
         settings.SetValueByKey("PayPal_Token", token);
     }
     if (expiration > System.DateTime.MinValue)
     {
         settings.SetValueByKey("PayPal_TokenExpiration", expiration.ToString());
     }
     if (!string.IsNullOrEmpty(payerId))
     {
         settings.SetValueByKey("PayPal_PayerID", payerId);
     }
     if (!string.IsNullOrEmpty(payer))
     {
         settings.SetValueByKey("PayPal_Payer", payer);
     }
     foreach (UserSetting userSetting in settings)
     {
         userSetting.UserId = userId; userSetting.IsDirty = true;
     }
     settings.Save();
 }
Beispiel #2
0
 public ActionResult Save(Bam.Net.CoreServices.ApplicationRegistration.Dao.UserSetting[] values)
 {
     try
     {
         UserSettingCollection saver = new UserSettingCollection();
         saver.AddRange(values);
         saver.Save();
         return(Json(new { Success = true, Message = "", Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }