コード例 #1
0
        public ActionResult Edit(VideoAddDto dto)
        {
            if (dto.Id <= 0)
            {
                dto.AdminUserId = long.Parse(Session[Keys.AdminId].ToString());
                VideoService.AddNew(dto);

                AdminLogService.AddNew($"添加视频信息:{dto.Title}");
                return(Json(new AjaxResult {
                    Result = true, Msg = "视频添加成功"
                }));
            }
            VideoService.Update(dto);

            AdminLogService.AddNew($"修改视频信息:{dto.Title}");
            return(Json(new AjaxResult {
                Result = true, Msg = "视频修改成功"
            }));
        }