RDN-28
1

Dues Items Forward and backward

Scott on 5/16/2015 4:29 AM

Scott on 9/13/2015 7:30 PM

%
(hrs)
Logged

0 (hrs)


 Description

It would be really nice to be able to move from one month to the next (kind of like how the calendar arrows take you to the next or preceding month), instead of having to go back to the main dues page and select the month.

  1. Go to Dues
  2. Click on a Dues Item
  3. We need to add Forward and Backward links to the top of this page.
  4. The Forward link should go to the next chronological Dues item in the list of dues items IF it exists.
  5. The Backward link should go the previous chronological dues item in the list IF there is one.
  6. Please see attached screen shot for an example.
  7. Go back to the Dues Collection List.
  8. Click on the EDIT button of a dues item.
  9. This edit screen should have the same forward and backward links.
  10. Please make sure that the edit screen forward and backward links go forward and backward on the EDIT dues item pages.
Skip Navigation Links
 

Scott Wednesday, September 09, 2015 4:17 PM #

please don't put styles inline.  Please put it in the main.css.  There should already be a css class called pull-left and pull-right.

style="text-align:right;"

style="text-align:left;"

 

Scott Wednesday, August 05, 2015 8:20 PM #

Hey Pradeep, 

please review the screenshot.  

  1. The previous button needs to be on the left hand side and the next button on the right hand side.
  2. Please also remove the text.  
  3. Make the buttons look exactly like the screenshot.
  4. The Next Button actually is going to the previous dues item.  The previous dues item is actually going to the next.  The links you have on the buttons need to be swapped.
  5. If there is NO previous dues item, the button should NOT show.
  6. If there is NO Next Dues item, the button should NOT show.
 

Scott Thursday, May 28, 2015 8:41 PM #

The dues items can be found from the query that that call makes.  Go into that method and find the next dues item and the last dues item within the query.  We pull from the the dues items, so find the next and previous dues item when your orderby shouldn't be too hard.  Then save those to two more properties within the dues item class.  Does that make sense?

 

Pradeep Wednesday, May 27, 2015 6:15 PM #

Hi Scott, As per your suggestion to get next and previous Dues the following methods needed to use 

"DuesFactory.GetDuesCollectionItem(Convert.ToInt64(duesItemId), new Guid(duesManagementId), RDN.Library.Classes.Account.User.GetMemberId());" but I see this method return the DuesCollectionItem of given duesItemId, however we needed to get all DuesCollection as we have (DuesFactory.GetDuesObject()) so that next or previous can be find out from that collection.

So please post your comments on it.

looking forward your response.

Thanks

Pradeep

 

Scott Tuesday, May 26, 2015 3:19 AM #

This looks really bad.

 if (TempData["DueItemId"] != null)
                {
                    List<long> DueItemIdCollection = (List<long>)TempData["DueItemId"];

                    TempData.Keep("DueItemId");

                    int currentItemIndex = DueItemIdCollection.FindIndex(item => item.Equals(Convert.ToInt64(duesItemId)));
                    if (currentItemIndex >= 0)
                    {
                        if (currentItemIndex == 0) //check to see its first element
                        {
                            ViewBag.nextDueItem = DueItemIdCollection[currentItemIndex + 1];
                            ViewBag.previousDueItem = 0;
                        }
                        else if (currentItemIndex != 0 && (currentItemIndex + 1 != DueItemIdCollection.Count()))
                        {
                            ViewBag.nextDueItem = DueItemIdCollection[currentItemIndex + 1];
                            ViewBag.previousDueItem = DueItemIdCollection[currentItemIndex - 1];
                        }
                        else //check to see its last element
                        {
                            ViewBag.nextDueItem = 0;
                            ViewBag.previousDueItem = DueItemIdCollection[currentItemIndex - 1];
                        }
                    }
                }

 

You should be pulling the previous and next dues item from the following method.

 var dues = DuesFactory.GetDuesCollectionItem(Convert.ToInt64(duesItemId), new Guid(duesManagementId), RDN.Library.Classes.Account.User.GetMemberId());

So please remove the code above and go into GetDuesCollectionItem and find the previous and next dues items within the database.  If you need help, please ask, but the TempData way isn't the way to do it.  Also add two properties to the model instead of storing them into the ViewBag....


Powered by BugNET 1.6.339.0