public static bool IsDebug() { //string debug = System.Configuration.ConfigurationManager.AppSettings["ZDSL.Webapp.debug"]; AdminBiz adminBiz = AdminBiz.GetInstant(); return(AdminBiz.GetCurrConfig().staticInd != BaseModel.IND_Y); }
public ActionResult DoLogin(string id, string pwd) { AdminBiz admin = AdminBiz.GetInstant(); JsResultObject re = admin.login(id, pwd); return(JsonText(re, JsonRequestBehavior.AllowGet)); }
public ActionResult CacheHelper() { AdminBiz adminBiz = AdminBiz.GetInstant(); TableCountModel tableCount = adminBiz.getTableCount(); ViewData[typeof(TableCountModel).Name] = tableCount; return(View()); }
public ActionResult ComboTree(string parentId) { AdminBiz adminBiz = AdminBiz.GetInstant(); ICriteria icr = BaseZdBiz.CreateCriteria<MenuModel>(); 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); }
protected void Page_Load(object sender, EventArgs e) { string path = Server.MapPath(""); DataBiz dataBiz = DataBiz.GetInstant(); //dataBiz.ImportBrandList(); AdminBiz adminBiz = AdminBiz.GetInstant(); if (!adminBiz.isAuthority()) { Response.Redirect(WebUtil.GetWebRootPath() + "/Admin/System/Login"); } CacheBiz cacheBiz = CacheBiz.GetInstant(path); cacheBiz.reflashDictCache(); cacheBiz.reflashGeoCache(); //cacheBiz.reflashRoleCache(); //cacheBiz.reflashHotelCache(); System.Configuration.ConfigurationManager.AppSettings["ZDSL.Biz.auto.order"] = "Y"; }
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 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); }