/// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="loginName">用户名称</param>
        /// <param name="password">用户密码</param>
        /// <returns>用户信息实体</returns>
        public UserInfo Login(string loginName, string password)
        {
            LogHelper logHelper = LogHelper.GetInstance();

            try
            {
                IMessageDataHelper dataHelper = DataHelperFactory.GetMessageDataHelper();
                return(dataHelper.GetLoginUserInfo(loginName, password));
            }
            catch (Exception ex)
            {
                logHelper.LogErrInfo(ex.Message, Context.LoginEventId, "Login", loginName);
                return(new UserInfo());
            }
        }
        /// <summary>
        /// 激活码激活
        /// </summary>
        /// <param name="loginName">登陆用户名</param>
        /// <param name="password">用户密码</param>
        /// <param name="keyValue">激活码</param>
        /// <param name="machineCode">机器代码</param>
        /// <returns>激活结果 0 不成功,1 成功</returns>
        public int ActiveKey(string loginName, string password, string keyValue, string machineCode)
        {
            LogHelper logHelper = LogHelper.GetInstance();

            try
            {
                IMessageDataHelper dataHelper = DataHelperFactory.GetMessageDataHelper();
                UserInfo           userInfo   = dataHelper.GetLoginUserInfo(loginName, password);
                if (string.IsNullOrEmpty(userInfo.Guid))
                {
                    return(0);
                }
                return(dataHelper.ActiveKey(userInfo.Guid, keyValue, machineCode));
            }
            catch (Exception ex)
            {
                logHelper.LogErrInfo(ex.Message, Context.ActiveKeyEventId, "ActiveKey", keyValue);
                return(0);
            }
        }