Пример #1
0
 private void ShowInfo(int _id)
 {
     BLL.plugin_menu_class   bll   = new BLL.plugin_menu_class();
     Model.plugin_menu_class model = bll.GetModel(_id);
     txtTitle.Text         = model.title;
     txtColor.Text         = model.color;
     txtSort.Text          = model.sort_id.ToString();
     rblHide.SelectedValue = model.is_lock.ToString();
 }
Пример #2
0
        private bool DoEdit(int _id)
        {
            BLL.plugin_menu_class   bll   = new BLL.plugin_menu_class();
            Model.plugin_menu_class model = bll.GetModel(_id);

            model.title   = txtTitle.Text;
            model.color   = txtColor.Text;
            model.is_lock = Utils.StrToInt(rblHide.SelectedValue, 0);
            model.sort_id = Utils.StrToInt(txtSort.Text.Trim(), 99);

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改菜单类别内容:" + model.title);
                return(true);
            }
            return(false);
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.class_id = DTRequest.GetQueryInt("class_id", 1);
            this.keywords = DTRequest.GetQueryString("keywords");

            if (!Page.IsPostBack)
            {
                //检查权限
                ChkAdminLevel("plugin_menu_list", DTEnums.ActionEnum.Show.ToString());

                //绑定类别
                TreeBind();

                //绑定数据
                DataTable dt = new BLL.plugin_menu().GetList(0, 0, CombSqlTxt(this.keywords, this.class_id), "sort_id asc,id asc");
                dt.Columns.Add("class_title", Type.GetType("System.String"));
                dt.Columns.Add("class_color", Type.GetType("System.String"));
                if (dt.Rows.Count > 0)
                {
                    int cid = 0;
                    Model.plugin_menu_class cmodel;
                    BLL.plugin_menu_class   bll = new BLL.plugin_menu_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;
                            dt.Rows[i]["class_color"] = cmodel.color;
                        }
                    }
                }
                this.rptList.DataSource = dt;
                this.rptList.DataBind();

                this.ddlClass.SelectedValue = this.class_id.ToString();
                this.txtKeywords.Text       = Utils.Htmls(this.keywords);
            }
        }