public JsonResult LoadBenefits(int page) { var psize = 7; if (page > 1) { psize = psize + (page - 1) * 4; } SearchModel sm = new SearchModel("HQ_DisplayPanel"); sm["DPanelType"] = (int)EnumDPanelType.MemberBenefit; sm.OrderBy("id"); sm.PageIndex = 1; sm.PageSize = psize; var result = sm.Load<HQ_DisplayPanel>(); List<HQ_DisplayPanel> list = null; if (page == 1) { list = result.Data; } else { list = new List<HQ_DisplayPanel>(); for (var i = 7 + (page - 2) * 4; i < result.Data.Count; ++i) { list.Add(result.Data[i]); } } return this.JsonNet(new { Data = list, PageCount = result.PageCount }); }
public JsonResult GetLinks(SearchModel sm, int page_g, int psize_g) { sm.SearchID = "HQ_FLink"; sm.OrderBy("ID", GOMFrameWork.DataEntity.EnumOrderBy.Desc); sm.PageIndex = page_g; sm.PageSize = psize_g; var result = sm.Load<HQ_FLink>(); return ExController.JsonNet(result); }
public JsonResult LoadDContentDesc(SearchModel se, int page_g, int psize_g) { se.SearchID = "hq_article"; se["acategory"] = (int)EnumArticleCategory.RoomDesc; se.OrderBy("id"); se.PageIndex = page_g; se.PageSize = psize_g; return ExController.JsonNet(se.Load<HQ_Article>()); }
public JsonResult LoadHotRoom(int destinationid, int dtype, int pindex = 1, int psize = 3) { SearchModel sm = new SearchModel("uv_VillageRoom_Hot"); sm["DPanelID"] = destinationid; sm["DType"] = dtype; sm.PageIndex = pindex; sm.PageSize = psize; sm.OrderBy("bcount", GOMFrameWork.DataEntity.EnumOrderBy.Desc); var rooms = sm.Load<HQ_Room>(); return this.JsonNet(rooms); }
public JsonResult LoadData(SearchModel se) { #region 查询条件初始化 Example:se["Field"] = "value"; se.SearchID = "hq_advertisement"; se.OrderBy("id"); #endregion var result = se.Load<HQ_Advertisement>(); return ExController.JsonNet(result); }
public JsonResult LoadJsonData() { SearchModel sm=new SearchModel("uv_DisplayContent"); sm.AddSearch("ID","Name"); sm["DPanelType"]=(int)EnumDPanelType.Distination; sm.OrderBy("DPanelID"); var result= sm.Load<HQ_DisplayContent>(); var items= HtmlSelect.GetHtmlSelectByCollection<HQ_DisplayContent>(result.Data,(e)=> { return new HtmlSelectItem(){ k=e.Name,v=(int)e.ID}; }); return ExController.JsonNet(new { Villages=items }); }
public JsonResult LoadAgenterList(SearchModel se, int page_g, int psize_g) { #region 查询条件初始化 Example:se["Field"] = "value"; se.SearchID="HQ_Agenter"; se.OrderBy("id", EnumOrderBy.Desc); #endregion se.PageIndex = page_g; se.PageSize = psize_g; var result = se.Load<HQ_Agenter>(); return ExController.JsonNet(result); }
public JsonResult LoadDestinations(SearchModel se, int page_g, int psize_g) { #region 查询条件初始化 Example:se["Field"] = "value"; se.SearchID = "HQ_DisplayPanel"; se["DPanelType"] = (int)EnumDPanelType.Distination; se.OrderBy("id", EnumOrderBy.Desc); #endregion se.PageIndex = page_g; se.PageSize = psize_g; var result = se.Load<HQ_DisplayPanel>(); return ExController.JsonNet(result); }
public JsonResult LoadAsks(SearchModel se, int page_g, int psize_g) { #region 查询条件初始化 Example:se["Field"] = "value"; se.SearchID = "uv_memberask"; //......................... se.OrderBy("id", EnumOrderBy.Desc); #endregion se.PageIndex = page_g; se.PageSize = psize_g; var result = se.Load<HQ_MemberAsk>(); return this.JsonNet(result); }
public ActionResult Index() { SearchModel sm = new SearchModel("HQ_Article"); sm["ACategory"] = (int)EnumArticleCategory.SilderImg; var entity = sm.LoadEntity<HQ_Article>(); if (entity != null) { ViewBag.SilderImgs = entity.AContent; } else { ViewBag.SilderImgs = string.Empty; } sm = new SearchModel("HQ_DisplayPanel"); sm["DPanelType"] = (int)EnumDPanelType.Distination; sm.PageIndex = 1; sm.PageSize = 12; sm.OrderBy("id"); ViewBag.DistList = sm.Load<HQ_DisplayPanel>().Data; return View(); }
public JsonResult LoadChangedOrder() { var sm = new SearchModel("uv_bookroom"); sm.LastOperateTime = DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0)); sm.OrderStateNotDelete = (int)EnumOrderState.Deleted; sm["MemberID"] = LoginInfo.Current.UserID; sm.OrderBy("LastOperateTime", EnumOrderBy.Desc); var list = sm.Load<HQ_BookRoom>().Data; return this.JsonNet(list); }
public void LoadAllValliages(int page = 1, int psize = 999) { SearchModel sm = new SearchModel("uv_DisplayContent"); sm["DPanelType"] = (int)EnumDPanelType.Distination; sm["DType"] = (int)EnumVillageType.Village; sm.OrderBy("id"); sm.PageIndex = page; sm.PageSize = psize; sm.AddSearch("id", "DPanel_G", "Name", "ImgName_G"); var result = sm.Load<HQ_DisplayContent>(); OutResult(result); }
public JsonResult LoadTraveGuides(SearchModel sm, int pindex_g, int psize_g = 8) { sm.SearchID = "HQ_Article"; sm["ACategory"] = (int)EnumArticleCategory.TravelGuide; sm.PageIndex = pindex_g; sm.PageSize = psize_g; sm.OrderBy("id", GOMFrameWork.DataEntity.EnumOrderBy.Desc); var result = sm.Load<HQ_Article>(); foreach (var d in result.Data) { var title = d.Title; if (title.Length > 30) { title = title.Substring(0, 30) + "..."; d.Title = title; } var content = System.Text.RegularExpressions.Regex.Replace(d.AContent, "<[^>]*>", ""); if (content.Length > 180) { content = content.Substring(0, 180); } var cindex = content.LastIndexOf('<'); if (cindex >= 0) { content = content.Substring(0, cindex); } d.AContent = content; } return this.JsonNet(new { list = result.Data, pager = Pager.InitPager(pindex_g, result.PageCount, "loadTraveGuides") }); }
public JsonResult LoadOrders(SearchModel sm, int page_g, int psize_g = 8) { sm.SearchID = "uv_bookroom"; sm["MemberID"] = LoginInfo.Current.UserID; sm.OrderStateNotDelete = (int)EnumOrderState.Deleted; sm.OrderBy("id", EnumOrderBy.Desc); sm.PageIndex = page_g; sm.PageSize = psize_g; var result = sm.Load<HQ_BookRoom>(); return this.JsonNet(new { Data = result.Data, pager = Pager.InitPager(page_g, result.PageCount, "loadOrders") }); }
public JsonResult LoadOrderByStatus(int status, int page, int psize = 4) { SearchModel sm = new SearchModel("uv_bookroom"); sm["MemberID"] = LoginInfo.Current.UserID; sm["OStatus"] = status; sm.OrderBy("id", EnumOrderBy.Desc); sm.PageIndex = page; sm.PageSize = psize; var result = sm.Load<HQ_BookRoom>(); return this.JsonNet(new { Data = result.Data, PageCount = result.PageCount }); }
public void LoadMyAsk(int uid) { SearchModel sm = new SearchModel("uv_memberask"); sm["MemberID"] = uid; sm.OrderBy("id", EnumOrderBy.Desc); var result = sm.Load<HQ_MemberAsk>(); OutResult(new { List = result.Data }); }
public void LoadUserOrders(int uid, int page = 1, int psize = 15) { SearchModel sm = new SearchModel("uv_memberorder"); sm["MemberID"] = uid; sm.OrderStateNotDelete = (int)EnumOrderState.Deleted; sm.OrderBy("id", EnumOrderBy.Desc); sm.PageIndex = page; sm.PageSize = psize; var result = sm.Load<HQ_BookRoom>(); OutResult(new { List = result.Data, PageCount = result.PageCount }); }
public void LoadTraveGuides(int page = 1, int psize = 999) { SearchModel sm = new SearchModel("HQ_Article"); sm["ACategory"] = (int)EnumArticleCategory.TravelGuide; sm.OrderBy("id", GOMFrameWork.DataEntity.EnumOrderBy.Desc); sm.PageIndex = page; sm.PageSize = psize; var result = sm.Load<HQ_Article>(); foreach (var d in result.Data) { var title = d.Title; if (title.Length > 25) { title = title.Substring(0, 25) + "..."; d.Title = title; } var content = System.Text.RegularExpressions.Regex.Replace(d.AContent, "<[^>]*>", ""); content = System.Text.RegularExpressions.Regex.Replace(content, @"&(nbsp|#160);", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase); content = System.Text.RegularExpressions.Regex.Replace(content, @" +", ""); content = System.Text.RegularExpressions.Regex.Replace(content, @" +", ""); if (content.Length > 30) { content = content.Substring(0, 30); } var cindex = content.LastIndexOf('<'); if (cindex >= 0) { content = content.Substring(0, cindex); } d.AContent = content; } OutResult(result); }
public void LoadNewCheaper(int page = 1, int psize = 999) { SearchModel sm = new SearchModel("uv_DisplayContent"); sm["DPanelType"] = (int)EnumDPanelType.NewCheaper; sm.OrderBy("id"); sm.PageIndex = page; sm.PageSize = psize; sm.AddSearch("id", "DPanel_G", "Name", "ImgName_G"); var result = sm.Load<HQ_DisplayContent>(); OutResult(result); }