www.pudn.com > restrant.zip > UserService.java, change:2014-03-10,size:880b


package com.alex.restrantol.service; 
 
import java.util.Date; 
import java.util.Map; 
 
import com.alex.restrantol.dao.UserDao; 
import com.alex.restrantol.entity.UserEntity; 
 
public class UserService { 
	public void addUser(Map<String, String[]> map) { 
		UserEntity user = null; 
		UserDao userDao = null; 
		String[] loginname = map.get("loginname"); 
		String[] loginpwd = map.get("loginpwd"); 
		String[] truename = map.get("truename"); 
		String[] tel = map.get("telephone"); 
		String[] email = map.get("email"); 
		String[] address = map.get("defaultaddress"); 
		user = new UserEntity(); 
		user.setName(loginname[0]); 
//		user.setTruename(truename[0]); 
		user.setPsw(loginpwd[0]); 
//		user.setTel(tel[0]); 
//		user.setEmail(email[0]); 
//		user.setAddress(address[0]); 
		user.setRegTime(new Date()); 
		userDao = new UserDao(); 
		userDao.addUser(user); 
	} 
}