private void tsmiEdit_Click(object sender, EventArgs e) { DlgEditRole dlg = new DlgEditRole(); dlg.Role = treeRole.FocusedNode.Tag as ORUP_ROLE; if (DialogResult.OK == dlg.ShowDialog()) { try { UserService.SaveRole(dlg.Role); RefreshRoleTree(); MainForm.INFO("编辑角色成功!"); } catch (Exception ex) { MainForm.ERROR("编辑角色失败!" + ex.Message); } } }
private void tsmiAdd_Click(object sender, EventArgs e) { ORUP_ROLE newRole = new ORUP_ROLE(); newRole.CREATETIME = DateTime.Now; DlgEditRole dlg = new DlgEditRole(); dlg.Role = newRole; if (DialogResult.OK == dlg.ShowDialog()) { try { UserService.SaveRole(dlg.Role); RefreshRoleTree(); MainForm.INFO("添加角色成功!"); } catch (Exception ex) { MainForm.ERROR("添加角色失败!" + ex.Message); } } }