/// <summary> /// 添加角色 /// </summary> /// <returns>主键</returns> public string Add() { string returnValue = string.Empty; //FrmRoleAdd frmRoleAdd = new FrmRoleAdd(this.cmbRoleCategory.SelectedValue.ToString()); //if (frmRoleAdd.ShowDialog(this) == DialogResult.OK || frmRoleAdd.Changed) //{ FrmRoleWithUser frmRoleWithUser = new FrmRoleWithUser(this.cmbRoleCategory.SelectedValue.ToString()); frmRoleWithUser.OnAdded += new FrmRoleWithUser.OnAddedEventHandler(this.OnAdded); if (frmRoleWithUser.ShowDialog(this) == DialogResult.OK || frmRoleWithUser.Changed) { // 获得角色列表 this.GetList(); // 设置数据过滤 this.SetRowFilter(); // 设置按钮状态 this.SetControlState(); } return(returnValue); }
/// <summary> /// 添加角色 /// </summary> /// <returns>主键</returns> public string Add() { string returnValue = string.Empty; //string assemblyName = "DotNet.WinForm"; //string formName = "FrmRoleAdd"; //Type assemblyType = CacheManager.Instance.GetType(assemblyName, formName); //BaseForm frmRoleAdd = (BaseForm)Activator.CreateInstance(assemblyType, this.cmbRoleCategory.SelectedValue.ToString()); FrmRoleWithUser frmRoleWithUser = new FrmRoleWithUser(this.cmbRoleCategory.SelectedValue.ToString()); frmRoleWithUser.OnAdded += new FrmRoleWithUser.OnAddedEventHandler(this.OnAdded); if (frmRoleWithUser.ShowDialog(this) == DialogResult.OK || frmRoleWithUser.Changed) { // 获得角色列表 this.GetList(); // 设置数据过滤 this.SetRowFilter(); // 设置按钮状态 this.SetControlState(); } return(returnValue); }