Cgw.Service.CgwService.CheckSession C# (CSharp) Method

CheckSession() private method

检查Session
private CheckSession ( ) : SmcErr
return Cgw.SmcError.SmcErr
        private SmcErr CheckSession()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            SmcErr err = new CgwError();
            CgwSession CgwSession = null;
            if (OperationContext.Current != null)
            {
                string strSessionId = OperationContext.Current.SessionId;
                err = SessionManage.Instance().GetSessionsBySessionId(strSessionId, out CgwSession);

                if (err.IsSuccess() == false || CgwSession == null)
                {
                    err.SetErrorNo(CgwError.ERR_CGW_BUSINESS_SESSION_NULL);
                }
                else
                {
                    if (CgwSession != null)
                    {
                        //更新Session最后访问时间
                        CgwSession.LastVisitedTime = DateTime.Now;
                        //logEx.Trace("Current Id is:{0}, LastVisitedTime is :{1}", strSessionId, CgwSession.LastVisitedTime.ToLongTimeString());
                        logEx.Trace("Current LastVisitedTime is :{0}", CgwSession.LastVisitedTime.ToLongTimeString());
                        if (isLoadSuccess == false)
                        {
                            err.SetErrorNo(CgwError.ERR_CGW_IS_LOADING);
                        }
                    }
                }
            }
            else
            {
                err.SetErrorNo(CgwError.ERR_CGW_BUSINESS_CURRENTSESSION_NULL);
            }

            return err;
        }