Exemplo n.º 1
0
        public JsonResult AddFileMessage(string title, string lvl, string publictime, string htmlContent, string textContent, string fileOriginName, string fileNewName, string filePath, string filetype)
        {
            title          = HttpUtility.UrlDecode(title);
            htmlContent    = HttpUtility.UrlDecode(htmlContent);
            textContent    = HttpUtility.UrlDecode(textContent);
            fileOriginName = HttpUtility.UrlDecode(fileOriginName);
            filePath       = HttpUtility.UrlDecode(filePath);
            long             userid      = LoginHelper.UserId;
            T_BG_PublishFile publishFile = new T_BG_PublishFile
            {
                Title          = title,
                EditorId       = userid,
                PublishTime    = publictime.ToDateTime(DateTime.MinValue),
                PublishState   = 1,
                Lvl            = lvl.ToLong(-1),
                TextContent    = textContent,
                HtmlContent    = htmlContent,
                IsDel          = 0,
                FileNewName    = fileNewName,
                FileOriginName = fileOriginName,
                FilePath       = filePath,
                FileType       = filetype
            };
            //没有审核的列表
            bool result = _bgPublishFileService.AddPublishFile(publishFile);

            JsonBaseEntity json = new JsonBaseEntity {
                ErrorCode = result ? "E0001" : "E0009"
            };

            json.ErrorMessage = ErrorInfoHelper.GetErrorValue(json.ErrorCode);
            return(Json(json));
        }
Exemplo n.º 2
0
        public JsonResult AddAddFile(long departId, int natureTyp, int typ, DateTime time, string fileOriginName, string fileNewName, string filePath, string filetype, string remark)
        {
            fileOriginName = HttpUtility.UrlDecode(fileOriginName);
            filePath       = HttpUtility.UrlDecode(filePath);
            remark         = HttpUtility.UrlDecode(remark);

            T_BG_ActiveFile actineFile = new T_BG_ActiveFile
            {
                Type           = typ,
                DeparementId   = departId,
                PublicTime     = time,
                NatureType     = natureTyp,
                FileNewName    = fileNewName,
                FileOriginName = fileOriginName,
                FilePath       = filePath,
                FileType       = filetype,
                IsDel          = 0,
                Remark         = remark,
                AddTime        = DateTime.Now
            };
            long result = _bgActiveFileService.AddActiveFile(actineFile);

            JsonBaseEntity json = new JsonBaseEntity {
                ErrorCode = result > 0 ? "E0001" : "E0009"
            };

            json.ErrorMessage = ErrorInfoHelper.GetErrorValue(json.ErrorCode);
            return(Json(json));
        }
Exemplo n.º 3
0
        public JsonResult DelSingle()
        {
            long           id     = CommonHelper.GetPostValue("id").ToLong(-1);
            JsonBaseEntity result = new JsonBaseEntity();

            if (id <= 0)
            {
                result.ErrorCode    = "E0001";
                result.ErrorMessage = "未发现删除数据!";
                return(Json(result));
            }
            T_BG_PublishFile publishFile = new T_BG_PublishFile {
                Id = id, IsDel = 1
            };
            bool reslt = _bgPublishFileService.DelDateById(publishFile);

            if (reslt)
            {
                result.ErrorCode    = "E0000";
                result.ErrorMessage = "删除数据成功!";
            }
            else
            {
                result.ErrorCode    = "E0001";
                result.ErrorMessage = "删除数据失败!";
            }
            return(Json(result));
        }
Exemplo n.º 4
0
        public JsonResult DelAddFileList(List <T_BG_ActiveFile> activeFileList)
        {
            JsonBaseEntity result = new JsonBaseEntity();

            if (activeFileList == null || activeFileList.Count <= 0)
            {
                result.ErrorCode    = "E0001";
                result.ErrorMessage = "未发现删除数据!";
                return(Json(result));
            }
            bool reslt = _bgActiveFileService.UpdatBath(activeFileList);

            if (reslt)
            {
                result.ErrorCode    = "E0000";
                result.ErrorMessage = "删除数据成功!";
            }
            else
            {
                result.ErrorCode    = "E0001";
                result.ErrorMessage = "删除数据失败!";
            }
            return(Json(result));
        }