protected void btnSave_ServerClick(object sender, EventArgs e) { try { int menuID = CurrentSelectMenuID; SystemMenu systemMenu = systemMenuServiceInstance.FindById(menuID); if (systemMenu != null) { systemMenu.MenuName = this.txtMenuName.Text.Trim(); systemMenu.MenuDescription = this.txtMenuDescription.Value.Trim(); systemMenu.MenuUrl = this.txtMenuUrl.Text.Trim(); systemMenuServiceInstance.Update(systemMenu); if (systemMenu.ParentMenuID == null) { BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, "0"); } else { BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, menuID.ToString()); } this.lblMessage.Text = "更新菜单成功!"; } else { BindManageMenuTreeByApplicationIDAndSelectNodeID(this.ddlSelectApplication.SelectedValue, "0"); } } catch (Exception ex) { this.lblMessage.Text = "系统错误:" + ex.Message; this.btnSave.Disabled = true; } }
public ActionResult EditMenu(SystemMenu entity) { var result = ResModelFactory.ResDefault(); try { SystemMenuService service = new SystemMenuService(); SystemMenu model = service.GetEntitys(p => p.ID == entity.ID).FirstOrDefault(); model.MenuName = entity.MenuName; model.LinkUrl = entity.LinkUrl; model.ParentID = entity.ParentID; model.Icon = entity.Icon; model.IsShow = entity.IsShow; model.ModifyUserId = CurrentUser.Id; model.NodifyDate = DateTime.Now; var user = service.Update(model); } catch (Exception ex) { result = ResModelFactory.ResError(ex.Message); } return(Json(result)); }
protected override void UpdateData(SystemMenu obj) { systemMenuServiceInstance.Update(obj); }