/// <summary> /// 商铺详情 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Detail(int id) { ShopListEntity entity = ShopListBLL.GetById(id); if (entity == null) { return(Content("商铺不存在")); } return(View(entity)); }
protected void Button1_Click(object sender, EventArgs e) { string investname = Txtinvestname.Value; string investprice = Txtinvestprice.Value; string investcontent = Txtinvestcontent.Value; string investtime = start.Value; ShopListBLL shopListBLL = new ShopListBLL(); Repeater1.DataSource = shopListBLL.QueryInvests(investname, investprice, investcontent, investtime); Repeater1.DataBind(); }
private void BindShopList() { ShopListBLL shopListBLL = new ShopListBLL(); Repeater1.DataSource = shopListBLL.GetInvests(); Repeater1.DataBind(); HomeBLL bLL = new HomeBLL(); Repeater2.DataSource = bLL.Homeinvestment(); Repeater2.DataBind(); }
/// <summary> /// 兑换券详情 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Coupon(int id) { ShopListEntity entity = ShopListBLL.GetById(id); if (entity == null) { return(Content("商铺不存在")); } string code = Commons.GenerateExchangeCode(); ExchangeCodeBLL.Insert(entity.Id, code); ViewBag.Code = code; return(View(entity)); }
public ActionResult GetList(int page, int stationId, int shopType) { HandleResult hr = new HandleResult(); if (page < 1) { page = 1; } if (stationId < 0 || shopType < 0) { hr.Message = "参数错误"; return(Json(hr)); } if (shopType <= 0) { shopType = Enums.eShopType.地铁商铺.GetHashCode(); } PageSet pageSet = new PageSet() { PageIndex = page, PageSize = 20 }; List <ShopListEntity> list = ShopListBLL.GetPageList(stationId, shopType, pageSet); List <Dictionary <string, object> > listResult = new List <Dictionary <string, object> >(); foreach (var item in list) { Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("Id", item.Id); dict.Add("StationId", item.StationId); dict.Add("ShopType", item.ShopType); dict.Add("ShopImageUrl", string.IsNullOrWhiteSpace(item.ShopImageUrl) ? "img/st_icon.jpg" : "/upload/" + item.ShopImageUrl); dict.Add("ShopName", item.ShopName); dict.Add("Title", item.Title); dict.Add("Summury", item.Summury); dict.Add("ShopNo", item.ShopNo); dict.Add("Address", item.Address); dict.Add("AddTime", item.AddTime); listResult.Add(dict); } var data = new { list = listResult }; hr.StatsCode = 200; hr.Data = data; hr.Message = ""; return(Json(hr)); }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { int investid = Convert.ToInt32(e.CommandArgument); if (e.CommandName == "Delete") { int mid = Convert.ToInt32(Session["Mid"]); ShopListBLL shopListBLL = new ShopListBLL(); int count = shopListBLL.UpDelete(investid, mid); if (count > 0) { BindShopList(); } } }
public ActionResult GetList(int stationId, int shopType, int page = 1, int pageSize = 10) { HandleResult hr = new HandleResult(); PageSet pageSet = new PageSet() { PageIndex = page, PageSize = pageSize }; ViewBag.Data = null; List <ShopListEntity> list = ShopListBLL.GetPageList(stationId, shopType, pageSet); ViewBag.Data = list; ViewBag.RecordCount = pageSet.RecordCount; ViewBag.TotalPage = Math.Ceiling(pageSet.RecordCount / (pageSet.PageSize * 1.0)); return(PartialView("PartialList")); }