Skip to content

Commit

Permalink
Added Cost column to Sessions for View, Edit, Create, Payment
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonbrett committed Dec 12, 2024
1 parent cbc35ad commit 15d71ea
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pickuphockey/Controllers/SessionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public ActionResult Create()
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "Admin")]
public ActionResult Create([Bind(Include = "SessionId,SessionDate,Note,RegularSetId,BuyDayMinimum")] Session session)
public ActionResult Create([Bind(Include = "SessionId,SessionDate,Note,RegularSetId,BuyDayMinimum,Cost")] Session session)
{
if (!ModelState.IsValid) return View(session);
var now = DateTime.UtcNow;
Expand Down Expand Up @@ -221,7 +221,7 @@ public ActionResult Edit(int? id)
[HttpPost]
[ValidateAntiForgeryToken]
[Authorize(Roles = "Admin")]
public ActionResult Edit([Bind(Include = "SessionId,SessionDate,CreateDateTime,Note,RegularSetId,BuyDayMinimum")] Session session)
public ActionResult Edit([Bind(Include = "SessionId,SessionDate,CreateDateTime,Note,RegularSetId,BuyDayMinimum,Cost")] Session session)
{
if (!ModelState.IsValid) return View(session);

Expand Down
29 changes: 29 additions & 0 deletions pickuphockey/Migrations/202412112253129_SessionCost.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pickuphockey/Migrations/202412112253129_SessionCost.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace pickuphockey.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class SessionCost : DbMigration
{
public override void Up()
{
AddColumn("dbo.Sessions", "Cost", c => c.Decimal(nullable: false, precision: 18, scale: 2));
}

public override void Down()
{
DropColumn("dbo.Sessions", "Cost");
}
}
}
126 changes: 126 additions & 0 deletions pickuphockey/Migrations/202412112253129_SessionCost.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAO1dWW/kuBF+D5D/IPRTEnjdPnYnk4G9gdceJ0bGB9yeTd4MWk23hdHRq2PWjWB/WR7yk/IXQurkLVKiDm+CwQBukfpYLFYVySJV9Z9//fvkz6+B73yFceJF4enicP9g4cDQjdZeuDldZOnzN+8Xf/7+t785+bgOXp0fq3rHuB56M0xOFy9puv2wXCbuCwxAsh94bhwl0XO670bBEqyj5dHBwZ+Wh4dLiCAWCMtxTu6zMPUCmP9AP8+j0IXbNAP+dbSGflI+RyWrHNW5AQFMtsCFp4ut537Jti+R+wXu9ovqC+fM9wAiZQX954UDwjBKQYoI/fA5gas0jsLNaoseAP9ht4Wo3jPwE1h24ENTXbcvB0e4L8vmxQrKzZI0CgwBD49L5izZ1zuxeFEzD7HvI2JzusO9zll4ujhzU+8revQp2iwctr0P536M6wqZvE+8uueQFfZquUDig/4dvXt/8Mc95zzz0yyGpyHM0hj4e85d9uR77t/g7iH6AsPTMPN9klhELiqjHqBHd3G0hXG6u4fPfBeu1gtnSUMsWYwaQfx60d+rMD0+Wjg3iCTw5MNaQgjerNIohn+BIYxBCtd3IE1hjAb4ag1zHnOEMM2uYIJZ1N6kGgYJdNxgINlGerpwrsHrJxhu0hekwUfvF86l9wrX1ZMS93PoIbVGL6Vx1trMeQxRLy/Q/wekplVzzW9DqiueK+hGf3ah+wZ89Tb5AIn5vXDuoZ+XJy/etrAQ+2XZIyEKyIZcxlFwH/nNu1T54wOINzBFPYgUlVZRFrsGVOLhFJJIoD4WlRry2LK61Yo0rkJFO0nWybIxDkqTUXPSzFyUr01qKgilMzUT2vpq3URgLeutcZYV+PN2bRPuJmq6aM8WMI3cw03mg3gFU24QW3gXJWndReh6AfAXzl2M/ioXScjCrlyAe2tuwH/Idhdgd+2FXpAFarKkVoO2W7YMHGtFlFZQl1TUXUSRLyazLHysLUxDIVPEWV+23NTwNsKhZCBZjWdfUyplHlGllxEu+2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GV+WGD3DBD+dhNGSKCg/7TP2HxonBvr1pQEabJKZzr8zwWRj6uCZdKrpmN5nLhl9ptz6tHygN499z+Qpe/jAxuyYlt/x8daqLRVP8and6WL9FKHxL7zmymwgbFv19MS1U5eI2pAGe2fxNTL5iPDLwnZ8zijz/GJrCHmWbG9gKo5SzjYpcJdyjQrqqJuVpCVRtV16z5Rtl3XUbUuSfajaLmyKsumiirplcQR0tmFyPcY1SRaKGlPF4Zc0pMpPpGhCn4Mt3GvjnJhrE2Q5EuVOENhZySKIeFeVXmzO+YvoTqhTi0knb8qGSCIx2WfKcOmKrDCFMm6SeEL2mTJUdiIrLCGthjiQTn+GWM9GZIsRzDpClbhmHtmH3lrHLeQa6jorDNvFAZIJ8QsSNlSSqrsGbJpBpiBLYjzOzD9weiCh9RVZ3lFsuEE6ID6WC9rkZiG+1Vj8uoD4Ml0NcYIwQ+hS29u6zlX4HFW7bIaiqgr7wR1MwRrtfc/i1HsGboqK8cck+Udm+QV9/EnTE1xfhbdZus1S1GUYPPnU5XW8W1e1n+c8omk+uc3vlyY2uoDI9PBF0Nvwh8zz1zXdl4IrahII7AYob9DisUzxTdrNrka64UITy4BK9tXeiwcYbH0EltyGK4A/RDSnDYnfJ7gB7q65zS8DaR8Imu0nFx7YxCBISozmffQTyfA6eP3+v5OrweBZxgAA</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>
3 changes: 3 additions & 0 deletions pickuphockey/Models/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public bool AlreadySold()
[ForeignKey("RegularSetId")]
public virtual RegularSet RegularSet { get; set; }

[DisplayName("Cost")]
public decimal Cost { get; set; }

[DisplayName("Roster")]
[NotMapped]
public virtual ICollection<Regular> Regulars { get; set; }
Expand Down
8 changes: 5 additions & 3 deletions pickuphockey/Views/BuySells/Payment.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

// https://gabeoleary.com/posts/venmo-deeplinking-including-from-web-apps
var VenmoUrl = "https://venmo.com";

var cost = (item.Session.Cost == 0) ? System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"] : item.Session.Cost.ToString("F2");
}
<h2>Payment for a Spot for @ViewBag.SessionDate.ToString("dddd, MM/dd/yyyy, HH:mm")</h2>
<h4>
Expand All @@ -26,7 +28,7 @@
<div>
<b>Seller</b>: @item.SellerUser.FullName, @item.SellerUser.Email
<br />
<b>Amount</b>: $@System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"]
<b>Amount</b>: $@cost
</div>
<hr />
@if (!string.IsNullOrEmpty(item.SellerUserId) && !string.IsNullOrEmpty(item.BuyerUserId) && item.BuyerUserId == userid && !item.PaymentSent)
Expand All @@ -37,7 +39,7 @@
<form action="@VenmoUrl/@item.SellerUser.VenmoAccount" method="get" target="_blank">
<input type="hidden" name="txn" value="pay">
<input type="hidden" name="note" value="@System.Configuration.ConfigurationManager.AppSettings["SiteTitle"] - @item.Session.SessionDate.ToString("dddd, MM/dd/yyyy, HH:mm")">
<input type="hidden" name="amount" value="@System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"]">
<input type="hidden" name="amount" value="@cost">
<input type="image" src="~/Content/venmo.png" width="150" border="0" name="submit" alt="Venmo - Fast, safe, social payments">
@if (!string.IsNullOrEmpty(item.SellerUser.MobileLast4))
{
Expand All @@ -60,7 +62,7 @@
<input type="hidden" name="business" value="@item.SellerUser.PayPalEmail">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="@System.Configuration.ConfigurationManager.AppSettings["SiteTitle"] - @item.Session.SessionDate.ToString("dddd, MM/dd/yyyy, HH:mm")">
<input type="hidden" name="amount" value="@System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"]">
<input type="hidden" name="amount" value="@cost">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
Expand Down
7 changes: 7 additions & 0 deletions pickuphockey/Views/Sessions/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ViewBag.Title = "Create Session";
ViewBag.dst = new pickuphockey.Models.Session()._defaultStartTime.ToString(@"hh\:mm");
var _buyDayMinimum = System.Configuration.ConfigurationManager.AppSettings["BuyDayMinimum"];
var _cost = System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"];
}

<h2>Create Session</h2>
Expand Down Expand Up @@ -34,6 +35,12 @@
@Html.TextBoxFor(model => model.BuyDayMinimum, new { @Value = _buyDayMinimum, style = "width: 40px;" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Cost, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.Cost, new { @Value = _cost, style = "width: 60px;" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.RegularSetId, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
Expand Down
2 changes: 2 additions & 0 deletions pickuphockey/Views/Sessions/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var alreadySold = Model.AlreadySold();
var unmarkedReceivedCount = Model.UnmarkedReceived.Count();
var unmarkedSentCount = Model.UnmarkedSent.Count();
var cost = (Model.Cost == 0) ? System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"] : Model.Cost.ToString("F2");
}

<h2>@Html.DisplayFor(model => model.SessionDate)</h2>
Expand Down Expand Up @@ -152,6 +153,7 @@
</div>
}
</div>
<span>Cost: $@cost</span>
</div>
}
else
Expand Down
6 changes: 6 additions & 0 deletions pickuphockey/Views/Sessions/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
@Html.TextBoxFor(model => model.BuyDayMinimum, new { style = "width: 40px;" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Cost, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.Cost, new { style = "width: 60px;" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.RegularSetId, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
Expand Down
7 changes: 7 additions & 0 deletions pickuphockey/pickuphockey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@
<Compile Include="Migrations\202312061956109_Locker Room 13.designer.cs">
<DependentUpon>202312061956109_Locker Room 13.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202412112253129_SessionCost.cs" />
<Compile Include="Migrations\202412112253129_SessionCost.Designer.cs">
<DependentUpon>202412112253129_SessionCost.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\AccountViewModels.cs" />
<Compile Include="Models\ActivityLog.cs" />
Expand Down Expand Up @@ -809,6 +813,9 @@
<EmbeddedResource Include="Migrations\202312061956109_Locker Room 13.resx">
<DependentUpon>202312061956109_Locker Room 13.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202412112253129_SessionCost.resx">
<DependentUpon>202412112253129_SessionCost.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Expand Down
Loading

0 comments on commit 15d71ea

Please sign in to comment.