📄 staffmember.java
字号:
/* CRMS, customer relationship management system Copyright (C) 2003 Service To Youth Council This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information contact the SYC ICT department on GPL@syc.net.au 98 Kermode Street North Adelaide South Australia SA 5006 +61 (0)8 8367 0755 *//* * StaffMember.java * * Created on 17 April 2003, 11:10 */package crms.vo;import java.util.*;/** * * @author dmurphy */public class StaffMember { /*public static StaffMember ALL_STAFF = new StaffMember("All Staff","(Requires Approval)","everyone", "All Staff", "All Staff", "All Staff", false); */ public static StaffMember STAFF_MEMBER_REMOVED = new StaffMember("Removed", "Staff Member", "nobody", "N/A", "N/A", "N/A", false); private String firstName = null; private String lastName = null; private String uid = null; private String department = null; private String location = null; private String jobTitle = null; private String mobile = null; private String email = null; private boolean isUser = true; private boolean canSMS = false; private int power = 0; /** Creates a new instance of StaffMember */ public StaffMember() { } public StaffMember(String firstName, String lastName, String uid, String department, String location, String jobTitle, boolean isUser) { this.firstName = firstName; this.lastName = lastName; this.uid = uid; this.department = department; this.location = location; this.jobTitle = jobTitle; this.isUser = isUser; } public void setFirstName(String name) { this.firstName = name; } public String getFirstName() { return firstName; } public void setLastName(String name) { this.lastName = name; } public String getLastName() { return lastName; } public void setUID(String id) { this.uid = id; } public String getUID() { return uid; } public void setDepartment(String department) { this.department = department; } public String getDepartment() { return department; } public void setLocation(String location) { this.location = location; } public String getLocation() { return location; } public void setPower(int new_power) { power = new_power; } public int getPower() { return power; } public void setJobTitle(String title) { this.jobTitle = title; } public String getJobTitle() { return jobTitle; } public void setIsUser(boolean isUser) { this.isUser = isUser; } public boolean getIsUser() { return isUser; } public void setCanSMS(boolean new_cansms) { canSMS = new_cansms; } public boolean getCanSMS() { return canSMS; } public void setMobile(String new_mobile) { mobile = new_mobile; } public String getMobile() { return mobile; } public void setEmail(String new_email) { email = new_email; } public String getEmail() { return email; } public StringBuffer toXML() { StringBuffer buf = new StringBuffer(); buf.append(" <staff-member>\n"); buf.append(" <uid>" + getUID() + "</uid>\n"); buf.append(" <location>" + encode(getLocation()) + "</location>\n"); buf.append(" <department>" + encode(getDepartment()) + "</department>\n"); buf.append(" <first-name>" + encode(getFirstName()) + "</first-name>\n"); buf.append(" <last-name>" + encode(getLastName()) + "</last-name>\n"); buf.append(" <job-title>" + encode(getJobTitle()) + "</job-title>\n"); buf.append(" </staff-member>\n"); return buf; } public String toString() { String buf = getFirstName() + " " + getLastName(); return buf.trim(); } public static Comparator USERS_SORT_ORDER = new Comparator() { public int compare(Object o1, Object o2) { StaffMember sm1 = (StaffMember) o1; StaffMember sm2 = (StaffMember) o2; // if you can step over the broom you'r a winner :-) if ( (sm1.getLocation() != null && sm2.getLocation() == null) || (sm1.getLocation() == null && sm2.getLocation() != null)) { return 1; } else if (!sm1.getLocation().equals(sm2.getLocation())) { return sm1.getLocation().compareTo(sm2.getLocation()); } else if (!sm1.getDepartment().equals(sm2.getDepartment())) { return sm1.getDepartment().compareTo(sm2.getDepartment()); } else if (!sm1.getLastName().equals(sm2.getLastName())) { return sm1.getLastName().compareTo(sm2.getLastName()); } else { return sm1.getFirstName().compareTo(sm2.getFirstName()); } } }; public String encode(String toEncode) { if (toEncode == null) { return null; } try { return java.net.URLEncoder.encode(toEncode, "UTF8").trim(); } catch (java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } } public String decode(String toDecode) { try { return java.net.URLDecoder.decode(toDecode, "UTF8").trim(); } catch (java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -