public ActionResult Datagrid(string orderId, string orderStatus) { DatagridObject datagrid = null; ICriteria icr; IList <OrderModel> listHotel; if (ObjectUtil.IsAllNullOrEmpty(new string[] { orderId, orderStatus }) == ObjectUtil.RESULT_ALL_NULL) { icr = BaseZdBiz.CreateCriteria <OrderModel>(this.getPager()); listHotel = icr.List <OrderModel>(); int count = BaseZdBiz.CountDistinct(icr, "id"); datagrid = DatagridObject.ToDatagridObject(listHotel, count); } else { icr = BaseZdBiz.CreateCriteria <OrderModel>(); if (!string.IsNullOrEmpty(orderStatus)) { icr.Add(Restrictions.Eq("orderStatus", orderStatus)); } if (!string.IsNullOrEmpty(orderId)) { icr.Add(Restrictions.Eq("id", Convert.ToInt32(orderId))); } listHotel = icr.List <OrderModel>(); PageList <OrderModel> pagerList = new PageList <OrderModel>(listHotel, this.getPager()); datagrid = DatagridObject.ToDatagridObject <OrderModel>(pagerList); } return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
private DatagridObject createLocationDatagrid <T>(string geoFk) where T : GeoLocationModel { bool isQuery = !string.IsNullOrEmpty(geoFk); ICriteria icr = null; DatagridObject datagrid = null; if (isQuery) { icr = BaseZdBiz.CreateCriteria <T>(); } else { icr = BaseZdBiz.CreateCriteria <T>(this.getPager()); } if (isQuery) { icr.Add(Restrictions.Eq("geoFk", geoFk)); IList <T> list = icr.List <T>(); PageList <T> pagerList = new PageList <T>(list, this.getPager()); datagrid = DatagridObject.ToDatagridObject <T>(pagerList); } else { IList <T> list = icr.List <T>(); datagrid = DatagridObject.ToDatagridObject <T>(list, 3000); } return(datagrid); }
public bool reflashRoleCache() { bool isSuccess = false; ICriteria icr = CreateCriteria <RoleModel>(); //icr.Add(Restrictions.Eq("isreserve", HotelModel.RESERVE_OK)); IList list = icr.List(); DatagridObject datagrid = DatagridObject.ToDatagridObject(list); JSONObjectCollection json = datagrid.toJSONObjectCollection(); StringBuilder sbr = new StringBuilder(""); sbr .Append("Class.forName(\"Toyz4js.cache\"); \n\n") .Append("Toyz4js[\"cache\"][\"RoleModel\"]=").Append(json.ToString()).Append("; \n\n \n\n"); ; try { FileUtil.WriteFile(this.pathRoleCache, sbr.ToString()); } catch (Exception ex) { isSuccess = false; } return(isSuccess); }
public bool reflashBrandCache() { bool isSucess = false; JSONObjectCollection jsonCraph = new JSONObjectCollection(); StringBuilder sbr = new StringBuilder(""); sbr .Append("Class.forName(\"Toyz4js.cache\"); \n\n"); JSONObjectCollection jsonBrand = new JSONObjectCollection(); IList <BrandModel> brands = CreateCriteria <BrandModel>().List <BrandModel>(); sbr .Append("Toyz4js[\"cache\"][\"BrandModel\"][\"brands\"]=") .Append(DatagridObject.ToDatagridObject <BrandModel>(brands).toJSONObjectCollection().ToString()) .Append("\n\n") ; isSucess = FileUtil.WriteFile(pathBrandCache, sbr.ToString()); return(isSucess); }
public DatagridObject createDatagridRecommend() { ICriteria icr = BaseZdBiz.CreateCriteria <HotelRecommendModel>(); IList <HotelRecommendModel> list = icr.List <HotelRecommendModel>(); PageList <HotelRecommendModel> pagerList = new PageList <HotelRecommendModel>(list, this.getPager()); DatagridObject datagrid = DatagridObject.ToDatagridObject <HotelRecommendModel>(pagerList); return(datagrid); }
protected DatagridObject createDatagrid() { ICriteria icr = BaseZdBiz.CreateCriteria <RoleModel>(); IList <RoleModel> list = icr.List <RoleModel>(); PageList <RoleModel> pageList = new PageList <RoleModel>(list, this.getPager()); DatagridObject datagrid = DatagridObject.ToDatagridObject <RoleModel>(pageList); return(datagrid); }
public ActionResult DatagridMemberRewardLog() { ICriteria icr = BaseZdBiz.CreateCriteria <MemberRewardLogModel>(); icr.AddOrder(Order.Desc("createDate")); IList <MemberRewardLogModel> list = icr.List <MemberRewardLogModel>(); DatagridObject datagrid = DatagridObject.ToDatagridObject <MemberRewardLogModel>(list); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public ActionResult DatagridAdSider() { DatagridObject datagrid = null; ICriteria icr = BaseZdBiz.CreateCriteria <AdSiderModel>(); IList <AdSiderModel> hotBrands = icr.List <AdSiderModel>(); PageList <AdSiderModel> pagerList = new PageList <AdSiderModel>(hotBrands, this.getPager()); datagrid = DatagridObject.ToDatagridObject <AdSiderModel>(pagerList); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public DatagridObject createDatagridHotelSubDetail <T>(string hotelFk) { ICriteria icr = BaseZdBiz.CreateCriteria <T>(); icr.Add(Restrictions.Eq("hotelFk", hotelFk)); IList <T> list = icr.List <T>(); PageList <T> pagerList = new PageList <T>(list, this.getPager()); DatagridObject datagrid = DatagridObject.ToDatagridObject <T>(pagerList); return(datagrid); }
public ActionResult DatagridMemberAccount(string memberId) { ICriteria icr = BaseZdBiz.CreateCriteria <MemberAccountModel>(); icr.Add(Restrictions.Eq("memberFk", memberId)); icr.AddOrder(Order.Desc("createDate")); IList <MemberAccountModel> accounts = icr.List <MemberAccountModel>(); DatagridObject datagrid = DatagridObject.ToDatagridObject <MemberAccountModel>(accounts); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
private DatagridObject createDatagridMemberCommentReward(string status) { ICriteria icr = BaseZdBiz.CreateCriteria <MemberRewardModel>(); icr.Add(Restrictions.Eq("status", status)); IList <MemberRewardModel> list = icr.List <MemberRewardModel>(); PageList <MemberRewardModel> pagerList = new PageList <MemberRewardModel>(list, this.getPager()); DatagridObject datagrid = DatagridObject.ToDatagridObject <MemberRewardModel>(pagerList); return(datagrid); }
public ActionResult DatagridGuest(string ids) { string[] arrayId = ObjectUtil.Parse(ids, "").Split(','); ICriteria icr = BaseZdBiz.CreateCriteria <GuestModel>(); icr.Add(Restrictions.In("idNumber", arrayId)); IList <GuestModel> guests = icr.List <GuestModel>(); DatagridObject datagrid = DatagridObject.ToDatagridObject <GuestModel>(guests); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public ActionResult DatagridOuterLink() { DatagridObject datagrid = null; ICriteria icr = BaseZdBiz.CreateCriteria <OuterLinkModel>(); icr.AddOrder(Order.Desc("recLevel")); IList <OuterLinkModel> hotBrands = icr.List <OuterLinkModel>(); PageList <OuterLinkModel> pagerList = new PageList <OuterLinkModel>(hotBrands, this.getPager()); datagrid = DatagridObject.ToDatagridObject <OuterLinkModel>(pagerList); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public ActionResult DatagridHotel(string qvHotelName) { ICriteria icr = BaseZdBiz.CreateCriteria <HotelModel>(); icr.Add(Restrictions.Or(Restrictions.Like("hotelName", "%" + qvHotelName + "%"), Restrictions.Like("hotelNameEn", "%" + qvHotelName + "%") )); IList <HotelModel> hotels = icr.List <HotelModel>(); DatagridObject datagrid = DatagridObject.ToDatagridObject <HotelModel>(hotels); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
public ActionResult DatagridHotelOrder() { ELongApiBiz elongBiz = ELongApiBiz.GetInstant(); GetHotelOrderCondition condition = new GetHotelOrderCondition(); HotelOrderPartialForGetHotelOrderList[] hotelArray = elongBiz.queryHotelOrderList(condition); IList <HotelOrderPartialForGetHotelOrderList> hotelList = hotelArray.ToList(); PageList <HotelOrderPartialForGetHotelOrderList> hotelPageList = new PageList <HotelOrderPartialForGetHotelOrderList>(hotelList, this.getPager()); DatagridObject datagrid = DatagridObject.ToDatagridObject(hotelPageList); return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
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); }
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); }
public bool reflashDictCache() { bool isSuccess = false; JSONObjectCollection jsonGraph = new JSONObjectCollection(); JSONObjectCollection jarr = new JSONObjectCollection(); ICriteria icr = CreateCriteria <DictTypeModel>(); IList <DictTypeModel> dictTypes = icr.List <DictTypeModel>(); icr = CreateCriteria <DictModel>(); IList <DictModel> dicts = icr.List <DictModel>(); foreach (DictTypeModel dictType in dictTypes) { IList <DictModel> tempDicts = new List <DictModel>(); foreach (DictModel dict in dicts) { if (dict.type != dictType.id) { continue; } tempDicts.Add(dict); } jsonGraph.Add(new JSONStringValue(dictType.id), DatagridObject.ToDatagridObject <DictModel>(tempDicts).toJSONObjectCollection()); } StringBuilder sbr = new StringBuilder(""); sbr .Append("Class.forName(\"Toyz4js.cache\"); \n\n") .Append("Toyz4js[\"cache\"][\"DictModel\"]=").Append(jsonGraph.ToString()).Append("; \n\n \n\n") .Append("Toyz4js[\"cache\"][\"DictTypeModel\"]=").Append(DatagridObject.ToDatagridObject <DictTypeModel>(dictTypes).toJSONObjectCollection()).Append("; \n\n \n\n") ; try { FileUtil.WriteFile(this.pathDictCache, sbr.ToString()); } catch (Exception ex) { isSuccess = false; } return(isSuccess); }
public ActionResult DatagridHotelDetailSubInfo(string modelType, string hotelFk) { DatagridObject datagrid = null; if (modelType == "HotelRoom") { datagrid = createDatagridHotelSubDetail <HotelRoomModel>(hotelFk); } else if (modelType == "HotelImage") { datagrid = createDatagridHotelSubDetail <HotelImageModel>(hotelFk); } else if (modelType == "HotelTrafficInfo") { datagrid = createDatagridHotelSubDetail <HotelTrafficInfoModel>(hotelFk); } else if (modelType == "HotelSurroundingCommerce") { datagrid = createDatagridHotelSubDetail <HotelSurroundingCommerceModel>(hotelFk); } else if (modelType == "HotelSurroundingRestaurant") { datagrid = createDatagridHotelSubDetail <HotelSurroundingRestaurantModel>(hotelFk); } else if (modelType == "HotelSurroundingAttraction") { datagrid = createDatagridHotelSubDetail <HotelSurroundingAttractionModel>(hotelFk); } else if (modelType == "HotelSurroundingShop") { datagrid = createDatagridHotelSubDetail <HotelSurroundingShopModel>(hotelFk); } else if (modelType == "HotelLandMark") { datagrid = createDatagridHotelSubDetail <HotelLandMarkModel>(hotelFk); } else { datagrid = DatagridObject.ToDatagridObject(new ArrayList()); } return(JsonText(datagrid, JsonRequestBehavior.AllowGet)); }
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 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 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); }
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 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); }
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); }