Esempio n. 1
0
        /// <summary>
        /// Post the specified request.
        /// </summary>
        /// <param name="request">Request.</param>
        public object Post(PostTermsConditionsForCurrentUserRequestTep request)
        {
            var context = TepWebContext.GetWebContext(PagePrivileges.UserView);

            try {
                context.Open();
                context.LogInfo(this, string.Format("/termsconditions/user/current POST"));

                TermsConditionsHelper.ApproveTermsConditionsForCurrentUser(context, request.identifier);

                context.Close();
            } catch (Exception e) {
                context.LogError(this, e.Message, e);
                context.Close();
                throw e;
            }
            return(new WebResponseBool(true));
        }
Esempio n. 2
0
        /// <summary>
        /// Get the specified request.
        /// </summary>
        /// <param name="request">Request.</param>
        public object Get(GetTermsConditionsForCurrentUserRequestTep request)
        {
            WebResponseBool response;

            var context = TepWebContext.GetWebContext(PagePrivileges.UserView);

            try {
                context.Open();
                context.LogInfo(this, string.Format("/termsconditions/user/current GET"));

                var check = TermsConditionsHelper.CheckTermsConditionsForCurrentUser(context, request.identifier);
                response = new WebResponseBool(check);

                context.Close();
            } catch (Exception e) {
                context.LogError(this, e.Message, e);
                context.Close();
                throw e;
            }
            return(response);
        }