📄 clubuserparameter.java
字号:
/* * Made in GamVan * 注册用户参数修改 */package com.gamvan.club.user;import com.gamvan.conn.*;import java.sql.*;public class ClubUserParameter { private double userMoney=0, userMark=0, userCredit=0; private int noEditc=0, noEditmn=0, noEditmk=0, actType=0; private String message = new String(); ConnClub bridge = new ConnClub(); public void userParameter(String username) throws Exception{ String sqlCommand = ""; Connection con = bridge.getConnection(); message = "参数更新开始!"; try{ message = "用户参数信息更新完毕!"; sqlCommand = "Update GVclubUsers set userName=userName"; if(actType==1){ if(noEditc!=1){ sqlCommand += ", userCredit="+ userCredit +""; } if(noEditmn!=1){ sqlCommand += ", userMoney="+ userMoney +""; } if(noEditmk!=1){ sqlCommand += ", userMark="+ userMark +""; } }else if(actType==2){ if(noEditc!=1){ sqlCommand += ", userCredit= userCredit + "+ userCredit +""; } if(noEditmn!=1){ sqlCommand += ", userMoney= userMoney + "+ userMoney +""; } if(noEditmk!=1){ sqlCommand += ", userMark= userMark + "+ userMark +""; } } if(!username.equals("*")){ sqlCommand += " where userName='"+ username +"'"; } PreparedStatement pps = con.prepareStatement(sqlCommand); pps.executeUpdate(); pps.close(); }catch(Exception e){ message = "系统遭遇一个美丽的错误,操作被意外中止!"; con.close(); }finally{ con.close(); } } public String getMessage(){ return this.message; } public void setUserMark(String userMark){ try{ this.userMark = Double.parseDouble(userMark); }catch(Exception e){ this.userMark = 0; } } public void setUserMoney(String userMoney){ try{ this.userMoney = Double.parseDouble(userMoney); }catch(Exception e){ this.userMoney = 0; } } public void setUserCredit(String userCredit){ try{ this.userCredit = Double.parseDouble(userCredit); }catch(Exception e){ this.userCredit = 0; } } public void setNoEditc(String noEditc){ try{ this.noEditc=Integer.parseInt(noEditc); }catch(Exception e){ this.noEditc=0; } } public void setNoEditmn(String noEditmn){ try{ this.noEditmn=Integer.parseInt(noEditmn); }catch(Exception e){ this.noEditmn=0; } } public void setNoEditmk(String noEditmk){ try{ this.noEditmk=Integer.parseInt(noEditmk); }catch(Exception e){ this.noEditmk=0; } } public void setActType(String actType){ try{ this.actType=Integer.parseInt(actType); }catch(Exception e){ this.actType=0; } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -