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

📄 business_office.java

📁 电信的网厅的整站代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
			aParam[8] = this.getBusinessInfoId();
			String sql_str= sql.toString();
			valiInfo = cd.commitUpdateDate(sql_str,aParam);*/
			
			Td_businessinfo td_businessinfo = new Td_businessinfo(new DacClient(),Long.parseLong(this.getBusinessInfoId()));
			td_businessinfo.setAreacode(this.getAreaCode());
			td_businessinfo.setName(this.getname());
			td_businessinfo.setRelationtel(this.getRelationTel());
			td_businessinfo.setBusinesstime(this.getBusinessTime());
			td_businessinfo.setAddress(this.getAddress());
			td_businessinfo.setFax(this.getfax());
			td_businessinfo.setPublicbus(this.getpublicbus());
			td_businessinfo.setBusiness(this.getbusiness());
			td_businessinfo.save();
			valiInfo = "1";
		}
		catch (Exception ex) {
			valiInfo = "-1";
			FileLogger.getLogger().warn("营业厅管理修改失败:"+ex);
			ex.printStackTrace();
			throw new RuntimeException(ex);
		}
		return valiInfo;
	}

	/**增加营业厅
	 * auther=张怡
	 * @return
	 */
	public String addBusiness() {
		String valiInfo = "0";
		try {
			/*StringBuffer sql = new StringBuffer();
			sql.append("insert ");
			sql.append("into ");
			//sql.append("td_businessinfo(BUSINESSINFOID,AREACODE,NAME," +
			//		   "RELATIONTEL,BUSINESSTIME,ADDRESS,TRANSACT,SALE,COMMISSION,MAINTAIN,OTHERBUSINESS) ");
			sql.append("td_businessinfo(BUSINESSINFOID,AREACODE,NAME," +
			   "RELATIONTEL,BUSINESSTIME,ADDRESS,TRANSACT,SALE,COMMISSION,MAINTAIN,OTHERBUSINESS,FAX ,PUBLICBUS,BUSINESS) ");
			sql.append("values(Seq_BUSINESSINFOID.NEXTVAL,?,?,?,?,?,?,?,?,?,?,?,?,?)");
			Object[] aParam = new Object[13];
			aParam[0] = this.getAreaCode();
			aParam[1] = this.getname();
			aParam[2] = this.getRelationTel();
			aParam[3] = this.getBusinessTime();
			aParam[4] = this.getAddress();
			aParam[5] = this.getTransact();
			aParam[6] = this.getSale();
			aParam[7] = this.getCommission();
			aParam[8] = this.getMainTain();
			aParam[9] = this.getOtherBusiness();
			aParam[10] = this.getfax();
			aParam[11] = this.getpublicbus();
			aParam[12] = this.getbusiness();
			cd.commitUpdateDate(sql.toString(),aParam);*/
			
			Td_businessinfo td_businessinfo = new Td_businessinfo(new DacClient());
			td_businessinfo.setAreacode(this.getAreaCode());
			td_businessinfo.setName(this.getname());
			td_businessinfo.setRelationtel(this.getRelationTel());
			td_businessinfo.setBusinesstime(this.getBusinessTime());
			td_businessinfo.setTransact(this.getTransact());
			td_businessinfo.setSale(this.getSale());
			td_businessinfo.setCommission(this.getCommission());
			td_businessinfo.setmMaintain(this.getMainTain());
			td_businessinfo.setOtherbusiness(this.getOtherBusiness());
			td_businessinfo.setAddress(this.getAddress());
			td_businessinfo.setFax(this.getfax());
			td_businessinfo.setPublicbus(this.getpublicbus());
			td_businessinfo.setBusiness(this.getbusiness());
			td_businessinfo.save();
		}
		catch (Exception ex) {
			valiInfo = "1";
			FileLogger.getLogger().warn("营业厅管理修改失败:"+ex);
			ex.printStackTrace();
			throw new RuntimeException(ex);
		}

		return valiInfo;
	}

	public DataRow getnewRow()//获得用于增加营业厅的DataRow
	{
		DataRow dr=null;
		DataTable dt=null;
		String sql="select * from td_businessinfo where 1=2";
		try {
			_dac.beginTransaction(10000);
			dt = _dac.executeQuery(sql);
			_dac.endTransaction(true);
			dr = dt.newRow();
		}
		catch (Exception ex) {
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {}
		}
		return dr;
	}
	public DataRow getupdataRow(String id)//获得用于修改营业厅的 Datarow
	{
		DataRow dr = null;
		DataTable dt = null;
		String sql="select * from td_businessinfo where BUSINESSINFOID=?";
		Object[] _object=new Object[1];
		_object[0]=id;
	    //System.out.println("id="+id);
		//System.out.println("sql="+sql);
		try {
			_dac.beginTransaction(10000);
			dt = _dac.executeQuery(sql,_object);
			_dac.endTransaction(true);
			dr = dt.getRow(0);
		}catch (Exception ex) {
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {}
		}
		return dr;
	}
	public void deleteInfo(String id)//删除营业厅
	{
		String sql="delete from td_businessinfo where businessinfoid=? ";
		Object[] _object=new Object[1];
		_object[0]=id;
		try {
			_dac.beginTransaction(10000);
			_dac.executeUpdate(sql,1000,_object);
			_dac.endTransaction(true);
		}catch (Exception ex) {
			FileLogger.getLogger().debug("id=="+_object[0]);
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {}
		}

	}
	public String getArea(String key)
	{
		String str="";
		String sql="select AREACODE,AREANAME from td_area where state='E'";
		DataTable dt=null;
		try {
			_dac.beginTransaction(10000);
			dt=_dac.executeQuery(sql);
			_dac.endTransaction(true);
		}
		catch (Exception ex)
		{
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {
			}
		}
		for(int i=0;i<dt.getRows().getCount();i++)
		{
			DataRow dr=dt.getRow(i);
			if(dr.getString(1).equals(key))
			{
				str = str + "<option value='" + dr.getString(0) + "' selected>" + dr.getString(1) +
				"</option>";
			}else
			{
				str = str + "<option value='" + dr.getString(0) + "'>" + dr.getString(1) +
				"</option>";
			}
		}
		return str;
	}
	public String getArea(String key,String sCityCode)
	{

		String str="";
		String sql="";
		if(sCityCode != null){
			if(sCityCode.equals("0590"))
				sql="select AREACODE,AREANAME from td_area where state='E'";
			else
				sql="select AREACODE,AREANAME from td_area where state='E' and cityCode='"+sCityCode+"'";
		}
		else
			sql="select AREACODE,AREANAME from td_area where state='E'";
		DataTable dt=null;
		try {
			_dac.beginTransaction(10000);
			dt=_dac.executeQuery(sql);
			_dac.endTransaction(true);
		}
		catch (Exception ex)
		{
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {
			}
		}
		for(int i=0;i<dt.getRows().getCount();i++)
		{
			DataRow dr=dt.getRow(i);
			if(dr.getString(0).equals(key))
			{
				str = str + "<option value='" + dr.getString(0) + "' selected>" + dr.getString(1) +
				"</option>";
			}else
			{
				str = str + "<option value='" + dr.getString(0) + "'>" + dr.getString(1) +
				"</option>";
			}
		}
		return str;
	}
	
	public String getAreaByIf_busi(String key,String sCityCode)
	{

		String str="";
		String sql="";
		if(sCityCode != null){
			if(sCityCode.equals("0590"))
				sql="select AREACODE,AREANAME from td_area where IF_BUSI='Y' order by areacode";
			else
				sql="select AREACODE,AREANAME from td_area where IF_BUSI='Y' and cityCode='"+sCityCode+"'"+" order by areacode";
		}
		else
			sql="select AREACODE,AREANAME from td_area where IF_BUSI='Y' order by areacode";
		DataTable dt=null;
		try {
			_dac.beginTransaction(10000);
			dt=_dac.executeQuery(sql);
			_dac.endTransaction(true);
		}
		catch (Exception ex)
		{
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {
			}
		}
		for(int i=0;i<dt.getRows().getCount();i++)
		{
			DataRow dr=dt.getRow(i);
			if(dr.getString(0).equals(key))
			{
				str = str + "<option value='" + dr.getString(0) + "' selected>" + dr.getString(1) +
				"</option>";
			}else
			{
				str = str + "<option value='" + dr.getString(0) + "'>" + dr.getString(1) +
				"</option>";
			}
		}
		return str;
	}
	
	public String getCity(String key,String sCityCode)
	{

		String str="";
		String sql="";
		if(sCityCode != null){
			if(sCityCode.equals("0590"))
				sql="select CITYCODE,CITYNAME from td_CITY where state='E'";
			else
				sql="select CITYCODE,CITYNAME from td_CITY where state='E' and cityCode='"+sCityCode+"'";
		}
		else
			sql="select CITYCODE,CITYNAME from td_CITY where state='E'";
		DataTable dt=null;
		try {
			_dac.beginTransaction(10000);
			dt=_dac.executeQuery(sql);
			_dac.endTransaction(true);
		}
		catch (Exception ex)
		{
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {
			}
		}
		for(int i=0;i<dt.getRows().getCount();i++)
		{
			DataRow dr=dt.getRow(i);
			if(dr.getString(0).equals(key))
			{
				str = str + "<option value='" + dr.getString(0) + "' selected>" + dr.getString(1) +
				"</option>";
			}else
			{
				str = str + "<option value='" + dr.getString(0) + "'>" + dr.getString(1) +
				"</option>";
			}
		}
		return str;
	}	
	
	public String getcity()
	{
		String str="";
		String sql="select CITYCODE,CITYNAME from td_CITY ";
		DataTable dt=null;
		try {
			_dac.beginTransaction(10000);
			dt=_dac.executeQuery(sql);
			_dac.endTransaction(true);
		}
		catch (Exception ex)
		{
			FileLogger.getLogger().debug(ex);
			try {
				_dac.endTransaction(false);
			}
			catch (Exception ex1) {
			}
		}
		for(int i=0;i<dt.getRows().getCount();i++)
		{
			DataRow dr=dt.getRow(i);
			str = str + "<option value='" + dr.getString(0) + "'>" + dr.getString(1) +
			"</option>";
		}
		return str;
	}
	
	
    //得到区域列表 
	 public DataTable getarea(String citycode)
	 { 
		 
		StringBuffer sql=new StringBuffer();
		sql.append("select t.AREACODE,t.AREANAME from td_area t ");
		sql.append(" where t.citycode='");
		sql.append(citycode);
		sql.append("'");
	  DataTable dt=null;
	  try {
	    dt=_dac.executeQuery(sql.toString());
	  }
	  catch (Exception ex) {
		  return null;
	  }
	   return dt;
	 }
	 
	 
		public String buildPageOptions(int pageCount, int pageNo) {
			String optionHTML = "0";
			for (int i = 1; i <= pageCount; i++) {
				if (pageNo == i || pageNo == 0)
					optionHTML += "<option value='" + i + "' selected/>" + i;
				else
					optionHTML += "<option value='" + i + "'/>" + i;
			}
			return optionHTML;
		}

}

⌨️ 快捷键说明

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