private DatagridObject createDatagrid(string status) { DatagridObject datagrid = null; ICriteria icr; IList <MemberModel> listHotel; icr = BaseZdBiz.CreateCriteria <MemberModel>(); icr.Add(Restrictions.Eq("status", status)); new MemberModel().setOrderBy(ref icr); listHotel = icr.List <MemberModel>(); PageList <MemberModel> pagerList = new PageList <MemberModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <MemberModel>(pagerList); return(datagrid); }
private DatagridObject createGeoDatagrid(string status) { DatagridObject datagrid = null; ICriteria icr; IList <GeoModel> listHotel; icr = BaseZdBiz.CreateCriteria <GeoModel>(); icr.Add(Restrictions.Eq("status", status)); icr.AddOrder(Order.Desc("recLevel")); listHotel = icr.List <GeoModel>(); PageList <GeoModel> pagerList = new PageList <GeoModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <GeoModel>(pagerList); return(datagrid); }
public ActionResult KaixinAuthResponse(string access_token) { if (string.IsNullOrEmpty(access_token)) { return(View()); } ICriteria icr = BaseZdBiz.CreateCriteria <MemberModel>(); //icr.Add(Restrictions.Eq("QQ", uid)); string uid = access_token.Split('_')[0]; if (this.getAuthMember() != null) { MemberModel m = BaseZdBiz.Load <MemberModel>(this.getAuthMember().id); m.kaixinUid = uid; JsResultObject re = BaseZdBiz.Update(m, ""); if (re.code == JsResultObject.CODE_SUCCESS) { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的开心网帐号:{0}已绑定成功,以后可以直接使用开心网帐号进行登录", uid), true); WebUtil.SetSessionAttr(typeof(MemberModel).Name, m); } else { this.SetResult(JsResultObject.CODE_ALERT, string.Format("当前帐号已和你的开心网帐号:{0}已绑定失败,可能已有相同的开心网帐号与其他帐号绑定了", uid), true); } return(RedirectToAction("Edit", "Account")); } icr.Add(Restrictions.Eq("kaixinUid", uid)); IList <MemberModel> members = icr.List <MemberModel>(); if (members.Count == 1) { MemberModel member = members[0]; member.pwd = ""; WebUtil.SetSessionAttr(typeof(MemberModel).Name, members[0]); return(Redirect(this.getPreUrl())); } else { this.SetResult(JsResultObject.CODE_ALERT, string.Format("你的开心网帐号:{0}已绑定成功,请保完以下基本资料完成登陆", uid), true); MemberModel member = new MemberModel(); // member.weiboUid = uid; member.kaixinUid = uid; ViewData[typeof(MemberModel).Name] = member; return(View("Index")); //return Redirect(WebUtil.GetWebRootPath()+"/MemberAdmin/Reg/Index"); } }
public ActionResult TableHotelRoomPriceInfo(string hotelId, DateTime checkInDate, DateTime checkOutDate) { ELongApiBiz elongBiz = ELongApiBiz.GetInstant(); PriceHotel[] priceInfo = elongBiz.getHotelRoomPrice(hotelId, checkInDate, checkOutDate); ICriteria icr = BaseZdBiz.CreateCriteria <HotelRoomModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelId)); IList <HotelRoomModel> rooms = icr.List <HotelRoomModel>(); ViewData[typeof(HotelRoomModel).Name] = rooms; ViewData[typeof(PriceHotel).Name] = priceInfo; ViewData["checkInDate"] = checkInDate.ToString(DateTimeUtil.PATTERN_DB_DATE); ViewData["checkOutDate"] = checkOutDate.ToString(DateTimeUtil.PATTERN_DB_DATE); return(View()); }
private DatagridObject createHotelDatagrid(string status, string qHotelNameType, string qHotelNameVal) { DatagridObject datagrid = null; ICriteria icr; IList <DictModel> listHotel; if (!string.IsNullOrEmpty(qHotelNameVal) && !string.IsNullOrEmpty(qHotelNameType)) { //带条件查询使用集合切割策略进行分页 icr = BaseZdBiz.CreateCriteria <DictModel>(); if (qHotelNameType == "text") { icr.Add(Restrictions.Like("text", "%" + qHotelNameVal + "%")); } else if (qHotelNameType == "value") { icr.Add((Restrictions.Like("value", "%" + qHotelNameVal + "%"))); } else { return(DatagridObject.NewIntanst()); } icr.Add(Restrictions.Eq("status", status)); icr.AddOrder(Order.Asc("type")); listHotel = icr.List <DictModel>(); PageList <DictModel> pagerList = new PageList <DictModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <DictModel>(pagerList); } else { //不带条件查询使用分页缓存进行分页 icr = BaseZdBiz.CreateCriteria <DictModel>(); icr.Add(Restrictions.Eq("status", status)); icr.AddOrder(Order.Asc("type")); listHotel = icr.List <DictModel>(); PageList <DictModel> pagerList = new PageList <DictModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <DictModel>(pagerList); // AdminBiz adminBiz = AdminBiz.GetInstant(); // TableCountModel tableCount = adminBiz.getTableCount(); // datagrid = new DatagridObject<DictModel>(listHotel, tableCount.hotelOk); } return(datagrid); }
// // GET: /Comment/ public ActionResult Index() { ICriteria icr = BaseZdBiz.CreateCriteria <HotelCommentModel>(this.getPager()); icr.AddOrder(Order.Desc("createDate")); IList <HotelCommentModel> hotelComments = icr.List <HotelCommentModel>(); ViewData[typeof(HotelCommentModel).Name] = hotelComments; this.VdHotBookingHotel(10); this.VdHotBrand(12); this.VdHotCity(15); PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(seo.commentIndexDesc); this.setPageKeyWords(seo.commentIndexKeywords); return(View()); }
public ActionResult RemoveExhiRefHotel(string ids, string exhiId) { string[] arrayIds = ids.Split(','); JsResultObject re = new JsResultObject(); ICriteria icr = BaseZdBiz.CreateCriteria <ExhiRefHotelModel>(); icr.Add(Restrictions.Eq("exhiId", exhiId)); icr.Add(Restrictions.In("hotelId", arrayIds)); IList <ExhiRefHotelModel> refHotels = icr.List <ExhiRefHotelModel>(); foreach (ExhiRefHotelModel refHotel in refHotels) { re.rowNum += BaseZdBiz.Delete(refHotel, "相关酒店").rowNum; } re.msg = string.Format("成功删除{0}条记录", re.rowNum); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult DatagridExhiRefHotel(string exhiId) { ICriteria icr = BaseZdBiz.CreateCriteria <ExhiRefHotelModel>(); icr.Add(Restrictions.Eq("exhiId", exhiId)); IList <ExhiRefHotelModel> refHotels = icr.List <ExhiRefHotelModel>(); IList <string> ids = new List <string>(); foreach (ExhiRefHotelModel refHotel in refHotels) { ids.Add(refHotel.hotelId); } icr = BaseZdBiz.CreateCriteria <HotelModel>(); icr.Add(Restrictions.In("hotelId", ids.ToArray())); IList <HotelModel> hotels = icr.List <HotelModel>(); DatagridObject datagrid = DatagridObject.ToDatagridObject <HotelModel>(hotels); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
private void btnImport_Click(object sender, EventArgs e) { this.tsslResult.Text = "开始导入。。。"; this.lvImportHotels.Items.Clear(); string keyword = tbKeyword.Text.Trim(); ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(); icr.SetFirstResult(Convert.ToInt32(this.nudMin.Value)); icr.SetMaxResults(Convert.ToInt32(this.nudMax.Value)); icr.Add(Restrictions.Like("hotelName", "%" + keyword + "%")); _hotels = icr.List <HotelModel>(); DataBiz dataBiz = DataBiz.GetInstant(); isStop = false; Thread t = new Thread(new ThreadStart(startImportHotelDetail)); t.Start(); }
public ActionResult Datagrid(string qt, string qv) { DatagridObject datagrid = null; ICriteria icr; IList <GeoModel> listHotel; icr = BaseZdBiz.CreateCriteria <GeoModel>(); // icr.Add(Restrictions.Eq("status", status)); if (!string.IsNullOrEmpty(qv) && !string.IsNullOrEmpty(qt)) { icr.Add(Restrictions.Like(qt, "%" + qv + "%")); } icr.AddOrder(Order.Desc("recLevel")); listHotel = icr.List <GeoModel>(); PageList <GeoModel> pagerList = new PageList <GeoModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <GeoModel>(pagerList); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public ActionResult Search(string cityName, string keyWord, string geoClId, string geoDId, DateTime?checkInDate) { PublicBiz publicBiz = PublicBiz.GetInstant(); FrontPageModel frontPage = publicBiz.getCurFrontPage(); GeoBiz geoBiz = GeoBiz.GetInstant(); GeoModel geo = geoBiz.GetGeoByCityName(cityName); this.VdGeoLocation(geo); GeoLocationModel geoLocation = null; PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(string.Format(seo.cityDesc, geo.cityCode, geo.cityName)); this.setPageKeyWords(string.Format(seo.cityKeywords, geo.cityCode, geo.cityName)); if (!string.IsNullOrEmpty(geoClId)) { geoLocation = BaseZdBiz.Load <GeoCommercialLocationModel>(Restrictions.Eq("geoFk", geo.id), Restrictions.Eq("locationId", geoClId)); this.setPageDesc(string.Format(seo.cityClDesc, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name)); this.setPageKeyWords(string.Format(seo.cityClKeywords, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name)); } else if (!string.IsNullOrEmpty(geoDId)) { geoLocation = BaseZdBiz.Load <GeoDistrictsModel>(Restrictions.Eq("geoFk", geo.id), Restrictions.Eq("locationId", geoDId)); this.setPageDesc(string.Format(seo.cityDDesc, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name)); this.setPageKeyWords(string.Format(seo.cityDKeywords, geo.cityCode, geo.cityName, geoLocation.locationId, geoLocation.name)); } else if (!string.IsNullOrEmpty(keyWord)) { this.setPageDesc(string.Format(seo.hotelSearchDesc, cityName, keyWord, (checkInDate ?? DateTime.Now).ToShortDateString())); this.setPageKeyWords(string.Format(seo.hotelSearchKeywords, cityName, keyWord, (checkInDate ?? DateTime.Now).ToShortDateString())); } ViewData[typeof(GeoLocationModel).Name] = geoLocation; ICriteria icr = BaseZdBiz.CreateCriteria <BrandModel>(); string[] brandNames = frontPage.searchBrandNameArray.Split(','); icr.Add(Restrictions.In("brandName", brandNames)); IList <BrandModel> brands = icr.List <BrandModel>(); ViewData[typeof(BrandModel).Name] = brands; this.VdHotCity(15); return(View()); }
protected void VdHotCommentHotel(int rows) { ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, rows)); icr.AddOrder(Order.Desc("goodCommentCount")); IList <HotelModel> hotels = icr.List <HotelModel>(); /* * IList<string> monthIds = new List<string>(); * foreach (HotelModel hotel in hotels) * { * monthIds.Add(hotel.hotelId); * } * icr = BaseZdBiz.CreateCriteria<HotelDetailModel>(); * icr.Add(Restrictions.In("id", monthIds.ToArray())); * * IList<HotelDetailModel> details = icr.List<HotelDetailModel>(); */ ViewData[VD_KEY_HOT_COMMENT_HOTEL_LIST] = hotels; }
public ActionResult OrderEdit(string hotelId, string roomTypeId, int ratePlanId, DateTime?checkInDate, DateTime?checkOutDate) { ELongApiBiz elongBiz = ELongApiBiz.GetInstant(); RoomForGetHotelList roomForGetHotelList = elongBiz.getRoomForGetHotelList(hotelId, roomTypeId, checkInDate ?? this.getDefaultCheckInDate(), checkOutDate ?? this.getDefaultCheckOutDate(), ratePlanId); HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId); ICriteria icr = BaseZdBiz.CreateCriteria <HotelRoomModel>(); icr.Add(Restrictions.And(Restrictions.Eq("hotelFk", hotelId), Restrictions.Eq("roomTypeId", roomTypeId))); IList <HotelRoomModel> rooms = icr.List <HotelRoomModel>(); if (rooms.Count == 1) { ViewData[typeof(HotelRoomModel).Name] = rooms[0]; } ViewData["checkInDate"] = (checkInDate ?? this.getDefaultCheckInDate()).ToString(DateTimeUtil.PATTERN_DB_DATE); ViewData["checkOutDate"] = (checkOutDate ?? this.getDefaultCheckOutDate()).ToString(DateTimeUtil.PATTERN_DB_DATE); ViewData[typeof(RatePlanForGetHotelList).Name] = roomForGetHotelList.RatePlans[0]; ViewData[typeof(HotelDetailModel).Name] = hotelDetail; return(View()); }
public ActionResult Index(string keyword) { ICriteria icr = BaseZdBiz.CreateCriteria <NewsModel>(); icr.AddOrder(Order.Desc("deployDate")); if (WebUtil.IsPost()) { icr.Add(Restrictions.Like("title", "%" + keyword + "%")); } IList <NewsModel> newss = icr.List <NewsModel>(); ViewData[typeof(NewsModel).Name] = newss; this.VdHotBookingHotel(10); this.VdHotBrand(12); this.VdHotCity(15); PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(seo.newsIndexDesc); this.setPageKeyWords(seo.newsIndexKeywords); return(View()); }
public ActionResult BrandHotel(string brandId) { ICriteria icr = BaseZdBiz.CreateCriteria <HotelDetailModel>(); icr.Add(Restrictions.Eq("brandId", brandId)); IList <HotelDetailModel> hotels = icr.List <HotelDetailModel>(); ViewData[typeof(HotelDetailModel).Name] = hotels; BrandModel brand = BaseZdBiz.Load <BrandModel>(brandId); ViewData[typeof(BrandModel).Name] = brand; this.VdHotBookingHotel(10); this.VdHotCity(15); PageSeoModel seo = PublicBiz.getCurPageSeo(); //{0}品牌code,{1}:品牌长名,{2}:品牌短名, {3}:拼音 this.setPageDesc(string.Format(seo.brandHotelDesc, brand.brandID, brand.brandNameLong, brand.brandName, brand.brandPinYin)); this.setPageKeyWords(string.Format(seo.brandHotelKeywords, brand.brandID, brand.brandNameLong, brand.brandName, brand.brandPinYin)); return(View()); }
public ActionResult NewsHotel(string newsId) { NewsModel news = BaseZdBiz.Load <NewsModel>(newsId); ICriteria icr = BaseZdBiz.CreateCriteria <NewsRefHotelModel>(); icr.Add(Restrictions.Eq("newsId", newsId)); IList <NewsRefHotelModel> refHotels = icr.List <NewsRefHotelModel>(); IList <string> ids = new List <string>(); if (refHotels.Count > 0) { ids = ObjectUtil.GetProList(refHotels, "hotelId"); } else { icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, 10)); icr.Add(Restrictions.Eq("recInd", BaseModel.IND_Y)); IList <HotelModel> hotels = icr.List <HotelModel>(); ids = ObjectUtil.GetProList(hotels, "hotelId"); } news.hotelIdArray = StringUtil.UnionArray(ids.ToArray(), ','); icr = BaseZdBiz.CreateCriteria <NewsModel>(new PagerObject(1, 5)); icr.Add(Restrictions.Not(Restrictions.Eq("id", newsId))); icr.AddOrder(Order.Desc("deployDate")); IList <NewsModel> refNews = icr.List <NewsModel>(); ViewData["refNews"] = refNews; ViewData[typeof(NewsModel).Name] = news; this.VdHotCity(15); //{0}新闻code,{1}:新闻主题,{2}:新闻日期 ,{3}:新闻内容 PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(string.Format(seo.newsHotelDesc, news.id, news.title, news.deployDate.ToShortDateString(), news.context).Substring(0, 228)); this.setPageKeyWords(string.Format(seo.newsHotelKeywords, news.id, news.title, news.deployDate.ToShortDateString(), news.context)); return(View()); }
protected void VdHotBookingHotel(int rows) { ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, rows)); icr.AddOrder(Order.Desc("monthBookedCount")); IList <HotelModel> hotels = icr.List <HotelModel>(); ViewData[VD_KEY_HOT_MONTH_BOOKING_HOTEL_LIST] = hotels; /* * IList<string> monthIds = new List<string>(); * foreach (HotelModel hotel in hotels) * { * monthIds.Add(hotel.hotelId); * } * icr = BaseZdBiz.CreateCriteria<HotelDetailModel>(); * icr.Add(Restrictions.In("id", monthIds.ToArray())); * IList<HotelDetailModel> monthDetails = icr.List<HotelDetailModel>(); * ViewData[VD_KEY_HOT_MONTH_BOOKING_HOTEL_LIST] = monthDetails; * */ icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, rows)); icr.AddOrder(Order.Desc("weekBookedCount")); hotels = icr.List <HotelModel>(); ViewData[VD_KEY_HOT_WEEK_BOOKING_HOTEL_LIST] = hotels; /* * IList<string> weekIds = new List<string>(); * foreach (HotelModel hotel in hotels) * { * weekIds.Add(hotel.hotelId); * } * icr = BaseZdBiz.CreateCriteria<HotelDetailModel>(); * icr.Add(Restrictions.In("id", weekIds.ToArray())); * IList<HotelDetailModel> weekDetails = icr.List<HotelDetailModel>(); * * ViewData[VD_KEY_HOT_WEEK_BOOKING_HOTEL_LIST] = weekDetails; * */ }
public ActionResult TableHotelRoomPriceInfo2(string hotelId, DateTime checkInDate, DateTime checkOutDate) { ELongApiBiz elongBiz = ELongApiBiz.GetInstant(); //PriceHotel[] priceInfo = elongBiz.getHotelRoomPrice(hotelId, checkInDate, checkOutDate); GetHotelConditionForGetHotelList condition = new GetHotelConditionForGetHotelList(); condition.CheckInDate = checkInDate; condition.CheckOutDate = checkOutDate; condition.HotelId = hotelId; HotelForGetHotelList hotel = elongBiz.getHotelList(condition).ElementAt <HotelForGetHotelList>(0); ICriteria icr = BaseZdBiz.CreateCriteria <HotelRoomModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelId)); IList <HotelRoomModel> rooms = icr.List <HotelRoomModel>(); ViewData[typeof(HotelRoomModel).Name] = rooms; ViewData[typeof(HotelForGetHotelList).Name] = hotel; ViewData["checkInDate"] = checkInDate.ToString(DateTimeUtil.PATTERN_DB_DATE); ViewData["checkOutDate"] = checkOutDate.ToString(DateTimeUtil.PATTERN_DB_DATE); return(View()); }
public ActionResult TableMemberReward(string statue) { MemberModel member = this.getAuthMember(); ICriteria icr = BaseZdBiz.CreateCriteria <MemberRewardModel>(); if (string.IsNullOrEmpty(statue)) { icr.Add(Restrictions.Eq("memberFk", member.id)); } else { string[] states = statue.Split(','); icr.Add(Restrictions.And(Restrictions.Eq("memberFk", member.id), Restrictions.In("orderStatus", states))); } IList <MemberRewardModel> orders = icr.List <MemberRewardModel>(); PageList <MemberRewardModel> pageList = new PageList <MemberRewardModel>(orders, this.getPager()); ViewData[typeof(MemberRewardModel).Name] = pageList; return(View()); }
private DatagridObject createExhiDatagrid(string status, string exhiStatus) { DatagridObject datagrid = null; ICriteria icr; IList <ExhiModel> listHotel; icr = BaseZdBiz.CreateCriteria <ExhiModel>(); if (string.IsNullOrEmpty(exhiStatus)) { icr.Add(Restrictions.Eq("status", status)); } else { icr.Add(Restrictions.And(Restrictions.Eq("status", status), Restrictions.Eq("exhiStatus", exhiStatus))); } new ExhiModel().setOrderBy(ref icr); listHotel = icr.List <ExhiModel>(); PageList <ExhiModel> pagerList = new PageList <ExhiModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <ExhiModel>(pagerList); return(datagrid); }
public ActionResult ExhiHotel(string exhiId) { ExhiModel exhi = BaseZdBiz.Load <ExhiModel>(exhiId); ICriteria icr = BaseZdBiz.CreateCriteria <ExhiRefHotelModel>(); icr.Add(Restrictions.Eq("exhiId", exhiId)); IList <ExhiRefHotelModel> refHotels = icr.List <ExhiRefHotelModel>(); IList <string> ids = new List <string>(); if (refHotels.Count > 0) { ids = ObjectUtil.GetProList(refHotels, "hotelId"); } else { icr = BaseZdBiz.CreateCriteria <HotelModel>(new PagerObject(1, 10)); icr.Add(Restrictions.Eq("recInd", BaseModel.IND_Y)); IList <HotelModel> hotels = icr.List <HotelModel>(); ids = ObjectUtil.GetProList(hotels, "hotelId"); } exhi.hotelIdArray = StringUtil.UnionArray(ids.ToArray(), ','); icr = BaseZdBiz.CreateCriteria <ExhiModel>(); icr.Add(Restrictions.Eq("geoFk", exhi.geoFk)); icr.Add(Restrictions.Not(Restrictions.Eq("id", exhi.id))); icr.AddOrder(Order.Desc("startDate")); IList <ExhiModel> exhis = icr.List <ExhiModel>(); ViewData["refExhis"] = exhis; ViewData[typeof(ExhiModel).Name] = exhi; this.VdHotCity(15); PageSeoModel seo = PublicBiz.getCurPageSeo(); //{0}展会code,{1}:展会名,{2}:展会地址, {3}:展会时间 ,{4}:行业,{5}:内容 this.setPageDesc(string.Format(seo.exhiHotelDesc, exhi.id, exhi.name, exhi.address, exhi.startDate.ToShortDateString(), exhi.busName, exhi.msg).Substring(0, 228)); this.setPageKeyWords(string.Format(seo.exhiHotelKeywords, exhi.id, exhi.name, exhi.address, exhi.startDate.ToShortDateString(), exhi.busName, exhi.msg)); return(View()); }
public ActionResult Tree(string parentId) { AdminBiz adminBiz = AdminBiz.GetInstant(); UserModel user = WebUtil.GetSessionAttr<UserModel>(AdminBiz.SESSION_KEY_USER); if (user == null) { //return new List<TreeNodeObject>(); } RoleModel role =BaseZdBiz.Load<RoleModel>(user.roleFk); if (role == null) { //return new List<TreeNodeObject>(); } string[] arrayMenuFk = role.getArrayMenuFk(); ICriteria icr = BaseZdBiz.CreateCriteria<MenuModel>(); icr.Add(Restrictions.In("id", arrayMenuFk)); icr.Add(Restrictions.Eq("status",BaseModel.STATUS_ACTIVATE)); IList<MenuModel> menus = icr.List<MenuModel>(); IList<TreeNodeObject> nodes = adminBiz.createTree(menus,parentId); return JsonText(nodes,JsonRequestBehavior.AllowGet); }
private DatagridObject createDatagrid(string status, string qNameType, string qNameVal) { DatagridObject datagrid = null; ICriteria icr; IList <BrandModel> listHotel; icr = BaseZdBiz.CreateCriteria <BrandModel>(); bool isQuery = !string.IsNullOrEmpty(qNameType) && !string.IsNullOrEmpty(qNameVal); icr.Add(Restrictions.Eq("status", status)); if (isQuery) { icr.Add(Restrictions.Or(Restrictions.Like("brandNameLong", "%" + qNameVal + "%"), Restrictions.Like("brandName", "%" + qNameVal + "%"))); } new BrandModel().setOrderBy(ref icr); listHotel = icr.List <BrandModel>(); PageList <BrandModel> pagerList = new PageList <BrandModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <BrandModel>(pagerList); return(datagrid); }
/* * private void btnSelectScriptPath_Click(object sender, EventArgs e) * { * OpenFileDialog file = new OpenFileDialog(); * if (file.ShowDialog() == DialogResult.OK) * { * tbScriptPath.Text = file.FileName; * } * else { * MessageBox.Show("你没有选择目录"); * } * } * * private void btnGenScript_Click(object sender, EventArgs e) * { * string scriptPath=tbScriptPath.Text.Trim(); * FileUtil.FileDel(scriptPath ); * String scriptContext = this.getScript(); * if (FileUtil.WriteFile(scriptPath, scriptContext)) * { * MessageBox.Show(string.Format("写入文件成功:{0}", scriptPath)); * } * else { * MessageBox.Show(string.Format("写入文件失败:{0}", scriptPath)); * } * } */ private string getScript() { StringBuilder sbr = new StringBuilder(""); sbr.Append(getSubScript("/Public/Home/Index", tbPathIndex.Text)); sbr.Append(getSubScript("/Public/Hotel/Index", tbPathHotel.Text)); sbr.Append(getSubScript("/Public/Comment/Index", tbPathComment.Text)); sbr.Append(getSubScript("/Public/Brand/Index", tbPathBrand.Text)); sbr.Append(getSubScript("/Public/News/Index", tbPathNews.Text)); sbr.Append(getSubScript("/Public/Exhi/Index", tbPathExhi.Text)); ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(); IList <HotelModel> hotels = icr.List <HotelModel>(); foreach (HotelModel hotel in hotels) { sbr.Append(getSubScript( string.Format("/Public/Hotel/Detail?hotelId={0}", hotel.hotelId) , string.Format(tbPathHotelDetail.Text, hotel.hotelId) )); } icr = BaseZdBiz.CreateCriteria <BrandModel>(); IList <BrandModel> brands = icr.List <BrandModel>(); foreach (BrandModel brand in brands) { sbr.Append(getSubScript( string.Format("/Public/Brand/BrandHotel?brandId={0}", brand.brandID) , string.Format(tbPathBrandDetail.Text, brand.brandID) )); } return(sbr.ToString()); }
public ActionResult ViewHotelSearch(string viewName, string cityName, DateTime?checkInDate, DateTime?checkOutDate, string keyword, string hotelId , string star, string priceRegexp, string geoLlId, string geoClId, string geoDid, string brandName, string orderbyCode, string orderbyType , decimal?startLng, decimal?endLng, decimal?startLat, decimal?endLat, string geoMode, int?radius ) { ELongApiBiz elongBiz = ELongApiBiz.GetInstant(); GeoBiz geoBiz = GeoBiz.GetInstant(); string cityId = geoBiz.GetGeoByCityName(cityName).cityCode; ToyzNumberRangeObject priceRange = null; GetHotelConditionForGetHotelList condition = new GetHotelConditionForGetHotelList(); condition.CheckInDate = checkInDate ?? this.getDefaultCheckInDate(); condition.CheckOutDate = checkOutDate ?? this.getDefaultCheckOutDate(); condition.CityId = cityId; //condition.HotelName = keyword; condition.MaxRows = this.getPager().size; condition.PageIndex = this.getPager().page; if (string.IsNullOrEmpty(geoMode) || geoMode == "0") { if (!string.IsNullOrEmpty(keyword)) { condition.HotelName = keyword; } if (!string.IsNullOrEmpty(hotelId)) { condition.HotelId = hotelId; condition.CityId = null; } if (!string.IsNullOrEmpty(brandName)) { condition.HotelName = brandName; } if (!string.IsNullOrEmpty(star)) { condition.StarCode = star; } if (!string.IsNullOrEmpty(priceRegexp)) { priceRegexp = HttpUtility.UrlDecode(priceRegexp); IToyzObjcet toyzPrice = NumberUtil.ParseToyz(priceRegexp); priceRange = toyzPrice as ToyzNumberRangeObject; if (priceRange != null) { condition.LowestRate = priceRange.min; condition.HighestRate = priceRange.max; } } if (!string.IsNullOrEmpty(geoLlId)) { condition.LandmarkLocationID = geoLlId; } else if (!string.IsNullOrEmpty(geoClId)) { condition.CommercialLocationId = geoClId; } else if (!string.IsNullOrEmpty(geoDid)) { condition.DistrictId = geoDid; } } else if (geoMode == "1") { condition.StartLatitude = startLat ?? 0; condition.StartLongitude = startLng ?? 0; condition.EndLatitude = endLat ?? 0; condition.EndLongitude = endLng ?? 0; condition.PositionModeCode = geoMode; } else if (geoMode == "2") { condition.StartLatitude = startLat ?? 0; condition.StartLongitude = startLng ?? 0; condition.EndLatitude = condition.StartLatitude; condition.EndLongitude = condition.StartLongitude; condition.PositionModeCode = geoMode; condition.Radius = radius ?? 0; } if (!string.IsNullOrEmpty(orderbyCode)) { condition.OrderByCode = orderbyCode; condition.OrderTypeCode = orderbyType; } else { condition.OrderTypeCode = "desc"; } PageList <HotelForGetHotelList> hotels = elongBiz.getHotelList(condition); /* * if(priceRegexp!=null){ * foreach (HotelForGetHotelList hotel in hotels) { * foreach() * RoomForGetHotelList[] rooms = hotel.Rooms; * } */ IList <string> hotelIds = new List <string>(); foreach (HotelForGetHotelList hotel in hotels) { hotelIds.Add(hotel.HotelId); } ICriteria icr = BaseZdBiz.CreateCriteria <HotelDetailModel>(); icr.Add(Restrictions.In("id", hotelIds.ToArray())); IList <HotelDetailModel> hotelDetails = icr.List <HotelDetailModel>(); icr = BaseZdBiz.CreateCriteria <HotelFeatrueInfoModel>(); icr.Add(Restrictions.In("hotelId", hotelIds.ToArray())); IList <HotelFeatrueInfoModel> hotelFeats = icr.List <HotelFeatrueInfoModel>(); Dictionary <string, HotelDetailModel> dictHotelDetails = hotelDetails.ToDictionary(p => p.id); Dictionary <string, HotelFeatrueInfoModel> dictHotelFeat = hotelFeats.ToDictionary(p => p.hotelId); ViewData[typeof(PageList <HotelForGetHotelList>).Name] = hotels; ViewData[typeof(Dictionary <string, HotelDetailModel>).Name] = dictHotelDetails; ViewData[typeof(HotelFeatrueInfoModel).Name] = dictHotelFeat; ViewData[typeof(ToyzNumberRangeObject).Name] = priceRange; return(View(viewName)); }
// // GET: /Hotel/ public ActionResult Detail(string hotelId) { HotelDetailModel hotelDetail = BaseZdBiz.Load <HotelDetailModel>(hotelId); ViewData[typeof(HotelDetailModel).Name] = hotelDetail; HotelFeatrueInfoModel hotelFi = BaseZdBiz.Load <HotelFeatrueInfoModel>(hotelId); ViewData[typeof(HotelFeatrueInfoModel).Name] = hotelFi; HotelModel hotel = BaseZdBiz.Load <HotelModel>(hotelId); ViewData[typeof(HotelModel).Name] = hotel; ICriteria icr = BaseZdBiz.CreateCriteria <HotelImageModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelId)); IList <HotelImageModel> images = icr.List <HotelImageModel>(); ViewData[typeof(HotelImageModel).Name] = images; GeoBiz geoBiz = GeoBiz.GetInstant(); GeoModel geo = geoBiz.GetGeoByCityId(hotelDetail.city); this.VdGeoLocation(geo); icr = BaseZdBiz.CreateCriteria <HotelLandMarkModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelLandMarkModel> hotelLls = icr.List <HotelLandMarkModel>(); ViewData[typeof(HotelLandMarkModel).Name] = hotelLls; icr = BaseZdBiz.CreateCriteria <HotelSurroundingAttractionModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingAttractionModel> hotelSas = icr.List <HotelSurroundingAttractionModel>(); ViewData[typeof(HotelSurroundingAttractionModel).Name] = hotelSas; icr = BaseZdBiz.CreateCriteria <HotelSurroundingCommerceModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingCommerceModel> hotelScs = icr.List <HotelSurroundingCommerceModel>(); ViewData[typeof(HotelSurroundingCommerceModel).Name] = hotelScs; icr = BaseZdBiz.CreateCriteria <HotelSurroundingRestaurantModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingRestaurantModel> hotelSrs = icr.List <HotelSurroundingRestaurantModel>(); ViewData[typeof(HotelSurroundingRestaurantModel).Name] = hotelSrs; icr = BaseZdBiz.CreateCriteria <HotelSurroundingShopModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelSurroundingShopModel> hotelSss = icr.List <HotelSurroundingShopModel>(); ViewData[typeof(HotelSurroundingShopModel).Name] = hotelSss; icr = BaseZdBiz.CreateCriteria <HotelTrafficInfoModel>(); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); IList <HotelTrafficInfoModel> hotelTrs = icr.List <HotelTrafficInfoModel>(); ViewData[typeof(HotelTrafficInfoModel).Name] = hotelTrs; icr = BaseZdBiz.CreateCriteria <HotelCommentModel>(new PagerObject(1, 5)); icr.Add(Restrictions.Eq("hotelFk", hotelDetail.id)); icr.AddOrder(Order.Desc("createDate")); IList <HotelCommentModel> hotelComments = icr.List <HotelCommentModel>(); ViewData[typeof(HotelCommentModel).Name] = hotelComments; PageSeoModel seo = PublicBiz.getCurPageSeo(); this.setPageDesc(string.Format(seo.hotelDetailDesc, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName)); this.setPageKeyWords(string.Format(seo.hotelDetailKeywords, hotel.hotelId, hotel.hotelName, hotelDetail.address, hotelDetail.description, geo.cityCode, geo.cityName)); this.VdHotCity(15); return(View()); }
private DatagridObject createGuestDatagrid(string status, string type, string qtGuestName, string qvGuestName) { DatagridObject datagrid = null; ICriteria icr; IList <GuestModel> listHotel; icr = BaseZdBiz.CreateCriteria <GuestModel>(); if (type == "") { icr.Add(Restrictions.Eq("status", status)); } else { icr.Add(Restrictions.And(Restrictions.Eq("status", status), Restrictions.Eq("type", type))); } if (!string.IsNullOrEmpty(qvGuestName) && !string.IsNullOrEmpty(qtGuestName)) { //带条件查询使用集合切割策略进行分页 if (qtGuestName == "cn") { icr.Add(Restrictions.Like("nameCn", "%" + qvGuestName + "%")); } else if (qtGuestName == "en") { icr.Add(Restrictions.Like("nameEn", "%" + qvGuestName + "%")); } else if (qtGuestName == "idcard") { icr.Add(Restrictions.Eq("idNumber", qvGuestName)); } else { return(DatagridObject.NewIntanst()); } new GuestModel().setOrderBy(ref icr); listHotel = icr.List <GuestModel>(); PageList <GuestModel> pagerList = new PageList <GuestModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <GuestModel>(pagerList); } else { //不带条件查询使用分页缓存进行分页 icr = BaseZdBiz.CreateCriteria <GuestModel>(this.getPager()); if (type == "") { icr.Add(Restrictions.Eq("status", status)); } else { icr.Add(Restrictions.And(Restrictions.Eq("status", status), Restrictions.Eq("type", type))); } // icr.Add(Restrictions.Eq("status", status)); new GuestModel().setOrderBy(ref icr); listHotel = icr.List <GuestModel>(); AdminBiz adminBiz = AdminBiz.GetInstant(); TableCountModel tableCount = adminBiz.getTableCount(); datagrid = DatagridObject.ToDatagridObject <GuestModel>(listHotel, tableCount.hotelOk); } return(datagrid); }
public void StartGenPageFile() { isStop = false; int count = 0; GeoBiz geoBiz = GeoBiz.GetInstant(); if (cbHomeIndex.Checked) { count += genPageFile("/Public/Home/Index", tbPathIndex.Text); } if (cbHotelIndex.Checked) { count += genPageFile("/Public/Hotel/Index", tbPathHotel.Text); } if (cbCommentIndex.Checked) { count += genPageFile("/Public/Comment/Index", tbPathComment.Text); } if (cbBrandIndex.Checked) { count += genPageFile("/Public/Brand/Index", tbPathBrand.Text); } if (cbNewsIndex.Checked) { count += genPageFile("/Public/News/Index", tbPathNews.Text); } if (cbExhiIndex.Checked) { count += genPageFile("/Public/Exhi/Index", tbPathExhi.Text); } ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(); if (cbHotelDetail.Checked) { IList <HotelModel> hotels = icr.List <HotelModel>(); count = 0; foreach (HotelModel hotel in hotels) { if (isStop) { break; } count += genPageFile( string.Format("/Public/Hotel/Detail?hotelId={0}", hotel.hotelId) , string.Format(tbPathHotelDetail.Text, hotel.hotelId) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3} 生成中...", count, hotels.Count, hotel.hotelId, hotel.hotelName); } } if (cbBrandDetail.Checked) { icr = BaseZdBiz.CreateCriteria <BrandModel>(); IList <BrandModel> brands = icr.List <BrandModel>(); count = 0; foreach (BrandModel brand in brands) { if (isStop) { break; } count += genPageFile( string.Format("/Public/Brand/BrandHotel?brandId={0}", brand.brandID) , string.Format(tbPathBrandDetail.Text, brand.brandID) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3} 生成中...", count, brands.Count, brand.brandID, brand.brandName); } } if (cbNewsHotel.Checked) { icr = BaseZdBiz.CreateCriteria <NewsModel>(); IList <NewsModel> newss = icr.List <NewsModel>(); count = 0; foreach (NewsModel news in newss) { if (isStop) { break; } count += genPageFile( string.Format("/Public/News/NewsHotel?newsId={0}", news.id) , string.Format(tbPathNewsDetail.Text, news.id) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3} 生成中...", count, newss.Count, news.id, news.title); } } if (cbExhiHotel.Checked) { icr = BaseZdBiz.CreateCriteria <ExhiModel>(); IList <ExhiModel> exhis = icr.List <ExhiModel>(); count = 0; foreach (ExhiModel exhi in exhis) { if (isStop) { break; } count += genPageFile( string.Format("/Public/Exhi/ExhiHotel?exhiId={0}", exhi.id) , string.Format(tbPathExhiDetail.Text, exhi.id) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3} 生成中...", count, exhis.Count, exhi.id, exhi.name); } } if (cbCityHotel.Checked) { IList <GeoModel> geos = BaseZdBiz.List <GeoModel>(); foreach (GeoModel geo in geos) { if (isStop) { break; } count += genPageFile( string.Format("/Public/Hotel/Search?cityName={0}", geo.cityName) , string.Format(tbCityHotel.Text.Trim(), geo.cityName, geo.cityCode) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3} 生成中...", count, geos.Count, geo.cityCode, geo.cityName); if (cbClHotel.Checked) { IList <GeoCommercialLocationModel> geoCls = geoBiz.GetGeoCls(geo.id); int c = 0; foreach (GeoCommercialLocationModel geoCl in geoCls) { if (isStop) { break; } c += genPageFile( string.Format("/Public/Hotel/Search?cityName={0}&geoClId={1}", geo.cityName, geoCl.locationId) , string.Format(tbClHotel.Text.Trim(), geo.cityCode, geoCl.locationId) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3}:{4} 生成中...", c, geoCls.Count, geo.cityCode, geo.cityName, geoCl.name); } } if (cbDHotel.Checked) { IList <GeoDistrictsModel> geoDs = geoBiz.GetGeoDs(geo.id); int c = 0; foreach (GeoDistrictsModel geoD in geoDs) { if (isStop) { break; } c += genPageFile( string.Format("/Public/Hotel/Search?cityName={0}&geoDId={1}", geo.cityName, geoD.locationId) , string.Format(tbDHotel.Text.Trim(), geo.cityCode, geoD.locationId) ); this.tsslResult.Text = string.Format("({0}/{1}),{2}:{3}:{4} 生成中...", c, geoDs.Count, geo.cityCode, geo.cityName, geoD.name); } } } } this.tsslResult.Text = string.Format("{0}完成", DateTime.Now.ToString()); }
private DatagridObject createHotelDatagrid(string status, string isreserve, string qHotelNameType, string qHotelNameVal) { DatagridObject datagrid = null; ICriteria icr = null; IList <HotelModel> listHotel; bool isQuery = !string.IsNullOrEmpty(qHotelNameVal) && !string.IsNullOrEmpty(qHotelNameType); if (isQuery) { icr = BaseZdBiz.CreateCriteria <HotelModel>(); } else { icr = BaseZdBiz.CreateCriteria <HotelModel>(this.getPager()); } icr.Add(Restrictions.And(Restrictions.Eq("isreserve", isreserve), Restrictions.Eq("status", status))); if (isQuery) { //带条件查询使用集合切割策略进行分页 if (qHotelNameType == "cn") { icr.Add(Restrictions.Like("hotelName", "%" + qHotelNameVal + "%")); } else if (qHotelNameType == "en") { icr.Add((Restrictions.Like("hotelNameEn", "%" + qHotelNameVal + "%"))); } else { return(DatagridObject.NewIntanst()); } //icr.Add(Restrictions.Eq("isreserve", status)); new HotelModel().setOrderBy(ref icr); listHotel = icr.List <HotelModel>(); PageList <HotelModel> pagerList = new PageList <HotelModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <HotelModel>(pagerList); } else { //不带条件查询使用分页缓存进行分页 new HotelModel().setOrderBy(ref icr); listHotel = icr.List <HotelModel>(); AdminBiz adminBiz = AdminBiz.GetInstant(); TableCountModel tableCount = adminBiz.getTableCount(); int total = 0; if (isreserve == HotelModel.RESERVE_OK) { total = tableCount.hotelOk; } else if (isreserve == HotelModel.RESERVE_CLOSED) { total = tableCount.hotelClosed; } else if (isreserve == HotelModel.RESERVE_DELETED) { total = tableCount.hotelDel; } datagrid = DatagridObject.ToDatagridObject <HotelModel>(listHotel, total); } return(datagrid); }