예제 #1
0
        public ActionResult SiteContentCheck()
        {
            string c_id   = Request["c_id"] ?? string.Empty;
            int    status = Request["status"].ToInt32(1);

            int     successCount = 0;
            int     failCount    = 0;
            int     result       = 0;
            Fiction info         = null;

            string[] c_idArr = c_id.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < c_idArr.Length; i++)
            {
                info = YuYangServiceClass.Fiction_SelectById(c_idArr[i].ToInt32());
                //info.c_status = status;
                result = YuYangServiceClass.Fiction_UpdateById(info);
                if (result > 0)
                {
                    successCount++;
                }
                else
                {
                    failCount++;
                }
            }
            if (c_idArr.Length == 1)
            {
                return(Json(new { success = true, errors = new { text = "审核成功" } }));
            }
            else
            {
                return(Json(new { success = true, errors = new { text = string.Format("审核成功{0}条,失败{1}条", successCount, failCount) } }));
            }
        }
예제 #2
0
        public ActionResult SiteContentEdit()
        {
            string c_title    = Request["c_title"] ?? string.Empty;
            string c_keywords = Request["c_keywords"] ?? string.Empty;
            string c_subTitle = Request["c_subTitle"] ?? string.Empty;
            string c_content  = Request["c_content"] ?? string.Empty;
            string c_intro    = Request["c_intro"] ?? string.Empty;
            string fid        = Request["fid"] ?? string.Empty;
            string c_id       = Request["c_id"] ?? string.Empty;//分类Id

            Fiction info = null;

            if (string.IsNullOrEmpty(fid))
            {
                info            = new Fiction();
                info.CoverImage = string.Empty;
            }
            else
            {
                info = YuYangServiceClass.Fiction_SelectById(fid.ToInt32());
            }

            //info.c_status = (int)SiteEnum.SiteItemStatus.待审核;
            info.LastUpdateTime    = DateTime.Now;
            info.Title             = c_title;
            info.C_C_ID            = c_id.ToInt32();
            info.Author            = c_subTitle;
            info.Intro             = c_intro;
            info.LastUpdateChapter = string.Empty;

            //TODO:新增时 小说封面设置



            if (string.IsNullOrEmpty(fid))
            {
                int result = YuYangServiceClass.Fiction_Insert(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "新增成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "新增失败" } }));
                }
            }
            else
            {
                int result = YuYangServiceClass.Fiction_UpdateById(info);
                if (result > 0)
                {
                    return(Json(new { success = true, errors = new { text = "修改成功" } }));
                }
                else
                {
                    return(Json(new { success = false, errors = new { text = "修改失败" } }));
                }
            }
        }