📄 classcuraction.java
字号:
package com.comingnet.action;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.db.*;
import com.opensymphony.xwork2.ActionSupport;
public class ClassCurAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private String kcmc,kclrr,mark,bjbh;
private int bkid,jsbh,kcjc,xxbh;
private int swks=0,ltcs=0,yxd=0;
public int getLtcs() {
return ltcs;
}
public void setLtcs(int ltcs) {
this.ltcs = ltcs;
}
public int getSwks() {
return swks;
}
public void setSwks(int swks) {
this.swks = swks;
}
public int getYxd() {
return yxd;
}
public void setYxd(int yxd) {
this.yxd = yxd;
}
public String getBjbh() {
return bjbh;
}
public void setBjbh(String bjbh) {
this.bjbh = bjbh;
}
public int getBkid() {
return bkid;
}
public void setBkid(int bkid) {
this.bkid = bkid;
}
public int getJsbh() {
return jsbh;
}
public void setJsbh(int jsbh) {
this.jsbh = jsbh;
}
public int getKcjc() {
return kcjc;
}
public void setKcjc(int kcjc) {
this.kcjc = kcjc;
}
public String getKcmc() {
return kcmc;
}
public void setKcmc(String kcmc) {
this.kcmc = kcmc;
}
public int getXxbh() {
return xxbh;
}
public void setXxbh(int xxbh) {
this.xxbh = xxbh;
}
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
@Override
public String execute(){
String sql="";
DBOperator dbop=new DBOperator();
System.out.println("getMark()--->"+getMark());
if(getMark().equals("add")){
try {
ArrayList list0=null;
ArrayList list=null;
list0=dbop.ExecuteSelect(false, "select a.jcid from m_sortcurrm a, m_teacher b ,m_class_cur c ,m_class d where a.bjbh=d.bjid and b.jsid =c.jsbh and c.kcmc=a.kcmc and c.bjbh=a.bjbh and b.jsid="+jsbh+" order by a.jcid");
String temp=",";
for(int j=0;j<list0.size();j++){
list=(ArrayList)list0.get(j) ;
temp=temp+list.get(0).toString()+",";
}
dbop.insert("update m_teacher set jskcjc='"+temp+"' where jsid="+jsbh);
int id=dbop.getId("m_class_cur","bkid");
sql="insert into m_class_cur(bkid,bjbh,jsbh,kcmc,kcjc,xxbh,swks,ltshu,yxdz)values("+id+","+getBjbh()+","+getJsbh()+",'"+getKcmc()+"',"+getKcjc()+","+getXxbh()+","+swks+","+ltcs+","+yxd+")";
}
catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
sql="update m_class_cur set bjbh="+getBjbh()+",jsbh="+getJsbh()+",kcmc='"+getKcmc()+"',kcjc="+kcjc+",ltshu="+ltcs+",swks="+swks+",yxdz="+yxd+" where bkid="+getBkid();
}
System.out.println(sql);
dbop.insert(sql);
if(swks>=0){
return ERROR;
}else{
return SUCCESS;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -