电子商务毕业论文 第7页
电子商务毕业论文 第7页
}
public String getNames() {
return Names;
}
public void setNames(String newNames) {
this.Names = newNames;
}
public String getSex() {
return Sex;
}
public void setSex(String newSex) {
this.Sex = newSex;
}
public String getAddress() {
return Address;
}
public void setAddress(String newAddress) {
this.Address = newAddress;
}
public String getPhone() {
return Phone;
}
public void setPhone(String newPhone) {
this.Phone = newPhone;
}
public String getPost() {
return Post;
}
public void setPost(String newPost) {
this.Post = newPost;
}
public String getEmail() {
return Email;
}
public void setEmail(String newEmail) {
this.Email = newEmail;
}
public String getRegTime() {
return RegTime;
}
public void setRegTime(String newRegTime) {
this.RegTime = newRegTime;
}
public String getRegIpAddress() {
return RegIpAddress;
}
public void setRegIpAddress(String newRegIpAddress) {
this.RegIpAddress = newRegIpAddress;
}
public int getUserPoint() {
return UserPoint;
}
public void setUserPoint(int userpoint) {
this.UserPoint = userpoint;
}
}
Run包:
login.java
package cdshop.run;
/**
* <p>管理用户登录的类 </p>
*/
import cdshop.util.*;
public class login extends DataBase {
private String username; //登录用户名
private String passwd; //登录密码
private boolean isadmin; //是否管理员登录
private long userid=0; //用户ID号
public login() throws Exception{
super();
username = "";
passwd = "";
isadmin = false;
}
public String getUsername() {
return username;
}
public void setUsername(String newusername) {
username = newusername;
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String newpasswd) {
passwd = newpasswd;
}
public boolean getIsadmin() {
return isadmin;
}
public void setIsadmin(boolean newIsadmin) {
isadmin = newIsadmin;
}
public long getUserid() {
return userid;
}
public void setUserid (long uid) {
userid = uid;
}
/**
* 获得查询用户信息的sql语句
* @return
*/
public String getSql() {
if (isadmin) {
sqlStr = "select * from cdAdmin where adminuser = '" +
dataFormat.toSql(username) + "' and adminpass = '" +
dataFormat.toSql(passwd) + "'";
}else {
sqlStr = "select * from shop_user where username = '" +
username + "' and password = '" + passwd + "'";
}
return sqlStr;
}
/**
* 执行查询
* @return
* @throws java.lang.Exception
*/
public boolean excute() throws Exception {
boolean flag = false;
DataBase db = new DataBase();
db.connect();
stmt = db.conn.createStatement ();
rs = stmt.executeQuery(getSql());
if (rs.next()){
if (!isadmin)
{
userid = rs.getLong("id");
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>