Subversion Repositories SmartDukaan

Rev

Rev 26817 | Rev 26840 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26817 Rev 26834
Line 41... Line 41...
41
	@Override
41
	@Override
42
	public Customer addCustomer(Customer customer) {
42
	public Customer addCustomer(Customer customer) {
43
		try {
43
		try {
44
			customer = customerRepository.selectByMobileNumber(customer.getMobileNumber());
44
			customer = customerRepository.selectByMobileNumber(customer.getMobileNumber());
45
		} catch (ProfitMandiBusinessException pbse) {
45
		} catch (ProfitMandiBusinessException pbse) {
-
 
46
			if(customer.getPassword()!=null) {
-
 
47
				customer.setPassword(getHash256(customer.getPassword()));
-
 
48
			}
46
			customer.setPassword(getHash256(getRandomString()));
49
			customer.setPassword(getHash256(getRandomString()));
47
			try {
50
			try {
48
				customerRepository.persist(customer);
51
				customerRepository.persist(customer);
49
			} catch(Exception e) {
52
			} catch(Exception e) {
50
				e.printStackTrace();
53
				e.printStackTrace();