⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clubuserparameter.java

📁 GamVan Club v1.1 源代码
💻 JAVA
字号:
/*
 * Made in GamVan
 * 注册用户参数修改
 */
package com.gamvan.club.user;
import com.gamvan.conn.*;
import com.gamvan.club.ClubUsers;
import java.sql.*;
import com.gamvan.tools.*;
public class ClubUserParameter {
    private double userMoney=0, userMark=0, userCredit=0, userUpfileSize=0;
    private int noEditc=0, noEditmn=0, noEditmk=0, noEdituf, actType=0, userUpfile=0, userUpfileOpen=0;
    private int noEditufz=0, userPicIs=0;
    private String message = new String();
    ConnClub bridge = new ConnClub();
    Gb clubgb = new Gb();
    public void userParameter(String username) throws Exception{
       String sqlCommand = "";
       Connection con = bridge.getConnection();
       ClubUsers cu = new ClubUsers();
       message = "参数更新开始!";
       try{
           message = "用户参数信息更新完毕!";
           if(username.equals("*")){
                   sqlCommand = "Update GVclubUsers set userUpfileOpen="+ userUpfileOpen +"";
                   sqlCommand += ", userPicIs="+ userPicIs +"";
                   if(actType==1){
                       if(noEditc==1){
                           sqlCommand += ", userCredit="+ userCredit +"";
                       }
                       if(noEditmn==1){
                           sqlCommand += ", userMoney="+ userMoney +"";
                       }
                       if(noEditmk==1){
                           sqlCommand += ", userMark="+ userMark +"";
                       }
                       if(noEdituf==1){
                           sqlCommand += ", userUpfile="+ userUpfile +"";
                       }
                       if(noEditufz==1){
                           sqlCommand += ", userUpfileSize="+ userUpfileSize +"";
                       }              
                   }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(noEdituf==1){
                           sqlCommand += ", userUpfile= userUpfile + "+ userUpfile +"";
                       } 
                       if(noEditufz==1){
                           sqlCommand += ", userUpfileSize= userUpfileSize + "+ userUpfileSize +"";
                       }    
                   }
                   PreparedStatement pps = con.prepareStatement(sqlCommand);
                   pps.executeUpdate();
                   pps.close();
           }else{
               if(!cu.userSelect(username)){
                   message = "操作失败,用户ID:<strong>"+ username +"</strong> 没有注册或已被删除!";
               }else{
                   sqlCommand = "Update GVclubUsers set userUpfileOpen="+ userUpfileOpen +"";
                   sqlCommand += ", userPicIs="+ userPicIs +"";
                   if(actType==1){
                       if(noEditc==1){
                           sqlCommand += ", userCredit="+ userCredit +"";
                       }
                       if(noEditmn==1){
                           sqlCommand += ", userMoney="+ userMoney +"";
                       }
                       if(noEditmk==1){
                           sqlCommand += ", userMark="+ userMark +"";
                       }
                       if(noEdituf==1){
                           sqlCommand += ", userUpfile="+ userUpfile +"";
                       }
                       if(noEditufz==1){
                           sqlCommand += ", userUpfileSize="+ userUpfileSize +"";
                       }              
                   }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(noEdituf==1){
                           sqlCommand += ", userUpfile= userUpfile + "+ userUpfile +"";
                       } 
                       if(noEditufz==1){
                           sqlCommand += ", userUpfileSize= userUpfileSize + "+ userUpfileSize +"";
                       }  
                   }
                   sqlCommand += "  where userName='"+ username +"'";
                   PreparedStatement pps = con.prepareStatement(sqlCommand);
                   pps.executeUpdate();
                   pps.close();
                }
           }
           //message = sqlCommand;
        }catch(Exception e){
           message = "系统遭遇一个美丽的错误,操作被意外中止!";
           con.close();
        }finally{
           con.close();
        }
        username = null;
    }
    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=1;
        }
    }
    public void setNoEditmn(String noEditmn){
        try{
            this.noEditmn=Integer.parseInt(noEditmn);
        }catch(Exception e){
            this.noEditmn=1;
        }
    }
    public void setNoEdituf(String noEdituf){
        try{
            this.noEdituf=Integer.parseInt(noEdituf);
        }catch(Exception e){
            this.noEdituf=1;
        }
    }
    public void setNoEditmk(String noEditmk){
        try{
            this.noEditmk=Integer.parseInt(noEditmk);
        }catch(Exception e){
            this.noEditmk=1;
        }
    } 
    public void setUserUpfile(String userUpfile){
        if(userUpfile!=null){
            this.userUpfile=Integer.parseInt(userUpfile);
        }else{
            this.userUpfile=0;
        }
    }
    public void setUserUpfileOpen(String userUpfileOpen){
        if(userUpfileOpen!=null){
            this.userUpfileOpen=Integer.parseInt(userUpfileOpen);
        }else{
            this.userUpfileOpen=0;
        }
    }   
    public void setActType(String actType){
        try{
            this.actType=Integer.parseInt(actType);
        }catch(Exception e){
            this.actType=0;
        }
    } 
    public void setUserUpfileSize(String userUpfileSize){
        if(userUpfileSize!=null){
            this.userUpfileSize=Integer.parseInt(userUpfileSize);
        }else{
            this.userUpfileSize=0;
        }
    } 
    public void setUserUpfileSize(int userUpfileSize){
        this.userUpfileSize=userUpfileSize;
    }
    public void setNoEditufz(String noEditufz){
        try{
            this.noEditufz=Integer.parseInt(noEditufz);
        }catch(Exception e){
            this.noEditufz=1;
        }
    } 
    public void setUserPicIs(String userPicIs){
        try{
            this.userPicIs=Integer.parseInt(userPicIs);
        }catch(Exception e){
            this.userPicIs=0;
        }
    } 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -