public ActionResult FocusPic(int type) { try { var data = FocusPicLogic.GetAppList(type); if (data == null || data.Count() == 0) { data = new List <FocusPicModel>(); data.Add(new FocusPicModel() { PicUrl = WebConfig.articleDetailsDomain() + "/app/images/default.jpg", CreateTime = DateTime.Now, Description = "默认图", IsEnable = 1, Type = type, Sort = 1, Title = "默认图", LinkUrl = "" }); } return(Json(new ResultModel(ApiStatusCode.OK, data))); } catch (Exception ex) { LogHelper.Log(string.Format("FocusPic:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR); return(Json(new ResultModel(ApiStatusCode.SERVICEERROR))); } }
/// <summary> /// 设置轮播图启用或禁用 /// </summary> private void SetFocusEnable() { if (FocusPicLogic.SetEnable(GetFormValue("focusid", 0))) { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK)); } else { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.操作失败)); } }
/// <summary> /// 删除焦点广告图 /// </summary> private void DeleteFocusPic() { if (FocusPicLogic.DeleteFocusPic(GetFormValue("focusid", 0))) { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK)); } else { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.除失败)); } }
/// <summary> /// 获取焦点广告图 /// </summary> private void GetFocusPicList() { SearchModel model = new SearchModel() { PageIndex = Convert.ToInt32(GetFormValue("pageIndex", 1)), PageSize = Convert.ToInt32(GetFormValue("pageSize", 20)), startTime = GetFormValue("startTime", ""), endTime = GetFormValue("endTime", ""), key = GetFormValue("key", ""), type = GetFormValue("type", 0),//0 资讯轮播图 1首页轮播图 }; var data = FocusPicLogic.GetList(model); json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK, data)); }
/// <summary> /// 编辑焦点广告图 /// </summary> private void EditFocusPic() { FocusPicModel model = new FocusPicModel() { ID = GetFormValue("focusid", 0), Title = GetFormValue("focustitle", ""), LinkUrl = GetFormValue("focuslinkurl", ""), PicUrl = GetFormValue("focuspicurl", ""), Type = GetFormValue("type", 0), IsEnable = GetFormValue("focusenable", 0), Sort = GetFormValue("focussort", 0), Description = GetFormValue("focusdescription", "") }; if (FocusPicLogic.EditFocusPic(model)) { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.OK)); } else { json = JsonHelper.JsonSerializer(new ResultModel(ApiStatusCode.操作失败)); } }
public ActionResult FocusPic(int type) { var data = FocusPicLogic.GetAppList(type); return(Json(new ResultModel(ApiStatusCode.OK, data))); }