Advertisement
Guest User

Untitled

a guest
May 5th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. //date dt = date.newinstance(2015, 04, 01);
  2. get {
  3. if(con == null) {
  4. con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Proposal_Application_Number__c,SP_License_No__c,Principle_Code__c,Account_Full_Name__c,
  5. Policy_Issue_date__c,Sum_Assured__c,Payment_Frequency__c,Modal_Premium__c,ProductDetail__r.Scheme_Name__c,
  6. ProductDetail__r.Term__c from Proposal_Details__c where (vertical__c='LI' or vertical__c='HI') and
  7. (Status_del__c='Issued' or Status_del__c='Death' or Status_del__c='Lapsed' or Status_del__c='Surrendered')
  8. and Proposal_Date__c >: dt ORDER BY Proposal_Application_Number__c asc ]));
  9. // sets the number of records in each page set
  10. con.setPageSize(100);
  11. }
  12. return con;
  13. }
  14. set;
  15. }
  16.  
  17. // returns a list of wrapper objects for the sObjects in the current page set
  18. public List<SPWrapper> getSPs() {
  19. SPs = new List<SPWrapper>();
  20. for (Proposal_Details__c SP1 : (List<Proposal_Details__c>)con.getRecords())
  21. SPs.add(new SPWrapper(SP1));
  22.  
  23. return SPs;
  24. }
  25.  
  26. // displays the selected items
  27. public PageReference process() {
  28. for (SPWrapper SP2 : SPs) {
  29. if (SP2.checked)
  30. ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,SP2.pro.Proposal_Application_Number__c));
  31. }
  32. return null;
  33. }
  34.  
  35. // indicates whether there are more records after the current page set.
  36. public Boolean hasNext {
  37. get {
  38. return con.getHasNext();
  39. }
  40. set;
  41. }
  42.  
  43. // indicates whether there are more records before the current page set.
  44. public Boolean hasPrevious {
  45. get {
  46. return con.getHasPrevious();
  47. }
  48. set;
  49. }
  50.  
  51. // returns the page number of the current page set
  52. public Integer pageNumber {
  53. get {
  54. return con.getPageNumber();
  55. }
  56. set;
  57. }
  58.  
  59. // returns the first page of records
  60. public void first() {
  61. con.first();
  62. }
  63.  
  64. // returns the last page of records
  65. public void last() {
  66. con.last();
  67. }
  68.  
  69. // returns the previous page of records
  70. public void previous() {
  71. con.previous();
  72. }
  73.  
  74. // returns the next page of records
  75. public void next() {
  76. con.next();
  77. }
  78.  
  79. // returns the PageReference of the original page, if known, or the home page.
  80. public void cancel() {
  81. con.cancel();
  82. }
  83.  
  84. <!--<apex:pageBlockButtons location="top">
  85. <apex:commandButton action="{!process}" value="Process Selected"/>
  86. <apex:commandButton action="{!cancel}" value="Cancel"/>
  87. </apex:pageBlockButtons>
  88. <apex:pageMessages />-->
  89.  
  90. <apex:pageBlockSection title="Page #{!pageNumber}" columns="1">
  91. <apex:pageBlockTable value="{!SPs}" var="p">
  92.  
  93. <apex:column value="{!p.pro.Proposal_Application_Number__c}" headerValue="Proposal/Application Number"/>
  94. <apex:column value="{!p.pro.SP_License_No__c}" headerValue="Sp License No"/>
  95. <apex:column value="{!p.pro.Principle_Code__c}" headerValue="Principal Code"/>
  96. <apex:column value="{!p.pro.Account_Full_Name__c}" headerValue="Account Name"/>
  97. <apex:column value="{!p.pro.Policy_Issue_date__c}" headerValue="Policy Issue date"/>
  98. <apex:column value="{!p.pro.Sum_Assured__c}" headerValue="Sum Assured"/>
  99. <apex:column value="{!p.pro.Payment_Frequency__c}" headerValue="Payment Frequency"/>
  100. <apex:column value="{!p.pro.Modal_Premium__c}" headerValue="Modal Premium"/>
  101. <apex:column value="{!p.pro.ProductDetail__r.Scheme_Name__c}" headerValue="Scheme Name"/>
  102. <apex:column value="{!p.pro.ProductDetail__r.Term__c}" headerValue="Term"/>
  103. </apex:pageBlockTable>
  104. </apex:pageBlockSection>
  105. </apex:pageBlock>
  106.  
  107. <apex:panelGrid columns="4">
  108. <apex:commandLink action="{!first}">First</apex:commandlink>
  109. <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink>
  110. <apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink>
  111. <apex:commandLink action="{!last}">Last</apex:commandlink>
  112. </apex:panelGrid>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement