//绑定数据 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); }
private void ShowInfo(int _id) { BLL.plugin_images_class bll = new BLL.plugin_images_class(); Model.plugin_images_class model = bll.GetModel(_id); txtName.Text = model.title; txtCallIndex.Text = model.call_index; txtNum.Text = model.num.ToString(); txtHeight.Text = model.height.ToString(); txtWidth.Text = model.width.ToString(); txtSort.Text = model.sort_id.ToString(); rblHide.SelectedValue = model.is_lock.ToString(); }
private bool DoEdit(int _id) { BLL.plugin_images_class bll = new BLL.plugin_images_class(); Model.plugin_images_class model = bll.GetModel(_id); model.title = txtName.Text.Trim(); model.call_index = txtCallIndex.Text.Trim(); model.num = Utils.StrToInt(txtNum.Text.Trim(), 10); model.width = Utils.StrToInt(txtWidth.Text.Trim(), 100); model.height = Utils.StrToInt(txtHeight.Text.Trim(), 100); model.is_lock = int.Parse(rblHide.SelectedValue); model.sort_id = Utils.StrToInt(txtSort.Text, 99); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改广告橱窗位信息" + model.title); //记录日志 return(true); } return(false); }