private void btnSave_Click(object sender, RoutedEventArgs e) { if (_messagetitle.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入信息标题!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_messagecontent.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入信息内容!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } bool i = operationService.AddMessage(_messagetitle.Text, _messagecontent.Text, PubClass.userInfo.ID, DateTime.Now); if (i) { Toolkit.MessageBox.Show("信息发布成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); message.refresh(); this.Close(); return; } else { Toolkit.MessageBox.Show("信息发布失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } }