public DonationSubscription GetDonationSubscription(string subscriptionId)
 {
     using (var db = new DataAccess())
     {
         db.CreateStoredProcCommand("dbo.GetDonationSubscription");
         db.AddInputParameter("@SubscriptionId", subscriptionId);
         try
         {
             var subscription = new DonationSubscription();
             db.ReadInto(subscription);
             return subscription;
         }
         catch (Exception ex)
         {
             Log.Error("Error while gettng subscription.", ex);
             throw;
         }
     }
 }
 public DonationSubscription CreateDonationSubscription(DonationSubscription subscription)
 {
     using (var db = new DataAccess())
     {
         db.CreateStoredProcCommand("dbo.CreateDonationSubscription");
         db.AddInputParameter("@StartDate", subscription.StartDate);
         db.AddInputParameter("@EndDate", subscription.EndDate);
         db.AddInputParameter("@RecurrenceTimes", subscription.RecurrenceTimes);
         db.AddInputParameter("@SubscriptionId", subscription.SubscriptionId);
         db.AddInputParameter("@UserId", subscription.UserId);
         db.AddInputParameter("@Username", subscription.Username);
         db.AddInputParameter("@Password", subscription.Password);
         db.AddInputParameter("@ProviderData", subscription.ProviderXml);
         db.AddOutputParameter("@DonationSubscriptionId", DbType.Int32);
         try
         {
             db.ExecuteNonQuery();
             subscription.DonationSubscriptionId = db.GetParameterValue<int>("@DonationSubscriptionId");
         }
         catch (Exception ex)
         {
             Log.Error("Error while crating subscription.", ex);
             throw;
         }
     }
     return subscription;
 }