Пример #1
0
        public IHttpActionResult AddActivity([FromBody] RequestAddActivity request)
        {
            var tokenResult = IdentityValid.ValidateToken(request.Token);

            if (!tokenResult.IsSuccess)
            {
                return(Json(tokenResult));
            }

            var bll      = new ActivityBLL();
            var Activity = new Activity()
            {
                UserName = tokenResult.userName,
                Remark   = request.Remark,
                Subject  = request.Subject,
                Time     = request.Time
            };
            bool isSuccess = bll.Save(Activity);

            return(Json(new ResponseMsg()
            {
                IsSuccess = isSuccess
            }));
        }