Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class clist {
- private integer count=0;
- private integer listsize=10;
- public integer totalsize;
- public String cId {get; set;}
- public String firstName{get;set;}
- public String lastName{get;set;}
- public String phone{get;set;}
- public String Email{get;set;}
- list <contact> conList;
- public List<Contact> getContact()
- {
- list<Contact> conlist=[select id, FirstName,LastName,Email,Phone,AccountId from Contact limit :listsize offset : count ];
- totalsize = [select count() from Contact];
- return conlist;
- }
- public PageReference Previous() {
- count -= listsize;
- return null;
- }
- public PageReference Next() {
- count += listsize;
- getct();
- return null;
- }
- public PageReference Last() {
- count = totalsize - math.mod(totalsize, listsize);
- return null;
- }
- public Boolean getDisablePrevious() {
- if (count>0)
- return false;
- else
- return true;
- }
- public Boolean getDisableNext() {
- if (count + listsize < totalsize)
- return false;
- else
- return true;
- }
- public Integer getTotal_size() {
- return totalsize;
- }
- public Integer getPagect() {
- return count/listsize + 1;
- }
- public Integer getTotalPages() {
- if (math.mod(totalsize, listsize) > 0)
- {
- return totalsize/listsize + 1;
- }
- else
- {
- return (totalsize/listsize);
- }
- }
- public PageReference DeleteContact() {
- Contact del = new Contact();
- del=[select Id from Contact where id =:cId];
- delete del;
- PageReference ref=new PageReference('/apex/AccountinlineEdit');
- ref.setredirect(true);
- return ref;
- }
- public void save1() {
- upsert conlist;
- }
- public clist(){
- conlist=new List<contact>();
- }
- public pageReference Save(){
- Contact con = new Contact(firstname=firstname, lastname=lastname, phone=phone,email=email);
- conList.add(con);
- insert conList;
- return null;
- }
- }
Add Comment
Please, Sign In to add comment