Exemplo n.º 1
0
        /// <summary>
        /// 保存工作汇报
        /// </summary>
        private void saveReport()
        {
            string jsonbody    = GetFormValue("jsonbody", "");
            string reportTitle = GetFormValue("title", "");
            string auth        = GetFormValue("auth", "");
            string addr        = HttpUtility.UrlDecode(GetFormValue("addr", "杭州"));

            if (!string.IsNullOrEmpty(auth))
            {
                int userId = UserLogic.GetUserIdByAuthToken(auth);
                if (userId == 0)
                {
                    json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.令牌失效));
                    return;
                }
                var user = UserLogic.GetModel(userId);
                UserLogic.AddAppUserReport(new UserReportModel()
                {
                    UserId      = userId,
                    ShopId      = user.ShopId,
                    Addr        = addr,
                    ReportTitle = reportTitle,
                    JsonContent = jsonbody
                });
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK));
            }
            else
            {
                json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.令牌失效));
            }
        }