RDN-1161
1

Sponsors I Used Link

Scott on 9/9/2015 5:54 PM

Scott on 11/27/2015 4:27 AM

%
(hrs)
Logged

0 (hrs)


 Description

On the League > Sponsors > View page, The button in the upper right hand corner needs to be updated.

  1. Instead of "Used", put "I Used (COUNT)"
  2. COUNT is the number of users who have used this sponsor.  This property already exists under the Code Used Count.
  3. Change the Title of "Code Used Count" to "Times Used".
Skip Navigation Links
 

Scott Thursday, October 29, 2015 8:07 PM #

did you check it in?  If so, please change the status to checked in.

 

Icatalin Thursday, October 29, 2015 4:47 PM #

I have reformat the code, if something is not ok let me know.

 

Scott Wednesday, October 21, 2015 3:29 AM #

The code works, so its good, but I need you to reformat the SponsorsViewModel.js

Please look at the other view models and reformat the class.

 

Scott Sunday, September 27, 2015 4:55 PM #

Please put this code into a ViewModel. You can put it in RDN.League.Scripts.ViewModels.Sponsors.SponsorsViewModel.js.  You will have to create this file/folder.  You will also need to see what the other view models do to stay within coding standards.  You will also have to include this file in the RouteBundles in the Global.ASAX file.

+ $(document).ready(function () { + + function viewModel() { + var self = this; + self.usedCount = ko.observable('@Model.UsedCount'); + return self; + } + var vm = new viewModel(); + ko.applyBindings(vm); + + $('#btnUseCode').click(function () { + var url = '@Url.Action("UseCode", "Sponsor")'; + $.ajax({ + url: url, + dataType: 'json', + contentType: 'application/json', + cache: false, + success: function (data) { + vm.usedCount(data); + $('.bottom-right').notify({ + message: { text: 'Successfully Used' }, + type: "success", + fadeOut: { enabled: true, delay: 4000 } + }).show(); + }, + error: function () { + $('.bottom-right').notify({ + message: { text: 'An error has occurred' }, + type: "danger", + fadeOut: { enabled: true, delay: 4000 } + }).show(); + } + }); + }); + });

 

Scott Saturday, September 26, 2015 8:11 PM #

When clicking the button, I don't want to use a post back.

  1. When clicking the button, an AJAX request should be made to the controller.
  2. On the ajax successful response, a bootstrap Notify should be show in the bottom right.  It should be called "Successfully Used".
  3. When the Ajax response comes back, the times used count should be updated.

 


Powered by BugNET 1.6.339.0