private void ShowInfo(int _id) { ax_navigation model = new ax_navigation(); model.GetModel(_id); ddlParentId.SelectedValue = model.parent_id.ToString(); txtSortId.Text = model.sort_id.ToString(); if (model.status == 1) { cbIsLock.Checked = true; } txtTitle.Text = model.title; txtLinkUrl.Text = model.link_url; //赋值操作权限类型 string[] actionTypeArr = model.action_type.Split(','); for (int i = 0; i < cblActionType.Items.Count; i++) { for (int n = 0; n < actionTypeArr.Length; n++) { if (actionTypeArr[n].ToLower() == cblActionType.Items[i].Value.ToLower()) { cblActionType.Items[i].Selected = true; } } } }
// 单个删除 protected void lbtnDelCa_Click(object sender, EventArgs e) { //检查权限 if (ChkAdminLevel(this.Page, 50, "Delete")) { // 当前点击的按钮 LinkButton lb = (LinkButton)sender; int caId = int.Parse(lb.CommandArgument); ax_navigation bll = new ax_navigation(); bll.GetModel(caId); string title = bll.title; bll.Delete(caId); AddAdminLog("删除", "删除导航:" + title + ""); //记录日志 JscriptMsg(this.Page, " 删除成功", "nav_list.aspx", "Success"); } }
private bool DoEdit(int _id) { try { ax_navigation model = new ax_navigation(); model.GetModel(_id); model.title = txtTitle.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.status = 0; if (cbIsLock.Checked == true) { model.status = 1; } int parentId = int.Parse(ddlParentId.SelectedValue); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } //添加操作权限类型 string action_type_str = string.Empty; for (int i = 0; i < cblActionType.Items.Count; i++) { if (cblActionType.Items[i].Selected && Utils.ActionType().ContainsKey(cblActionType.Items[i].Value)) { action_type_str += cblActionType.Items[i].Value + ","; } } model.action_type = Utils.DelLastComma(action_type_str); if (model.Update()) { AddAdminLog("修改", "修改导航信息:" + model.title); //记录日志 return(true); } } catch { return(false); } return(false); }