/// <summary> /// 移除管理员 /// </summary> /// <param name="import">数据集</param> /// <returns>返回操作结果</returns> public NormalResult RemoveAdministrator(RemoveAdministratorImport import) { try { import.CheckAllowExecuteOrNot(db); new AdministratorManager(db).Remove(import); return new NormalResult(); } catch (Exception ex) { return new NormalResult(ex.Message); } }
void Remove_do(object sender, EventArgs e) { NormalPrompt np = (NormalPrompt)sender; if (np.DialogResult != true) { return; } AdministratorExport aInfo = DataManager.GetValue<AdministratorExport>(DataKey.IWorld_Backstage_AdministratorInfo); RemoveAdministratorImport import = new RemoveAdministratorImport { Id = this.State.Id, Token = aInfo.Token }; AdministratorServiceClient client = new AdministratorServiceClient(); client.RemoveAdministratorCompleted += ShowRemoveResult; client.RemoveAdministratorAsync(import); }