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; VideoInfo info = null; string[] c_idArr = c_id.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < c_idArr.Length; i++) { info = VideoServiceClass.VideoInfo_SelectById(c_idArr[i].ToInt32()); info.v_status = status; result = VideoServiceClass.VideoInfo_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) } }); } }
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 = "修改失败" } }); } } }