public JsonResult HomePictureUpdateAjax(string url, string orderBy, string createTime, string updateTime, string creatorId, string remark, string linkUrl, string homePictureId) { if (string.IsNullOrEmpty(url)) { return(Json(new ResultModel <bool>(1, "请选择图片文件", false), JsonRequestBehavior.AllowGet)); } if (string.IsNullOrEmpty(orderBy)) { return(Json(new ResultModel <bool>(2, "请输入首页轮播图排序", false), JsonRequestBehavior.AllowGet)); } pbs_basic_HomePictureService pbsHomePictureService = new pbs_basic_HomePictureService(); if (!string.IsNullOrEmpty(homePictureId)) { int hid = Utility.Util.ParseHelper.ToInt(homePictureId); ResultInfo <bool> resultEditHomePicture = pbsHomePictureService.UpdateHomePicture(url, Utility.Util.ParseHelper.ToInt(orderBy), Utility.Util.ParseHelper.ToDatetime(createTime), Utility.Util.ParseHelper.ToDatetime(updateTime), Utility.Util.ParseHelper.ToInt(creatorId), remark, linkUrl, hid); if (resultEditHomePicture.Result && resultEditHomePicture.Data) { return(Json(new ResultModel <bool>(0, "修改首页轮播图成功", true), JsonRequestBehavior.AllowGet)); } } return(Json(new ResultModel <bool>(8, "修改首页轮播图失败", false), JsonRequestBehavior.AllowGet)); }
// GET: Home public ActionResult Index() { int tehuiClassId = Utility.Util.ParseHelper.ToInt(System.Configuration.ConfigurationManager.AppSettings["TeHuiActivity"]); int benzhouClassId = Utility.Util.ParseHelper.ToInt(System.Configuration.ConfigurationManager.AppSettings["BenZhouActivity"]); pbs_basic_GoodsService pbsBasicGoodsService = new pbs_basic_GoodsService(); ResultInfo <List <pbs_basic_GoodsView> > result_tehui = pbsBasicGoodsService.GetGoodsList(string.Empty, tehuiClassId, -1, -1, -1, 0, -1, -1, -1, -1); if (result_tehui.Result && result_tehui.Data != null) { ViewData["TehuiList"] = result_tehui.Data.OrderByDescending(x => x.GoodsId).Take(3).ToList(); } ResultInfo <List <pbs_basic_GoodsView> > result_benzhou = pbsBasicGoodsService.GetGoodsList(string.Empty, benzhouClassId, -1, -1, -1, 0, -1, -1, -1, -1); if (result_benzhou.Result && result_benzhou.Data != null) { ViewData["BenzhouList"] = result_benzhou.Data.OrderByDescending(x => x.GoodsId).Take(3).ToList(); } pbs_basic_HomePictureService pbsHomePictureService = new pbs_basic_HomePictureService(); ResultInfo <List <pbs_basic_HomePicture> > result_HomePicture = pbsHomePictureService.GetHomePictureList(); if (result_HomePicture.Result && result_HomePicture.Data != null) { ViewData["HomePictureList"] = result_HomePicture.Data; } return(View()); }
public ActionResult HomePictureList() { pbsBasicHomePictureListResult result = new pbsBasicHomePictureListResult(); pbs_basic_HomePictureService pbsHomePictureService = new pbs_basic_HomePictureService(); ResultInfo <List <pbs_basic_HomePicture> > resultinfo = pbsHomePictureService.GetHomePictureList(); if (resultinfo.Result && resultinfo.Data != null) { result.List = resultinfo.Data; } return(View(result)); }
public JsonResult HomePictureDeleteAjax(string homePictureId) { if (!string.IsNullOrEmpty(homePictureId)) { int hid = Utility.Util.ParseHelper.ToInt(homePictureId); pbs_basic_HomePictureService pbsHomePictureService = new pbs_basic_HomePictureService(); ResultInfo <bool> resultDeleteHomePicture = pbsHomePictureService.DeleteHomePicture(hid); if (resultDeleteHomePicture.Result && resultDeleteHomePicture.Data) { return(Json(new ResultModel <bool>(0, "删除首页轮播图成功", true), JsonRequestBehavior.AllowGet)); } } return(Json(new ResultModel <bool>(1, "删除首页轮播图失败", false), JsonRequestBehavior.AllowGet)); }
public ActionResult HomePictureAdd(string homePictureId) { pbs_basic_HomePicture pbsHomePicture = new pbs_basic_HomePicture(); pbsHomePicture.HomePictureId = 0; pbsHomePicture.Url = string.Empty; pbsHomePicture.OrderBy = 0; pbsHomePicture.CreateTime = DateTime.Now; pbsHomePicture.UpdateTime = DateTime.Now; pbsHomePicture.CreatorId = 0; pbsHomePicture.Remark = string.Empty; pbsHomePicture.LinkUrl = string.Empty; pbs_basic_HomePictureService pbsHomePictureService = new pbs_basic_HomePictureService(); if (!string.IsNullOrEmpty(homePictureId)) { int hid = Utility.Util.ParseHelper.ToInt(homePictureId); ResultInfo <pbs_basic_HomePicture> resultItem = pbsHomePictureService.GetHomePictureModelById(hid); if (resultItem.Result && resultItem.Data != null) { pbsHomePicture.HomePictureId = resultItem.Data.HomePictureId; pbsHomePicture.Url = resultItem.Data.Url; pbsHomePicture.OrderBy = resultItem.Data.OrderBy; pbsHomePicture.CreateTime = resultItem.Data.CreateTime; pbsHomePicture.UpdateTime = resultItem.Data.UpdateTime; pbsHomePicture.CreatorId = resultItem.Data.CreatorId; pbsHomePicture.Remark = resultItem.Data.Remark; pbsHomePicture.LinkUrl = resultItem.Data.LinkUrl; } ViewBag.PageTitle = "修改首页轮播图"; } else { ViewBag.PageTitle = "添加首页轮播图"; } return(View(pbsHomePicture)); }