Ejemplo n.º 1
0
    /// <summary>
    /// Initialize user agent mapping details
    /// </summary>
    /// <param name="userid">User id which should be associated with agent</param>
    /// <returns>Returns User Agent mapping details</returns>
	private UserAgentMappingDTO InitializeUserAgentDetails(int userid)
	{
		UserAgentMappingDTO userAgentMappingDetails = new UserAgentMappingDTO();
        userAgentMappingDetails.UAM_User_Id = userid;
        userAgentMappingDetails.UAM_Agent_Id = Convert.ToInt32(ddlDCAGroup.SelectedItem.Value);
        //userAgentMappingDetails.UAM_FirstName = txtFirstName.Text.Trim();
        //userAgentMappingDetails.UAM_LastName = txtLastName.Text.Trim();
        userAgentMappingDetails.UAM_CreatedDate = DateTime.Now;
        userAgentMappingDetails.UAM_CreatedBy = GetCurrentUserId();
        
        //return the value
        return userAgentMappingDetails;
	}
Ejemplo n.º 2
0
        /// <summary>
        /// Check If Agent Not Referenced by agentId
        /// </summary>
        /// <param name="agentId">Int32:agentId</param>
        /// <returns></returns>
        public bool CheckIfAgentNotReferenced(int agentId)
        {
            bool isAgentExist = false;
            UserAgentMappingDTO userAgentDetails = new UserAgentMappingDTO();

            AutoMapper.Mapper.Map(ESalesUnityContainer.Container.Resolve<IGenericRepository<useragentmapping>>()
                .GetSingle(item => item.UAM_Agent_Id == agentId && item.UAM_IsDeleted == false), userAgentDetails);

            if (userAgentDetails.UAM_Agent_Id  != 0)
            {
                isAgentExist = true;
            }

            //return agent details
            return isAgentExist;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get User Agent Mapping By MappingId
        /// </summary>
        /// <param name="userAgentMapId">Int32:userAgentMapId</param>
        /// <returns></returns>
        public UserAgentMappingDTO GetUserAgentMappingByMappingId(int userAgentMapId)
        {
            //To select agent by agent id
            UserAgentMappingDTO userAgentDetails = new UserAgentMappingDTO();

            AutoMapper.Mapper.Map(ESalesUnityContainer.Container.Resolve<IGenericRepository<useragentmapping>>()
                .GetSingle(item => item.UAM_Id == userAgentMapId && item.UAM_IsDeleted == false), userAgentDetails);

            //return agent details
            return userAgentDetails;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Save User Agent Mapping
 /// </summary>
 /// <param name="userAgentMapDetails"></param>
 public void SaveUserAgentMapping(UserAgentMappingDTO userAgentMapDetails)
 {
     useragentmapping userAgentMappingEntity = new useragentmapping();
     AutoMapper.Mapper.Map(userAgentMapDetails, userAgentMappingEntity);
     ESalesUnityContainer.Container.Resolve<IGenericRepository<useragentmapping>>().Save(userAgentMappingEntity);
 }
Ejemplo n.º 5
0
 public static UserAgentMappingDTO GetAgentByUserId(int userId)
 {
     UserAgentMappingDTO agentMapDetails = new UserAgentMappingDTO();
     agentMapDetails = ESalesUnityContainer.Container.Resolve<IUserAgentService>().GetAgentByUserId(userId);
     return agentMapDetails;
 }