1 package com.dotmarketing.portlets.event_registrations.struts; 2 3 import javax.servlet.http.HttpServletRequest ; 4 5 import org.apache.struts.action.ActionErrors; 6 import org.apache.struts.action.ActionMapping; 7 import org.apache.struts.validator.ValidatorForm; 8 9 import com.liferay.portal.util.Constants; 10 11 12 public class WebEventAttendeeForm extends ValidatorForm { 13 private static final long serialVersionUID = 1L; 14 15 private long inode; private long eventRegistrationInode; private String firstName; private String lastName; private String badgeName; private String email; private String title; private float registrationPrice; 24 public WebEventAttendeeForm(long eventRegistrationInode, String firstName, String lastName, String badgeName, String email, String title, int registrationPrice) { 25 this.eventRegistrationInode = eventRegistrationInode; 26 this.firstName = firstName; 27 this.lastName = lastName; 28 this.badgeName = badgeName; 29 this.email = email; 30 this.title = title; 31 this.registrationPrice = registrationPrice; 32 } 33 34 public WebEventAttendeeForm() { 35 this.eventRegistrationInode = 0; 36 this.firstName = ""; 37 this.lastName = ""; 38 this.badgeName = ""; 39 this.email = ""; 40 this.title = ""; 41 this.registrationPrice = 0; 42 } 43 44 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 45 if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.ADD)) { 46 return super.validate(mapping, request); 47 } 48 return null; 49 } 50 public long getEventRegistrationInode() { 51 return this.eventRegistrationInode; 52 } 53 54 public void setEventRegistrationInode(long eventRegistrationInode) { 55 this.eventRegistrationInode = eventRegistrationInode; 56 } 57 public String getFirstName() { 58 return this.firstName; 59 } 60 61 public void setFirstName(String firstName) { 62 this.firstName = firstName; 63 } 64 public String getLastName() { 65 return this.lastName; 66 } 67 68 public void setLastName(String lastName) { 69 this.lastName = lastName; 70 } 71 public String getBadgeName() { 72 return this.badgeName; 73 } 74 75 public void setBadgeName(String badgeName) { 76 this.badgeName = badgeName; 77 } 78 public String getEmail() { 79 return this.email; 80 } 81 82 public void setEmail(String email) { 83 this.email = email; 84 } 85 public String getTitle() { 86 return this.title; 87 } 88 89 public void setTitle(String title) { 90 this.title = title; 91 } 92 public float getRegistrationPrice() { 93 return this.registrationPrice; 94 } 95 96 public void setRegistrationPrice(float registrationPrice) { 97 this.registrationPrice = registrationPrice; 98 } 99 100 103 public long getInode() { 104 return inode; 105 } 106 107 110 public void setInode(long inode) { 111 this.inode = inode; 112 } 113 114 @Override 115 public boolean equals(Object obj) { 116 if (obj instanceof WebEventAttendeeForm) { 117 WebEventAttendeeForm other = (WebEventAttendeeForm) obj; 118 if (other.email.toLowerCase().trim().equals(this.email.toLowerCase().trim()) && 119 other.firstName.toLowerCase().trim().equals(this.firstName.toLowerCase().trim()) && 120 other.lastName.toLowerCase().trim().equals(this.lastName.toLowerCase().trim())) { 121 return true; 122 } 123 } 124 return false; 125 } 126 127 128 129 } 130 | Popular Tags |