private bool ModifyClient() { bool ret = false; InsertModifyClientDialog dialog = new InsertModifyClientDialog() { DialogType = InsertModifyClientControlType.Modify }; dialog.ServerSecure = ServerSecure; dialog.ValidateClientData += new EventHandler <ClientInformationEventArgs>(dialog_Validate); dialog.Permissions = Permissions; string aeTitle = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); if (_clientInformationList.ClientDictionary.ContainsKey(aeTitle)) { ClientInformation ciTemp = new ClientInformation(_clientInformationList.ClientDictionary[aeTitle]); dialog.ClientInformation = ciTemp; if (DialogResult.OK == dialog.ShowDialog()) { _clientInformationList.ClientDictionary.Remove(aeTitle); _clientInformationList.ClientDictionary.Add(ciTemp.Client.AETitle, ciTemp); UpdateSelectedRow(dialog.ClientInformation); ret = true; } } return(ret); }
private bool InsertClient() { bool ret = false; InsertModifyClientDialog dialog = new InsertModifyClientDialog() { DialogType = InsertModifyClientControlType.Insert }; dialog.ServerSecure = ServerSecure; dialog.Permissions = Permissions; List <string> permissionList = new List <string>(); foreach (Permission p in NewClientPermissions) { permissionList.Add(p.Name); } dialog.ClientInformation = new ClientInformation(null, permissionList.ToArray()); dialog.ValidateClientData += new EventHandler <ClientInformationEventArgs>(dialog_Validate); if (DialogResult.OK == dialog.ShowDialog()) { AddRow(dialog.ClientInformation); _clientInformationList.ClientDictionary.Add(dialog.ClientInformation.Client.AETitle, dialog.ClientInformation); ret = true; } return(ret); }