public override ModulesListViewModel GetModulesListViewModel()
        {
            var isAdmin = IsAdmin(Utility.ParaCondition.SignInFunction.Admin);
            var param   = new SignInEventParam()
            {
                MemberId = _parameters.MemberId, CircleKey = _parameters.CircleKey, NotDeleted = true, Pages = _parameters.Pages, Rows = _parameters.Rows
            };

            _list.SignInList = signInService.GetMutipEventData(param, isAdmin);
            // _list.SignInList= _service.GetList(param);
            _list.IsAdminRole = isAdmin;
            _list.ModuleKey   = _parameters.ModuleKey;
            _list.LearningId  = _circle.Id;
            _list.CircleKey   = _parameters.CircleKey;
            _list.CircleName  = _circle.Name;

            return(_list);
        }
Beispiel #2
0
        /// <summary>
        /// 載入點名活動
        /// </summary>
        /// <param name="token"></param>
        /// <param name="outerKey"></param>
        public void SignIn_LoadMultipleDetails(Guid token, string outerKey)
        {
            var tokenInfo = CheckToken(token.ToString());

            if (tokenInfo == null)
            {
                return;
            }
            try
            {
                // 是否為合法使用者
                var auth  = new ServerCheckItem();
                var check = AuthCheck(token, ref auth);
                if (check)
                {
                    var authService = new AuthService();
                    // 將outerKey轉回event guid
                    var tokenArray = new List <Guid>();
                    outerKey.Split(',').ToList().ForEach(item => tokenArray.Add(Service.Utility.OuterKeyHelper.PageTokenToGuid(item)));
                    var activityInfo     = signInService.GetSignInInfomation(tokenArray.FirstOrDefault());
                    var checkisAdminRole = authService.CheckFunctionAuth(activityInfo.LearningId, SignInFunction.Admin, tokenInfo.MemberId);
                    // 取出點名活動、簽到記錄
                    var param = new SignInEventParam()
                    {
                        EventIds = tokenArray, MemberId = auth.MemberId
                    };
                    var obj = signInService.GetMutipEventData(param, checkisAdminRole);

                    Clients.Caller.renderMultipleDetails(obj);
                }
                else
                {
                    Clients.Caller.onError("SignIn_LoadMultipleDetails", "身分驗證失敗,請重新登入!token:[" + token + "]");
                }
            }
            catch (Exception ex)
            {
                var msg = string.Format("{0}\n\n{1}", ex.Message, ex.StackTrace);

                Clients.Caller.onError("SignIn_LoadMultipleDetails", "載入點名細節發生意外: " + msg);
            }
        }