diff --git a/web/ApiControllers/CalendarController.cs b/web/ApiControllers/CalendarController.cs
index c672cf9b..82b0679c 100644
--- a/web/ApiControllers/CalendarController.cs
+++ b/web/ApiControllers/CalendarController.cs
@@ -20,13 +20,13 @@
// along with this program. If not, see .
using System;
using System.Web.Http;
-using Yavsc.ApiControllers.Calendar.Model;
using Yavsc.Model.RolesAndMembers;
using System.Web.Security;
using Yavsc.Model.Google;
using Yavsc.Helpers;
using System.Web.Profile;
using Yavsc.Model.Circles;
+using Yavsc.Model.Calendar;
namespace Yavsc.ApiControllers
diff --git a/web/ApiControllers/PaypalApiController.cs b/web/ApiControllers/PaypalApiController.cs
index 07841a2d..ab7854c9 100644
--- a/web/ApiControllers/PaypalApiController.cs
+++ b/web/ApiControllers/PaypalApiController.cs
@@ -21,28 +21,54 @@
using System;
using System.Web.Http;
-#if USEPAYPALAPI
-using PayPal.Api;
+using PayPal;
+using System.Collections.Generic;
+using PayPal.OpenIdConnect;
+using PayPal.Manager;
+using PayPal.PayPalAPIInterfaceService;
+using PayPal.PayPalAPIInterfaceService.Model;
namespace Yavsc.ApiControllers
{
+ ///
+ /// Paypal API controller.
+ ///
public class PaypalApiController: ApiController
{
- public void GetPayments()
+ PayPalAPIInterfaceServiceService service = null;
+ ///
+ /// Initialize the specified controllerContext.
+ ///
+ /// Controller context.
+ protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
{
- OAuthTokenCredential tokenCredential =
- new OAuthTokenCredential("", "");
-
- string accessToken = tokenCredential.GetAccessToken();
- var parameters = new PayPal.Util.QueryParameters();
- parameters.Add ("Count", "10");
-
- PaymentHistory paymentHistory = Payment.Get(apiContext, accessToken, parameters);
-
+ base.Initialize (controllerContext);
+ // Get the config properties from PayPal.Api.ConfigManager
+ // Create the Classic SDK service instance to use.
+ service = new PayPalAPIInterfaceServiceService(ConfigManager.Instance.GetProperties());
+ }
+ ///
+ /// Search the specified str.
+ ///
+ /// str.
+ public BMCreateButtonResponseType Create(string str)
+ {
+ BMCreateButtonRequestType btcrerqu = new BMCreateButtonRequestType ();
+ BMCreateButtonReq btcrerq = new BMCreateButtonReq ();
+ btcrerq.BMCreateButtonRequest = btcrerqu;
+ BMCreateButtonResponseType btcrere = service.BMCreateButton (btcrerq);
+ return btcrere;
+ }
+ public BMButtonSearchResponseType Search(string str)
+ {
+ BMButtonSearchReq req = new BMButtonSearchReq ();
+ req.BMButtonSearchRequest = new BMButtonSearchRequestType ();
+
+ return service.BMButtonSearch (req);
}
}
+
}
-#endif
diff --git a/web/ChangeLog b/web/ChangeLog
index 5b4df1f7..7bc4c12c 100644
--- a/web/ChangeLog
+++ b/web/ChangeLog
@@ -1,3 +1,25 @@
+2015-06-26 Paul Schneider
+
+ * Web.csproj:
+ * ThanksHelper.cs:
+ * YavscHelpers.cs:
+ * CalendarController.cs:
+ * FrontOfficeController.cs: refactoring
+
+ * PaypalApiController.cs: adds a package reference to payPal
+ buttons
+
+ * T.cs: xml doc
+
+ * App.master: yet another thanks giving
+
+ * style.css: Yet another impact on style sheet
+
+ * Web.config: adds a circle provider section
+
+ * packages.config: Adds PayPal Button manager package
+ reference
+
2015-06-18 Paul Schneider
* instdbws.sql: Creates a new table to store one time usage
diff --git a/web/Controllers/FrontOfficeController.cs b/web/Controllers/FrontOfficeController.cs
index 496d3fae..f2330a10 100644
--- a/web/Controllers/FrontOfficeController.cs
+++ b/web/Controllers/FrontOfficeController.cs
@@ -12,7 +12,7 @@ using System.Web.Security;
using System.Threading;
using Yavsc.Model.FrontOffice;
using Yavsc.Model.FileSystem;
-using Yavsc.ApiControllers.Calendar.Model;
+using Yavsc.Model.Calendar;
namespace Yavsc.Controllers
{
diff --git a/web/Helpers/T.cs b/web/Helpers/T.cs
index 01883b2a..fd22098b 100644
--- a/web/Helpers/T.cs
+++ b/web/Helpers/T.cs
@@ -28,7 +28,11 @@ namespace Yavsc.Helpers
string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_"));
return tr==null?msg:tr;
}
-
+ ///
+ /// Translate the specified helper and text.
+ ///
+ /// Helper.
+ /// Text.
public static string Translate(this HtmlHelper helper, string text)
{
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).
diff --git a/web/Settings/ThanksHelper.cs b/web/Helpers/ThanksHelper.cs
similarity index 56%
rename from web/Settings/ThanksHelper.cs
rename to web/Helpers/ThanksHelper.cs
index ff07bee8..818d6d61 100644
--- a/web/Settings/ThanksHelper.cs
+++ b/web/Helpers/ThanksHelper.cs
@@ -1,9 +1,31 @@
using System;
using System.Configuration;
using System.Collections.Generic;
+using System.Web.Mvc;
-namespace Yavsc
+namespace Yavsc.Helpers
{
+ ///
+ /// Link.
+ ///
+ public class Link {
+ ///
+ /// Gets or sets the text.
+ ///
+ /// The text.
+ public string Text { get; set; }
+ ///
+ /// Gets or sets the URL.
+ ///
+ /// The URL.
+ public string Url { get; set; }
+ ///
+ /// Gets or sets the image.
+ ///
+ /// The image.
+ public string Image { get; set; }
+ }
+
///
/// Thanks helper.
///
@@ -24,28 +46,13 @@ namespace Yavsc
///
/// Html code for each entry
///
- public static string[] Links ()
+ public static Link[] Thanks (this HtmlHelper helper)
{
- List result = new List() ;
+ List result = new List() ;
if (ConfigurationSection == null) return result.ToArray();
if (ConfigurationSection.To == null) return result.ToArray();
- foreach (ThanksConfigurationElement e in ConfigurationSection.To) {
- string link = "";
- if (!string.IsNullOrEmpty(e.Url))
- link = string.Format("",e.Url);
- string dsp = (string.IsNullOrEmpty(e.Display))?e.Name:e.Display;
- if (!string.IsNullOrEmpty(e.Image)) {
- string ttl = (string.IsNullOrEmpty(ConfigurationSection.TitleFormat))?"Go and see the website ({0})":ConfigurationSection.TitleFormat;
- ttl = string.Format(ttl,dsp);
- link += string.Format(
- "
",
- dsp,e.Image,ttl);
- }
- else link += dsp;
- if (e.Url!=null)
- link += " ";
- result.Add (link);
- }
+ foreach (ThanksConfigurationElement e in ConfigurationSection.To)
+ result.Add( new Link { Url = e.Url, Image=e.Image, Text = e.Name });
return result.ToArray();
}
}
diff --git a/web/Helpers/YavscHelpers.cs b/web/Helpers/YavscHelpers.cs
index c6594d61..796dd787 100644
--- a/web/Helpers/YavscHelpers.cs
+++ b/web/Helpers/YavscHelpers.cs
@@ -96,8 +96,8 @@ namespace Yavsc.Helpers
///
/// Resets the password.
///
- /// Model state.
/// Model.
+ /// Errors.
public static void ResetPassword(LostPasswordModel model, out StringDictionary errors)
{
MembershipUserCollection users = null;
diff --git a/web/Models/App.master b/web/Models/App.master
index 8cf9484a..96ab744c 100644
--- a/web/Models/App.master
+++ b/web/Models/App.master
@@ -62,10 +62,11 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
- <%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %>
- <% foreach ( string link in Yavsc.ThanksHelper.Links()) { %>
- <%= link %>
- <% } %>
+ <%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
+ <% foreach ( Link link in Html.Thanks()) { %>
+ <% if (link.Image !=null) {
+ %>
<%
+ } else { %><%= link.Text %><% }} %>