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

📄 syain_kanri.java

📁 jsp考勤
💻 JAVA
字号:
/*
 *	Copyright (C) 2000, TOA-System Co.  All rights reserved.
 */
package test;

import java.sql.*;
import java.text.*;
import exce.*;
import def.*;
import util.*;
import entity.*;
import dbcommon.*;

/**
 *	偙偺僋儔僗偼丄儘僌僀儞娭楢偺僋儔僗偱偡丅<br>
 *	@version	2.00
 *	@author		TOA
 *
 *	峏怴棜楌
 *	<ul>
 *		<li>僐儊儞僩傪捛壛
 *	</ul>
 */
public class Syain_Kanri {
	public Syain_Kanri() {}
	CommonUtil cu = new CommonUtil();
	ChangeField cf = new ChangeField();
	Status st = new Status();
	SimpleDateFormat sdf = new SimpleDateFormat(SISnet.DATE_FMT);

	/**
	 *	幮堳忣曬偺庢摼傪峴偆
	 *	@param	conn		DB僪儔僀僶偺URL側偳
	 *			loginID		儘僌僀儞俬俢
	 *			password	僷僗儚乕僪
	 *	@return	status		Status僆僽僕僃僋僩
	 */
	public User_Jouhou_002Entity[] search(Connection conn,String bumenNo,String useidfrom,String useidto) {							    
		String		where	= "";
		String		and	= "0";
		
		try {
			// User_Jouhou_002DataAccess僆僽僕僃僋僩偺findUser_Jouhou_002()儊僜僢僪傪幚峴偟傑偡丅
			User_Jouhou_002DataAccess ujda = new User_Jouhou_002DataAccess();

			if(bumenNo.equals("")&&useidfrom.equals("")&&useidto.equals("")){
			        where = "";
			}
			else{
					where+=" WHERE ";
					if(!bumenNo.equals("")){
						where+="BUMON_CD = '"+ bumenNo + "'";
						and	= "1";
					}
					if(!useidfrom.equals("")){
						if(and.equals("1")){
							where+=" AND ";
						}
						where+="USER_CD >= '"+ useidfrom + "'";
						and	= "1";
					}
					if(!useidto.equals("")){
						if(and.equals("1")){
							where+=" AND ";
						}
						where+="USER_CD <= '"+ useidto + "'";
					}
			}


			User_Jouhou_002Entity[] ujte = ujda.findUser_Jouhou_002(conn, where);


		       return ujte;
			

		} catch (ApplicationException ae) {
			st = ae.getStatus();
			ae.printStackTrace();
			throw new ApplicationException(st.usermsg, st.errno);
		} catch (OracleException orae) {
			st = orae.getStatus();
			orae.printStackTrace();
			throw new OracleException(st);
		} catch (Exception e) {
			e.printStackTrace();
			throw new OriginalException(e);
		}
	}


	/**
	 *	幮堳忣曬偺捛壛傪峴偆
	 *	@param	conn		DB僪儔僀僶偺URL側偳
	 *			
	 *			
	 */
	public void insert(Connection conn,String[] syain_jouhou) {							    
		
		try {
			// User_Jouhou_002DataAccess僆僽僕僃僋僩偺createUser_Jouhou_002()儊僜僢僪傪幚峴偟傑偡丅
			User_Jouhou_002DataAccess ujda = new User_Jouhou_002DataAccess();
			User_Jouhou_002Entity ujee 	= new User_Jouhou_002Entity();

			ujee._user_cd  = syain_jouhou[0];
			ujee._user_nm  = syain_jouhou[1];
			ujee._bumon_cd  =syain_jouhou[2];
			ujee._bumon_nm  =syain_jouhou[3];
			ujee._kengen_kubun =syain_jouhou[4];
			ujee._sex =syain_jouhou[5];           
			ujee._nenrei =cf.strToInt(syain_jouhou[6]);
			ujee._password =syain_jouhou[0];
			ujee._update_user=syain_jouhou[7];
			ujee._olupdate_user=syain_jouhou[7];


	        ujda.createUser_Jouhou_002(conn, ujee);

		} catch (ApplicationException ae) {
			st = ae.getStatus();
			ae.printStackTrace();
			throw new ApplicationException(st.usermsg, st.errno);
		} catch (OracleException orae) {
			st = orae.getStatus();
			orae.printStackTrace();
			throw new OracleException(st);
		} catch (Exception e) {
			e.printStackTrace();
			throw new OriginalException(e);
		}
	}

	/**幮堳忣曬偺曄峏
	 *	
	 *	@param	conn		DB僪儔僀僶偺URL側偳
	 *			pr		
	 */
	public void updata(Connection conn,String[] syain_jouhou) {							
		
		try {

			// User_Jouhou_002DataAccess僆僽僕僃僋僩偺updateUser_Jouhou_002()儊僜僢僪傪幚峴偟傑偡丅
			User_Jouhou_002DataAccess ujda = new User_Jouhou_002DataAccess();
			User_Jouhou_002Entity ujee 	= new User_Jouhou_002Entity();

			ujee._user_cd  = syain_jouhou[0];
			ujee._user_nm  = syain_jouhou[1];
			ujee._bumon_cd  = syain_jouhou[2];
			ujee._bumon_nm  = syain_jouhou[3];

			if(syain_jouhou[4].equals("9")){
			      ujee._kengen_kubun  = "1";
			}
			else{
			      ujee._kengen_kubun  = "9";
			}

			ujee._sex  =syain_jouhou[6];
			ujee._nenrei  =cf.strToInt(syain_jouhou[7]);
			ujee._password  =syain_jouhou[8];
			
			ujee._update_user= syain_jouhou[0];
			ujee._olupdate_user= syain_jouhou[0];


	        ujda.updateUser_Jouhou_002(conn, ujee);


		} catch (ApplicationException ae) {
			st = ae.getStatus();
			ae.printStackTrace();
			throw new ApplicationException(st.usermsg, st.errno);
		} catch (OracleException orae) {
			st = orae.getStatus();
			orae.printStackTrace();
			throw new OracleException(st);
		} catch (Exception e) {
			e.printStackTrace();
			throw new OriginalException(e);
		}
	}


	/**
	 *	幮堳忣曬偺嶍彍傪峴偆
	 *	@param	conn		DB僪儔僀僶偺URL側偳
	 *			
	 *			
	 */
	public void delet(Connection conn,String userid,String bumon_cd) {	
		String		where	= "";
		
		try {
			// User_Jouhou_002DataAccess僆僽僕僃僋僩偺createUser_Jouhou_002()儊僜僢僪傪幚峴偟傑偡丅
			User_Jouhou_002DataAccess ujda = new User_Jouhou_002DataAccess();
			where	= "WHERE USER_CD = '" + userid + "' AND BUMON_CD = '" + bumon_cd + "'";
			
	        ujda.deleteUser_Jouhou_002(conn, where);

		} catch (ApplicationException ae) {
			st = ae.getStatus();
			ae.printStackTrace();
			throw new ApplicationException(st.usermsg, st.errno);
		} catch (OracleException orae) {
			st = orae.getStatus();
			orae.printStackTrace();
			throw new OracleException(st);
		} catch (Exception e) {
			e.printStackTrace();
			throw new OriginalException(e);
		}
	}


}

⌨️ 快捷键说明

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