Esempio n. 1
0
        private bool DoEdit(int _id)
        {
            BLL.plugin_menu   bll   = new BLL.plugin_menu();
            Model.plugin_menu model = bll.GetModel(_id);

            model.title    = txtName.Text;
            model.link_url = txtUrl.Text;
            int parentId = int.Parse(ddlParentId.SelectedValue);

            if (parentId != model.id)
            {
                model.parent_id = parentId;
            }
            model.target  = rblMode.SelectedValue;
            model.is_lock = int.Parse(rblHide.SelectedValue);
            model.sort_id = Utils.StrToInt(txtSort.Text, 99);
            model.css_txt = txtCssTxt.Text;
            model.img_url = txtImgUrl.Text.Trim();

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改菜单内容:" + model.title); //记录日志
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
 private void ShowInfo(int _id)
 {
     BLL.plugin_menu   bll   = new BLL.plugin_menu();
     Model.plugin_menu model = bll.GetModel(_id);
     txtName.Text = model.title;
     txtUrl.Text  = model.link_url;
     ddlParentId.SelectedValue = model.parent_id.ToString();
     txtSort.Text          = model.sort_id.ToString();
     rblHide.SelectedValue = model.is_lock.ToString();
     rblMode.SelectedValue = model.target;
     txtCssTxt.Text        = model.css_txt;
     txtImgUrl.Text        = model.img_url;
     if (!string.IsNullOrEmpty(model.img_url))
     {
         ImgDiv.Visible  = true;
         ImgUrl.ImageUrl = model.img_url;
     }
 }