diff --git a/pickuphockey/Controllers/SessionsController.cs b/pickuphockey/Controllers/SessionsController.cs index 38e6fce..d63dc38 100644 --- a/pickuphockey/Controllers/SessionsController.cs +++ b/pickuphockey/Controllers/SessionsController.cs @@ -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; @@ -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); diff --git a/pickuphockey/Migrations/202412112253129_SessionCost.Designer.cs b/pickuphockey/Migrations/202412112253129_SessionCost.Designer.cs new file mode 100644 index 0000000..5addf14 --- /dev/null +++ b/pickuphockey/Migrations/202412112253129_SessionCost.Designer.cs @@ -0,0 +1,29 @@ +// +namespace pickuphockey.Migrations +{ + using System.CodeDom.Compiler; + using System.Data.Entity.Migrations; + using System.Data.Entity.Migrations.Infrastructure; + using System.Resources; + + [GeneratedCode("EntityFramework.Migrations", "6.5.1")] + public sealed partial class SessionCost : IMigrationMetadata + { + private readonly ResourceManager Resources = new ResourceManager(typeof(SessionCost)); + + string IMigrationMetadata.Id + { + get { return "202412112253129_SessionCost"; } + } + + string IMigrationMetadata.Source + { + get { return null; } + } + + string IMigrationMetadata.Target + { + get { return Resources.GetString("Target"); } + } + } +} diff --git a/pickuphockey/Migrations/202412112253129_SessionCost.cs b/pickuphockey/Migrations/202412112253129_SessionCost.cs new file mode 100644 index 0000000..d9ce133 --- /dev/null +++ b/pickuphockey/Migrations/202412112253129_SessionCost.cs @@ -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"); + } + } +} diff --git a/pickuphockey/Migrations/202412112253129_SessionCost.resx b/pickuphockey/Migrations/202412112253129_SessionCost.resx new file mode 100644 index 0000000..7ccea14 --- /dev/null +++ b/pickuphockey/Migrations/202412112253129_SessionCost.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + H4sIAAAAAAAEAO1dWW/kuBF+D5D/IPRTEnjdPnYnk4G9gdceJ0bGB9yeTd4MWk23hdHRq2PWjWB/WR7yk/IXQurkLVKiDm+CwQBukfpYLFYVySJV9Z9//fvkz6+B73yFceJF4enicP9g4cDQjdZeuDldZOnzN+8Xf/7+t785+bgOXp0fq3rHuB56M0xOFy9puv2wXCbuCwxAsh94bhwl0XO670bBEqyj5dHBwZ+Wh4dLiCAWCMtxTu6zMPUCmP9AP8+j0IXbNAP+dbSGflI+RyWrHNW5AQFMtsCFp4ut537Jti+R+wXu9ovqC+fM9wAiZQX954UDwjBKQYoI/fA5gas0jsLNaoseAP9ht4Wo3jPwE1h24ENTXbcvB0e4L8vmxQrKzZI0CgwBD49L5izZ1zuxeFEzD7HvI2JzusO9zll4ujhzU+8revQp2iwctr0P536M6wqZvE+8uueQFfZquUDig/4dvXt/8Mc95zzz0yyG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EnTE1xfhbdZus1S1GUYPPnU5XW8W1e1n+c8omk+uc3vlyY2uoDI9PBF0Nvwh8zz1zXdl4IrahII7AYob9DisUzxTdrNrka64UITy4BK9tXeiwcYbH0EltyGK4A/RDSnDYnfJ7gB7q65zS8DaR8Imu0nFx7YxCBISozmffQTyfA6eP3+v5OrweBZxgAA + + + dbo + + \ No newline at end of file diff --git a/pickuphockey/Models/Session.cs b/pickuphockey/Models/Session.cs index 1313d23..ce62ab2 100644 --- a/pickuphockey/Models/Session.cs +++ b/pickuphockey/Models/Session.cs @@ -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 Regulars { get; set; } diff --git a/pickuphockey/Views/BuySells/Payment.cshtml b/pickuphockey/Views/BuySells/Payment.cshtml index d68dabd..a5ef6e3 100644 --- a/pickuphockey/Views/BuySells/Payment.cshtml +++ b/pickuphockey/Views/BuySells/Payment.cshtml @@ -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"); } Payment for a Spot for @ViewBag.SessionDate.ToString("dddd, MM/dd/yyyy, HH:mm") @@ -26,7 +28,7 @@ Seller: @item.SellerUser.FullName, @item.SellerUser.Email - Amount: $@System.Configuration.ConfigurationManager.AppSettings["SessionBuyPrice"] + Amount: $@cost @if (!string.IsNullOrEmpty(item.SellerUserId) && !string.IsNullOrEmpty(item.BuyerUserId) && item.BuyerUserId == userid && !item.PaymentSent) @@ -37,7 +39,7 @@ - + @if (!string.IsNullOrEmpty(item.SellerUser.MobileLast4)) { @@ -60,7 +62,7 @@ - + diff --git a/pickuphockey/Views/Sessions/Create.cshtml b/pickuphockey/Views/Sessions/Create.cshtml index 1b90b45..23ea1ce 100644 --- a/pickuphockey/Views/Sessions/Create.cshtml +++ b/pickuphockey/Views/Sessions/Create.cshtml @@ -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"]; } Create Session @@ -34,6 +35,12 @@ @Html.TextBoxFor(model => model.BuyDayMinimum, new { @Value = _buyDayMinimum, style = "width: 40px;" }) + + @Html.LabelFor(model => model.Cost, htmlAttributes: new { @class = "control-label col-md-2" }) + + @Html.TextBoxFor(model => model.Cost, new { @Value = _cost, style = "width: 60px;" }) + + @Html.LabelFor(model => model.RegularSetId, htmlAttributes: new { @class = "control-label col-md-2" }) diff --git a/pickuphockey/Views/Sessions/Details.cshtml b/pickuphockey/Views/Sessions/Details.cshtml index 6f33c2e..2e3f1f3 100644 --- a/pickuphockey/Views/Sessions/Details.cshtml +++ b/pickuphockey/Views/Sessions/Details.cshtml @@ -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"); } @Html.DisplayFor(model => model.SessionDate) @@ -152,6 +153,7 @@ } + Cost: $@cost } else diff --git a/pickuphockey/Views/Sessions/Edit.cshtml b/pickuphockey/Views/Sessions/Edit.cshtml index 24edfa7..0690242 100644 --- a/pickuphockey/Views/Sessions/Edit.cshtml +++ b/pickuphockey/Views/Sessions/Edit.cshtml @@ -36,6 +36,12 @@ @Html.TextBoxFor(model => model.BuyDayMinimum, new { style = "width: 40px;" }) + + @Html.LabelFor(model => model.Cost, htmlAttributes: new { @class = "control-label col-md-2" }) + + @Html.TextBoxFor(model => model.Cost, new { style = "width: 60px;" }) + + @Html.LabelFor(model => model.RegularSetId, htmlAttributes: new { @class = "control-label col-md-2" }) diff --git a/pickuphockey/pickuphockey.csproj b/pickuphockey/pickuphockey.csproj index f7189e7..caeaec2 100644 --- a/pickuphockey/pickuphockey.csproj +++ b/pickuphockey/pickuphockey.csproj @@ -425,6 +425,10 @@ 202312061956109_Locker Room 13.cs + + + 202412112253129_SessionCost.cs + @@ -809,6 +813,9 @@ 202312061956109_Locker Room 13.cs + + 202412112253129_SessionCost.cs + 10.0 diff --git a/scripts/Create Stub Account.sql b/scripts/Create Stub Account.sql index 385c962..82554d6 100644 --- a/scripts/Create Stub Account.sql +++ b/scripts/Create Stub Account.sql @@ -13,7 +13,7 @@ set @venmo = 'john-bryan-17' set @paypal = 'mail@johnbryan.tv' set @last4 = '1672' set @first = 'John' -set @last = 'Bryan - 24' -set @user = 'johnbryan24@brettmorrison.com' -insert into aspnetusers (id, email, emailconfirmed, phonenumberconfirmed, twofactorenabled, lockoutenabled, accessfailedcount, username, passwordhash, securitystamp, firstname, lastname, notificationpreference, paypalemail, venmoaccount, mobilelast4, active) -values (newid(), @user, 1, 0, 0, 1, 0, @user, newid(), newid(), @first, @last, 0, @paypal, @venmo, @last4, 0) +set @last = 'Bryan - 26' +set @user = 'johnbryan26@brettmorrison.com' +insert into aspnetusers (id, email, emailconfirmed, phonenumberconfirmed, twofactorenabled, lockoutenabled, accessfailedcount, username, passwordhash, securitystamp, firstname, lastname, notificationpreference, paypalemail, venmoaccount, mobilelast4, active, NormalizedEmail, NormalizedUserName) +values (newid(), @user, 1, 0, 0, 1, 0, @user, newid(), newid(), @first, @last, 0, @paypal, @venmo, @last4, 0, UPPER(@user), UPPER(@user))