/// <summary> /// 点击"公司"-"添加" /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AddPeopleButton_Click(object sender, RoutedEventArgs e) { EditPeople newPeople = new EditPeople(); bool? result = newPeople.ShowDialog(); if (result == true) { // 点击"确定"后添加人员到数据库并刷新listview company.AddPeople(newPeople.PeopleNameTextBox.Text); this.CompanyPeopleListView.Items.Refresh(); } }
/// <summary> /// 点击"公司"-"编辑" /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditPeopleButton_Click(object sender, RoutedEventArgs e) { string oldName = this.CompanyPeopleListView.SelectedValue.ToString(); EditPeople editPeople = new EditPeople(oldName); bool? result = editPeople.ShowDialog(); if (result == true) { // 点击"确定"后编辑人员到数据库并刷新listview company.EditPeople(oldName, editPeople.PeopleNameTextBox.Text); this.CompanyPeopleListView.Items.Refresh(); } }