Subversion Repositories SmartDukaan

Rev

Rev 7162 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7162 Rev 16244
Line 24... Line 24...
24
	private String password;
24
	private String password;
25
	private List<String> role;
25
	private List<String> role;
26
	private String managerEmailId;
26
	private String managerEmailId;
27
	private String newPassword;
27
	private String newPassword;
28
	private int managerId;
28
	private int managerId;
-
 
29
	private String pmCrmUser;
29
 
30
 
30
	private static final long serialVersionUID = 7884813082235471597L;
31
	private static final long serialVersionUID = 7884813082235471597L;
31
 
32
 
32
	public AgentController()	{
33
	public AgentController()	{
33
		super();
34
		super();
Line 50... Line 51...
50
			agent.setName(name);
51
			agent.setName(name);
51
			agent.setEmailId(emailId);
52
			agent.setEmailId(emailId);
52
			agent.setManagerId(managerId);  
53
			agent.setManagerId(managerId);  
53
			agent.setPassword(new Sha256Hash(password).toHex());
54
			agent.setPassword(new Sha256Hash(password).toHex());
54
			agent.setIs_active(true);
55
			agent.setIs_active(true);
-
 
56
			if((pmCrmUser!=null && "on".equalsIgnoreCase(pmCrmUser)) || role.contains("PMAgent")){
-
 
57
				agent.setIs_pmCrmUser(true);
-
 
58
			}else{
-
 
59
				agent.setIs_pmCrmUser(false);
-
 
60
			}
-
 
61
			if(role.contains("Outbound")||role.contains("TeamLead")){
-
 
62
				agent.setIs_allAssignable(true);
-
 
63
			}else{
-
 
64
				agent.setIs_allAssignable(false);
-
 
65
			}
55
			crmServiceClient = new CRMClient().getClient();
66
			crmServiceClient = new CRMClient().getClient();
56
			crmServiceClient.insertAgent(agent,role);
67
			crmServiceClient.insertAgent(agent,role);
57
			SearchFilter searchfilter = new SearchFilter();
68
			SearchFilter searchfilter = new SearchFilter();
58
			searchfilter.setAgentEmailId(emailId);
69
			searchfilter.setAgentEmailId(emailId);
59
			List<Agent> createdAgent = crmServiceClient.getAgents(searchfilter);
70
			List<Agent> createdAgent = crmServiceClient.getAgents(searchfilter);
Line 238... Line 249...
238
		searchFilter.setAgentId(10);
249
		searchFilter.setAgentId(10);
239
		in.shop2020.crm.CRMService.Client crmServiceClient = new CRMClient().getClient();
250
		in.shop2020.crm.CRMService.Client crmServiceClient = new CRMClient().getClient();
240
    	List<Agent> agents = crmServiceClient.getAgents(searchFilter);
251
    	List<Agent> agents = crmServiceClient.getAgents(searchFilter);
241
    	System.out.println(agents);
252
    	System.out.println(agents);
242
	}
253
	}
-
 
254
 
-
 
255
	public String getPmCrmUser() {
-
 
256
		return pmCrmUser;
-
 
257
	}
-
 
258
 
-
 
259
	public void setPmCrmUser(String pmCrmUser) {
-
 
260
		this.pmCrmUser = pmCrmUser;
-
 
261
	}
-
 
262
	
243
}
263
}