예제 #1
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

            VideoInfo info = null;
            if (string.IsNullOrEmpty(fid))
            {
                info = new VideoInfo();
                info.v_coverImgSrc = string.Empty;
                info.v_playSrc = string.Empty;
            }
            else
            {
                info = VideoServiceClass.VideoInfo_SelectById(fid.ToInt32());
            }

            info.v_titile = c_title;
            info.v_c_id = c_id.ToInt32();
            info.v_c_name = string.Empty;
            info.v_intro = c_intro;
            info.v_timeLength = string.Empty;

            //TODO:新增时
            if (string.IsNullOrEmpty(fid))
            {
                int result = VideoServiceClass.VideoInfo_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 = VideoServiceClass.VideoInfo_UpdateById(info);
                if (result > 0)
                {
                    return Json(new { success = true, errors = new { text = "修改成功" } });
                }
                else
                {
                    return Json(new { success = false, errors = new { text = "修改失败" } });
                }
            }
        }