@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getActionCommand().equals("保存")) {
			String ids = id.getText();
			String syear = sYear.getSelectedItem().toString();
			String smonth = sMonth.getSelectedItem().toString();
			String sday = sDay.getSelectedItem().toString();
			String eyear = eYear.getSelectedItem().toString();
			String emonth = eMonth.getSelectedItem().toString();
			String eday = eDay.getSelectedItem().toString();
			String smoney = sMoney.getText();
			
			//**********校验
			if(!Check.checkNull(new String[]{"会员编号","开卡金额"}, new String[]{ids,smoney})){
				return ;
			}
			if(!Check.checkNum(new String[]{"开卡金额"}, new String[]{smoney})){
				return ;
			}
			
			
			
			CustomerService cs = new CustomerService();
			CardinfoService cis = new CardinfoService();
			Cardinfo card = cis.getCardinfoByCustomer(ids);
			if(card!=null){
				JOptionPane.showMessageDialog(null, "该会员已经存在账户，不能再次添加", "提示", JOptionPane.INFORMATION_MESSAGE);
				return ;
			}
			Customer c = cs.getCustomer(ids);
			Cardinfo ci = new Cardinfo();
			ci.setCustomer(c);
			ci.setStartDate(syear+"-"+smonth+"-"+sday);
			ci.setEndDate(eyear+"-"+emonth+"-"+eday);
			ci.setStartAmount(new BigDecimal(smoney));
			ci.setAmount(new BigDecimal(0));
			ci.setStartCount(0);
			ci.setCount(0);
			cis.save(ci);
			Recharge r = new Recharge();
			r.setCard(ci);
			r.setMoney(new BigDecimal(smoney));
			r.setTime(DateUtil.getSystemTime());
			RechargeService rs = new RechargeService();
			rs.save(r);
			JOptionPane.showMessageDialog(null, "保存成功", "提示", JOptionPane.INFORMATION_MESSAGE);
			select();
		} else if (e.getActionCommand().equals("清空")) {
			id.setText("");
			sMoney.setText("");
			eMoney.setText("");
			eCount.setText("");
			userName.setText("");
			sYear.setSelectedIndex(0);
			sMonth.setSelectedIndex(0);
			sDay.setSelectedIndex(0);
			eYear.setSelectedIndex(0);
			eMonth.setSelectedIndex(0);
			eDay.setSelectedIndex(0);
			button_1.setEnabled(true);
			button_4.setEnabled(false);
			Constants.id="";
		} else if (e.getActionCommand().equals("查询")) {
			select();
		} else if (e.getActionCommand().equals("充值")) {
//			Recharge_Add dialog = new Recharge_Add();
//			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
//			dialog.setVisible(true);
			String ids = id.getText();
			Recharge_Add frame = new Recharge_Add(Cardinfo_Add.this,ids);
			frame.setVisible(true);
		} else if (e.getActionCommand().equals("会员信息")) {
			main.change(new Customer_Add(this.main,id.getText()));
		} 
	}