private void ShowInfo(int _id) { BLL.lable bll = new BLL.lable(); Model.lable model = bll.GetModel(_id); txtTitle.Text = model.title; txtName.Text = model.call_index; txtName.Attributes.Add("ajaxurl", "../tools/ajax.ashx?action=validate&old_name=" + Utils.UrlEncode(model.call_index)); txtName.Focus(); //设置焦点,防止JS无法提交 txtSort.Text = model.sort_id.ToString(); rblHide.SelectedValue = model.is_lock.ToString(); ddlType.SelectedValue = model.type.ToString(); txtContent.Value = model.content; contentType = model.type; }
private bool DoEdit(int _id) { BLL.lable bll = new BLL.lable(); Model.lable model = bll.GetModel(_id); model.title = txtTitle.Text; model.call_index = txtName.Text; model.is_lock = int.Parse(rblHide.SelectedValue); model.sort_id = int.Parse(txtSort.Text); model.type = int.Parse(ddlType.SelectedValue); model.content = txtContent.Value; if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改标签内容:" + model.title); //记录日志 return(true); } return(false); }