/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Del_Click(object sender, RoutedEventArgs e) { var item = dbTypeLink.SelectedItem as Data_Source; if (item != null) { if (FastRead.Query <Data_Business_Details>(a => a.DataSourceId == item.Id).ToCount() == 0) { FastWrite.Delete <Data_Source>(a => a.LinkName == item.LinkName); AppCache.RemoveLink(); dbTypeLink.ItemsSource = AppCache.GetAllLink; InitLinkInfo(); CodeBox.Show("删除成功", this); } else { InitLinkInfo(); CodeBox.Show("删除失败数据源在使用中", this); } } }