晋江文学城
下一章 上一章  目录  设置

2、修改 ...

  •   xxxpackage supermgr;

      import java.sql.*;

      public class Modify {

      //private Connection con;

      private String CurUnitSN = "";

      private String Act = "";

      private String RadioValue = "";

      private String PerValue = "";

      private JobTree Jobtree = null;

      private JobItem Jobitem = null;

      private JobItem Deptitem = null;

      private PersonTree Persontree = null;

      private PersonItem Personitem = null;

      public Modify() {

      }

      public String doModify(java.sql.Connection Con) {

      String returnStr = "";

      Jobtree = new JobTree(CurUnitSN, Con); //初始化JobTree

      System.out.println(

      "CurUnitSN="

      + CurUnitSN

      + "
    Act="

      + Act

      + "
    RadioValue="

      + "
    PerValue="

      + PerValue

      + "
    ");

      if (Act.equals("B_InsertFront")) { //准备在前插入同级职位

      System.out.println("20010");

      returnStr = Jobtree.BeforeInsertJob(RadioValue, "front");

      } else if (Act.equals("D_InsertJob")) { //在前插入同级职位,并且已经有职位名称、说明等信息

      System.out.println("20011");

      returnStr = Jobtree.DoInsertJob(Jobitem, "", Personitem);

      } else if (Act.equals("B_AddAfter")) { //准备在后插入同级职位

      System.out.println("20012");

      returnStr = Jobtree.BeforeInsertJob(RadioValue, "after");

      } else if (Act.equals("B_InsertFull")) { //准备插入本部门的正职领导

      System.out.println("20014");

      returnStr = Jobtree.BeforeInsertFull(RadioValue);

      } else if (Act.equals("D_InsertFull")) { //插入本部门的正职领导,并且已经有职位名称、说明等信息

      System.out.println("20015");

      returnStr = Jobtree.DoInsertFull(Jobitem, "", Personitem);

      } else if (Act.equals("B_InsertAdjunct")) { //准备插入本部门的副职领导

      System.out.println("20016");

      returnStr = Jobtree.BeforeInsertAdjunct(RadioValue, 0);

      } else if (

      Act.equals("D_InsertAdjunct")) { //插入本部门的副职领导,并且已经有职位名称、说明等信息

      System.out.println("20017");

      returnStr = Jobtree.DoInsertAdjunct(Jobitem, "", Personitem);

      } else if (Act.equals("B_UnderJob")) { //准备在其下插入下级职位

      System.out.println("20018"+PerValue);

      returnStr = Jobtree.BeforeUnderJob(RadioValue,PerValue);

      } else if (Act.equals("D_UnderJob")) { //在其下插入下级职位,并且已经有职位名称、排名、说明等信息

      System.out.println("20019");

      returnStr = Jobtree.DoUnderJob(Jobitem, "", Personitem);

      } else if (Act.equals("B_UnderDept")) { //准备在其下插入下级部门

      System.out.println("20020");

      returnStr = Jobtree.BeforeUnderDept(RadioValue, 0);

      } else if (Act.equals("D_UnderDept")) { //在其下插入下级部门,并且已经有部门名称、说明等信息

      System.out.println("20021");

      returnStr = Jobtree.DoUnderDept(Deptitem, Jobitem, "", Personitem);

      } else if (Act.equals("B_Assistant")) { //准备在其下插入助手

      System.out.println("20022");

      returnStr = Jobtree.BeforeInsertAssistant(RadioValue, 0);

      } else if (Act.equals("D_Assistant")) { //在其下插入助手,并且已经有部门名称、说明等信息

      System.out.println("20023");

      returnStr = Jobtree.DoInsertAssistant(Jobitem, "", Personitem);

      } else if (Act.equals("up")) { //把某个职位上移,在兄弟间移动

      System.out.println("20024");

      returnStr = "msg,暂时未完成。,,,,,";

      } else if (Act.equals("down")) { //把某个职位下移,在兄弟间移动

      System.out.println("20025");

      returnStr = "msg,暂时未完成。,,,,,";

      } else if (Act.equals("bind")) { //把某个职位与某条人事记录绑定

      System.out.println("20026");

      returnStr = Jobtree.CreateLinkItem(RadioValue, PerValue);

      }

      return returnStr;

      }

      /**

      * Returns the act.

      * @return String

      */

      public String getAct() {

      return Act;

      }

      /**

      * Returns the perValue.

      * @return String

      */

      public String getPerValue() {

      return PerValue;

      }

      /**

      * Returns the radioValue.

      * @return String

      */

      public String getRadioValue() {

      return RadioValue;

      }

      /**

      * Sets the act.

      * @param act The act to set

      */

      public void setAct(String act) {

      Act = act;

      }

      /**

      * Sets the perValue.

      * @param perValue The perValue to set

      */

      public void setPerValue(String perValue) {

      PerValue = perValue;

      }

      /**

      * Sets the radioValue.

      * @param radioValue The radioValue to set

      */

      public void setRadioValue(String radioValue) {

      RadioValue = radioValue;

      }

      /**

      * Returns the curUnitSN.

      * @return String

      */

      public String getCurUnitSN() {

      return CurUnitSN;

      }

      /**

      * Sets the curUnitSN.

      * @param curUnitSN The curUnitSN to set

      */

      public void setCurUnitSN(String curUnitSN) {

      CurUnitSN = curUnitSN;

      }

      /**

      * Returns the jobitem.

      * @return JobItem

      */

      public JobItem getJobitem() {

      return Jobitem;

      }

      /**

      * Returns the personitem.

      * @return PersonItem

      */

      public PersonItem getPersonitem() {

      return Personitem;

      }

      /**

      * Sets the jobitem.

      * @param jobitem The jobitem to set

      */

      public void setJobitem(JobItem jobitem) {

      Jobitem = jobitem;

      }

      /**

      * Sets the personitem.

      * @param personitem The personitem to set

      */

      public void setPersonitem(PersonItem personitem) {

      Personitem = personitem;

      }

      /**

      * Returns the deptitem.

      * @return JobItem

      */

      public JobItem getDeptitem() {

      return Deptitem;

      }

      /**

      * Sets the deptitem.

      * @param deptitem The deptitem to set

      */

      public void setDeptitem(JobItem deptitem) {

      Deptitem = deptitem;

      }

      /**

      * 获得相同上级,同为助手或者同不为助手的兄弟

      * 第二个参数是单位SN

      * 第三个参数是父SN

      * 第四个参数是子类型

      * 第五个参数是当前排名

      */

      public String getSonSelect(

      java.sql.Connection Con,

      String UnitSN,

      String fatherSN,

      int type,

      int curSonNum) {

      System.out.println("21001");

      String backString = "";

      Connection con = Con;

      PreparedStatement pstmt = null;

      ResultSet rs = null;

      System.out.println("21002");

      try {

      System.out.println("21003");

      String strSql = "";

      if (type == 4) {

      strSql =

      "select * from OFFICE_JOB where OFJO_FATHER='"

      + fatherSN

      + "' and OFJO_TYPE=4";

      } else {

      strSql =

      "select * from OFFICE_JOB where OFJO_FATHER='"

      + fatherSN

      + "' and not OFJO_TYPE=4";

      }

      System.out.println("21004");

      pstmt = null;

      rs = null;

      pstmt = con.prepareStatement(strSql);

      rs = pstmt.executeQuery();

      String jobName = "";

      int jobSonNum = 0;

      String selected = "";

      System.out.println("21005");

      while (rs.next()) {

      System.out.println("21001");

      jobName = rs.getString("OFJO_JOBNAME");

      jobSonNum = rs.getInt("OFJO_SONNUM");

      if (jobSonNum == curSonNum) {

      selected = " selected ";

      }

      backString += "

  • 昵称:
  • 评分: 2分|鲜花一捧 1分|一朵小花 0分|交流灌水 0分|别字捉虫 -1分|一块小砖 -2分|砖头一堆
  • 内容:
  •             注:1.评论时输入br/即可换行分段。
  •                 2.发布负分评论消耗的月石并不会给作者。
  •             查看评论规则>>