private void BtnEdit_Click(object sender, RoutedEventArgs e) { var statusresult = AppSession.Dal.GetCommonModelByConditionWithZero <PipeOrder>($"where status ={StationCacheStatus.已经套料.GetIndexInt()}").Data; if (DGMain.SelectedItem == null) { MessageBox.Show("请先选中一条数据!"); } if (DGMain.SelectedItems.Count > 1) { MessageBox.Show("每次只能选择一条"); return; } else { PipeOrder temp = (PipeOrder)DGMain.SelectedItem; foreach (var statusid in statusresult) { if (statusid.Id == temp.Id) { MessageBox.Show($"选中的工单ID为:{ temp.Id}的状态有已经套料过的工单!请重选"); return; } } WinOrderAddOrEdit win = new WinOrderAddOrEdit(temp.Id); win.ShowDialog(); Query(); } }
private void BtnAdd_Click(object sender, RoutedEventArgs e) { WinOrderAddOrEdit win = new WinOrderAddOrEdit(null); win.ShowDialog(); Query(); }