/// <summary> /// 保存设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(txtNo.Text.Trim()) && !string.IsNullOrEmpty(txtName.Text.Trim())) { if (IsEdit) { if (Campus.UpdateCampus()) { MessageBox.Show("校区更新成功!"); this.Close(); } } else { if (Campus.AddCampus()) { MessageBox.Show("校区添加成功!"); this.Close(); } } } else { MessageBox.Show("校区编号和名称不能为空!"); } }