Ejemplo n.º 1
0
        /// <summary>
        /// 验证用户登录信息
        /// </summary>
        public void validateUser(FunctionParameter fp)
        {
            ISMPUser user = new ISMPUser();

            user.AccountId         = fp.AccountId;
            user.LoginName         = fp.LoginName;
            user.Name              = fp.Name;
            user.OperatorAccountId = fp.OperatorAccountId;
            user.OperatorLoginName = fp.OperatorLoginName;
            user.OperatorName      = fp.OperatorName;
            user.UserType          = fp.UserType;

            if (user.UserType == UserType.Enterprise)
            {
                var r = Util.SMSProxy.GetEnterprise(fp.LoginName);

                user.SMSPassword = r.Value.Password;
            }

            Session["CurrentUser"] = user;
            Session["Param"]       = fp;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 向ISMP发送日志
        /// </summary>
        /// <param name="module"></param>
        /// <param name="logMessage"></param>
        /// <param name="logDetail"></param>
        /// <param name="operationType"></param>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        public static bool SendSystemLogToISMP(string module, string logMessage, string logDetail, string operationType, ISMPUser currentUser)
        {
            try
            {
                Sys_Log log = new Sys_Log
                {
                    AccountId     = currentUser.OperatorAccountId,
                    LoginName     = currentUser.OperatorLoginName,
                    Platform      = Util.SMSProductId,
                    Module        = module,
                    LogMessage    = logMessage,
                    LogType       = LogType.Operation,
                    LogTime       = DateTime.Now,
                    Log           = logDetail,
                    OperationType = operationType,
                    IPAddress     = currentUser.IPAddress
                };
                string Param = JsonSerialize.Instance.Serialize <Sys_Log>(log);

                string url = Util.ISMPHost + "/CallBack/LogOperation?";
                url += "Param=" + System.Web.HttpUtility.UrlEncode(Param);

                string resultISMP = BXM.Utils.HTTPRequest.PostWebRequest(url, "", System.Text.Encoding.UTF8);
                var    o          = JsonConvert.DeserializeAnonymousType(resultISMP, new { success = true, message = string.Empty });
                return(o.success);
            }
            catch (Exception ex)
            {
                Log4Logger.Error(ex);
                return(false);
            }
        }