private void DisplayPage(int PageNumber, String Status) { int Poll1Count = (PageNumber - 1) * 2 + 1; int Poll2Count = (PageNumber - 1) * 2 + 2; p = new PollData(); pollCount = p.GetTotalPollCount(muser.currentResident.SocietyID, DisplayStatus); lblPollP1.Text = "Poll " + Poll1Count + " of " + pollCount; lblPollP2.Text = "Poll " + Poll2Count + " of " + pollCount; String orderby = ""; p = new PollData(); pollList = p.GetData(currPageNumber, orderby, muser.currentResident.SocietyID, Status); if (pollList.Count != 0) { lblEmptyPie1.Visible = false; if (PageNumber == 1) { btnPreBottom.Visible = false; } else { btnPreBottom.Visible = true; } if (pollCount <= currPageNumber * 2) { btnNextBottom.Visible = false; } else { btnNextBottom.Visible = true; pnlchart2.Visible = true; } CreatePieChart1(pollList[0]); if (pollCount >= currPageNumber * 2) { CreatePieChart2(pollList[1]); } else { HidePieChart2(); } } else { ShowEmptyPage(); } }
private void SetFields() { currPageNumber = 1; p = new PollData(); pollCount = p.GetTotalPollCount(muser.currentResident.SocietyID, DisplayStatus); if (pollCount == 0) { ShowEmptyPage(); } else { DisplayPage(currPageNumber, DisplayStatus); } }