| | |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | dataSource = new ObservableCollection<DrawAudit>(datas); |
| | | |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | Result<List<DrawAudit>> res = Client.GetSyncAction<List<DrawAudit>>("drawAudit/listWithTask"); |
| | | string statusArr = string.Empty; |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | List<string> arr = new List<string>(); |
| | | if (subcb.IsChecked == true) arr.Add("submitted"); |
| | | if (resubcb.IsChecked == true) arr.Add("resubmitted"); |
| | | if (comcb.IsChecked == true) arr.Add("completed"); |
| | | if (rejcb.IsChecked == true) arr.Add("rejected"); |
| | | if (arr.Count > 0) |
| | | { |
| | | statusArr = $"'{string.Join("','", arr)}'"; |
| | | } |
| | | }); |
| | | Result<List<DrawAudit>> res = Client.GetSyncAction<List<DrawAudit>>("drawAudit/listWithTask2", new DrawAudit |
| | | { |
| | | statusArr = statusArr |
| | | }); |
| | | return res.HandleResult(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 单条数据撤销按钮点击事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void Reset_Click(object sender, RoutedEventArgs e) |
| | | { |
| | | Button btn = sender as Button; |
| | | DrawAudit da = btn.DataContext as DrawAudit; |
| | | if (da.status == "submitted" && da.status == "resubmitted") |
| | | { |
| | | this.Warning("请选择审核过的数据"); |
| | | return; |
| | | } |
| | | MessageBoxResult mr = MessageBox.Show($"确定撤销物料【{da.materialCode}】的图纸审批吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question); |
| | | if (mr == MessageBoxResult.OK) |
| | | { |
| | | MaskAdorner.ShowMask(content, "请求中,请稍候..."); |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | Result<object> res = Client.PostSyncAction<object>(da, "drawAudit/reset"); |
| | | object obj = res.HandleResult(); |
| | | // CloseAuditedDoc(da); |
| | | Dispatcher.Invoke(() => |
| | | { |
| | | dataSource = new ObservableCollection<DrawAudit>(RefreshList()); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Error($"V{PdmUser.LoginUser.pluginVersion}, Draw Reset failed.", ex); |
| | | this.Error($"V{PdmUser.LoginUser.pluginVersion},撤销失败!{ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | MaskAdorner.HideMask(content); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 单条数据驳回按钮点击事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | |
| | | |
| | | public void OnSwActiveDocChange(ModelDoc2 oldDoc, ModelDoc2 newDoc, Component2 comp) |
| | | { |
| | | var fileName = new Uri(newDoc.GetPathName()); |
| | | string path = newDoc.GetPathName(); |
| | | Uri fileName; |
| | | if (string.IsNullOrEmpty(path)) |
| | | { |
| | | fileName = null; |
| | | } |
| | | else |
| | | { |
| | | fileName = new Uri(newDoc.GetPathName()); |
| | | } |
| | | foreach (var e in dataSource) |
| | | { |
| | | var d2Path = new Uri(GetRealFilePath(e.d2RelativePath)); |
| | |
| | | |
| | | public void OnSwActiveDocSaved(ModelDoc2 doc, Component2 comp) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | public void OnCustomPropertyChange(string propName, string Configuration, string oldValue, string NewValue, int valueType) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | public void OnDocDestroy(ModelDoc2 doc) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | public void AfterDocDestroy() |
| | | { |
| | | |
| | | |
| | | } |
| | | } |
| | | } |