//绑定数据 private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryIntValue("page", 1); this.txtKeywords.Text = Utils.Htmls(this.keywords); this.ddlClassID.SelectedValue = this.class_id.ToString(); DataTable dt = new BLL.plugin_images().GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount).Tables[0]; dt.Columns.Add("class_title", Type.GetType("System.String")); if (dt.Rows.Count > 0) { int cid = 0; Model.plugin_images_class cmodel; BLL.plugin_images_class bll = new BLL.plugin_images_class(); for (int i = 0; i < dt.Rows.Count; i++) { cid = int.Parse(dt.Rows[i]["class_id"].ToString()); cmodel = bll.GetModel(cid); if (null != cmodel) { dt.Rows[i]["class_title"] = cmodel.title; } } } this.rptList.DataSource = dt; this.rptList.DataBind(); //绑定页码 this.txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("images_list.aspx", "keywords={0}&class_id={1}&page={2}", keywords, this.class_id.ToString(), "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void Page_Load(object sender, EventArgs e) { this.keywords = DTRequest.GetQueryString("keywords", true); this.id = DTRequest.GetQueryIntValue("id", 0); this.page = DTRequest.GetQueryIntValue("page", 1); this.pageSize = GetPageSize(10); //每页数量 if (!Page.IsPostBack) { //读取用户 DTcms.Model.manager model = GetAdminInfo(); //检查权限 ChkAdminLevel("plugin_lable", DTEnums.ActionEnum.Show.ToString()); //绑定数据 BLL.plugin_lable bll = new BLL.plugin_lable(); DataSet _list = bll.GetList(pageSize, page, CombSqlTxt(this.keywords), "sort_id asc,id asc", out totalCount); this.rptList.DataSource = _list; this.rptList.DataBind(); //插入关键词 this.txtKeywords.Text = Utils.Htmls(this.keywords); //绑定页码 this.txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&page={1}", keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); } }
/// <summary> /// 读取文件列表 /// </summary> /// <param name="listPath"></param> /// <param name="allow">类型 0图片,1文件</param> private void ListFileManager(HttpContext context, string listPath, int allow) { int Start = DTRequest.GetQueryIntValue("start", 0); int Size = DTRequest.GetQueryIntValue("size", 20); int Total = 0; DTEnums.ResultState State = DTEnums.ResultState.Success; String PathToList = siteConfig.webpath + siteConfig.filepath; String[] FileList = null; String[] SearchExtensions; if (allow > 0) { //文件 SearchExtensions = Utils.MergerArray(siteConfig.fileextension.Split(','), siteConfig.videoextension.Split(',')); } else { //图片 SearchExtensions = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" }; } var buildingList = new List <String>(); try { var localPath = Utils.GetMapPath(PathToList); buildingList.AddRange(Directory.GetFiles(localPath, "*", SearchOption.AllDirectories) .Where(x => SearchExtensions.Contains(Path.GetExtension(x).ToLower())) .Select(x => PathToList + x.Substring(localPath.Length).Replace("\\", "/"))); Total = buildingList.Count; FileList = buildingList.OrderBy(x => x).Skip(Start).Take(Size).ToArray(); } catch (UnauthorizedAccessException) { State = DTEnums.ResultState.AuthorizError; } catch (DirectoryNotFoundException) { State = DTEnums.ResultState.PathNotFound; } catch (IOException) { State = DTEnums.ResultState.IOError; } finally { JsonHelper.WriteJson(context, new { state = Utils.GetStateString(State), list = FileList == null ? null : FileList.Select(x => new { url = x }), start = Start, size = Size, total = Total }); } }
//绑定数据 private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryIntValue("page", 1); this.txtKeywords.Text = Utils.Htmls(this.keywords); BLL.plugin_images_class bll = new BLL.plugin_images_class(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 this.txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("class_list.aspx", "keywords={0}&page={1}", keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
protected void Page_Load(object sender, EventArgs e) { teacher_id = DTRequest.GetQueryIntValue("teacher_id"); if (teacher_id == 0) { JscriptMsg("传输参数不正确!", "back"); return; } if (!new BLL.teacher().Exists(teacher_id)) { JscriptMsg("订单不存在或已被删除!", "back"); return; } if (!Page.IsPostBack) { ShowInfo(teacher_id); } }
protected void Page_Load(object sender, EventArgs e) { Model.manager model = GetAdminInfo(); //取得当前管理员信息 int type = DTRequest.GetQueryIntValue("type", 1); string id = DTRequest.GetQueryString("id"); ChkAdminLevel("deviceloginfo", DTEnums.ActionEnum.Edit.ToString()); //检查权限 var h = new Model.dt_device_h { id = id }.Get(type); if (h == null) { JscriptMsg("记录不存在或已被删除!", "back"); return; } ShowInfo(h); }