Scott on 5/16/2015 4:29 AM
Scott on 9/13/2015 7:30 PM
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.
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;"
Hey Pradeep,
please review the screenshot.
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?
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
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....