Example #1
0
        public JsonResult NoticeAddInfo(int type = 0, string title = "", string content = "")
        {
            int             newsID;//添加完毕后返回的ID
            ExpressNewsInfo expressNewsInfo = new ExpressNewsInfo();
            var             result          = new JsonResultObject();

            expressNewsInfo.Type  = type;
            expressNewsInfo.Title = title;
            if (expressNewsInfo.Type == 2)
            {
                expressNewsInfo.Link = content;
            }
            else
            {
                expressNewsInfo.Content = content;
            }
            expressNewsInfo.CreateTime = DateTime.Now;
            expressNewsInfo.UpdateTime = expressNewsInfo.CreateTime;
            newsID = ExpressNewsBLL.Instance.ExpressNews_Insert(expressNewsInfo);
            if (newsID > 0)
            {
                result.status = true;
                result.msg    = "已发布完成!";
            }
            else
            {
                result.status = false;
                result.msg    = "发布失败,未能连接至网络!";
            }
            return(Json(result));
        }
Example #2
0
        public ActionResult NoticeEidt(int newsID)
        {
            ExpressNewsInfo expressNewsInfo = ExpressNewsBLL.Instance.ExpressNews_Get(newsID);

            ViewBag.ExpressNewsInfo = expressNewsInfo;
            return(View());
        }
Example #3
0
        public JsonResult UpdateStick(int newsID, short stick = 0)
        {
            var             result          = new JsonResultObject();
            ExpressNewsInfo expressNewsInfo = ExpressNewsBLL.Instance.ExpressNews_Get(newsID);

            expressNewsInfo.IsStick = stick;
            result.status           = ExpressNewsBLL.Instance.ExpressNews_Update(expressNewsInfo);
            if (result.status == true && stick == 0)
            {
                result.msg = "取消置顶成功!";
            }
            else if (result.status == true && stick == 1)
            {
                result.msg = "设置置顶成功!";
            }
            else
            {
                result.msg = "设置失败,未能连接至网络!";
            }
            return(Json(result));
        }
Example #4
0
        public JsonResult UpdateRed(int newsID, short red = 0)
        {
            var             result          = new JsonResultObject();
            ExpressNewsInfo expressNewsInfo = ExpressNewsBLL.Instance.ExpressNews_Get(newsID);

            expressNewsInfo.IsRed = red;
            result.status         = ExpressNewsBLL.Instance.ExpressNews_Update(expressNewsInfo);
            if (result.status == true && red == 0)
            {
                result.msg = "取消套红成功!";
            }
            else if (result.status == true && red == 1)
            {
                result.msg = "设置套红成功!";
            }
            else
            {
                result.msg = "设置失败,未能连接至网络!";
            }
            return(Json(result));
        }
Example #5
0
        public JsonResult ModifyNotice
            (int newsID, int type = 0, string title = "", string content = "")
        {
            var             result          = new JsonResultObject();
            ExpressNewsInfo expressNewsInfo = ExpressNewsBLL.Instance.ExpressNews_Get(newsID);

            if (newsID == 0)
            {
                result.msg    = "此公告ID异常!";
                result.status = false;
                return(Json(result));
            }
            if (title != "")
            {
                expressNewsInfo.Title = title;
            }
            if (content != "" && type == 2)
            {
                expressNewsInfo.Link    = content;
                expressNewsInfo.Content = null;
            }
            else
            {
                expressNewsInfo.Link    = null;
                expressNewsInfo.Content = content;
            }
            expressNewsInfo.Type = type;
            result.status        = ExpressNewsBLL.Instance.ExpressNews_Update(expressNewsInfo);
            if (result.status == true)
            {
                result.msg = "已编辑完成!";
            }
            else
            {
                result.msg = "编辑失败,未能连接至网络!";
            }
            return(Json(result));
        }