Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //date dt = date.newinstance(2015, 04, 01);
- get {
- if(con == null) {
- con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT Proposal_Application_Number__c,SP_License_No__c,Principle_Code__c,Account_Full_Name__c,
- Policy_Issue_date__c,Sum_Assured__c,Payment_Frequency__c,Modal_Premium__c,ProductDetail__r.Scheme_Name__c,
- ProductDetail__r.Term__c from Proposal_Details__c where (vertical__c='LI' or vertical__c='HI') and
- (Status_del__c='Issued' or Status_del__c='Death' or Status_del__c='Lapsed' or Status_del__c='Surrendered')
- and Proposal_Date__c >: dt ORDER BY Proposal_Application_Number__c asc ]));
- // sets the number of records in each page set
- con.setPageSize(100);
- }
- return con;
- }
- set;
- }
- // returns a list of wrapper objects for the sObjects in the current page set
- public List<SPWrapper> getSPs() {
- SPs = new List<SPWrapper>();
- for (Proposal_Details__c SP1 : (List<Proposal_Details__c>)con.getRecords())
- SPs.add(new SPWrapper(SP1));
- return SPs;
- }
- // displays the selected items
- public PageReference process() {
- for (SPWrapper SP2 : SPs) {
- if (SP2.checked)
- ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,SP2.pro.Proposal_Application_Number__c));
- }
- return null;
- }
- // indicates whether there are more records after the current page set.
- public Boolean hasNext {
- get {
- return con.getHasNext();
- }
- set;
- }
- // indicates whether there are more records before the current page set.
- public Boolean hasPrevious {
- get {
- return con.getHasPrevious();
- }
- set;
- }
- // returns the page number of the current page set
- public Integer pageNumber {
- get {
- return con.getPageNumber();
- }
- set;
- }
- // returns the first page of records
- public void first() {
- con.first();
- }
- // returns the last page of records
- public void last() {
- con.last();
- }
- // returns the previous page of records
- public void previous() {
- con.previous();
- }
- // returns the next page of records
- public void next() {
- con.next();
- }
- // returns the PageReference of the original page, if known, or the home page.
- public void cancel() {
- con.cancel();
- }
- <!--<apex:pageBlockButtons location="top">
- <apex:commandButton action="{!process}" value="Process Selected"/>
- <apex:commandButton action="{!cancel}" value="Cancel"/>
- </apex:pageBlockButtons>
- <apex:pageMessages />-->
- <apex:pageBlockSection title="Page #{!pageNumber}" columns="1">
- <apex:pageBlockTable value="{!SPs}" var="p">
- <apex:column value="{!p.pro.Proposal_Application_Number__c}" headerValue="Proposal/Application Number"/>
- <apex:column value="{!p.pro.SP_License_No__c}" headerValue="Sp License No"/>
- <apex:column value="{!p.pro.Principle_Code__c}" headerValue="Principal Code"/>
- <apex:column value="{!p.pro.Account_Full_Name__c}" headerValue="Account Name"/>
- <apex:column value="{!p.pro.Policy_Issue_date__c}" headerValue="Policy Issue date"/>
- <apex:column value="{!p.pro.Sum_Assured__c}" headerValue="Sum Assured"/>
- <apex:column value="{!p.pro.Payment_Frequency__c}" headerValue="Payment Frequency"/>
- <apex:column value="{!p.pro.Modal_Premium__c}" headerValue="Modal Premium"/>
- <apex:column value="{!p.pro.ProductDetail__r.Scheme_Name__c}" headerValue="Scheme Name"/>
- <apex:column value="{!p.pro.ProductDetail__r.Term__c}" headerValue="Term"/>
- </apex:pageBlockTable>
- </apex:pageBlockSection>
- </apex:pageBlock>
- <apex:panelGrid columns="4">
- <apex:commandLink action="{!first}">First</apex:commandlink>
- <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink>
- <apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink>
- <apex:commandLink action="{!last}">Last</apex:commandlink>
- </apex:panelGrid>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement