public void TaskEndedByCatchD(Task <Checkin_ltjyStack> task) { if (task.IsCompleted) { Checkin_ltjyStack TaskResult = task.Result; if (TaskResult.Status.Contains("成功")) { IEnumerator ienumerator = App.ListCheckin_ltjyStack.GetEnumerator(); int count = 0; while (ienumerator.MoveNext()) { if (((Checkin_ltjyStack)ienumerator.Current).CRIB == TaskResult.CRIB) { App.ListCheckin_ltjyStack[count].Status = TaskResult.Status; App.ListCheckin_ltjyStack[count].LISTPD_SIMPLE.ForEach(Ltjy => Ltjy.status = "同步成功"); ThreadDelegate TetBoxDel2 = delegate() { PackCountTxt_Copy.Content = Tools.GetSendStatus(true).ToString(); }; this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, TetBoxDel2); return; } count++; } } else { IEnumerator ienumerator = App.ListCheckin_ltjyStack.GetEnumerator(); int ecount = 0; while (ienumerator.MoveNext()) { Checkin_ltjyStack _Checkin_ltjyStack = (Checkin_ltjyStack)ienumerator.Current; if (_Checkin_ltjyStack != null) { if (_Checkin_ltjyStack.CRIB == TaskResult.CRIB) { ThreadDelegate TetBoxDel2 = delegate() { PackCountStackE.Content = Tools.GetSendStatus(false).ToString(); }; this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, TetBoxDel2); App.ListCheckin_ltjyStack[ecount].CRIB = TaskResult.CRIB; App.ListCheckin_ltjyStack[ecount].Status = TaskResult.Status; App.ListCheckin_ltjyStack[ecount].LISTPD_SIMPLE.Clear(); App.ListCheckin_ltjyStack[ecount].LISTPD_SIMPLE.AddRange(TaskResult.LISTPD_SIMPLE); return; } } ecount++; } } Tools.Serialize(App.ListCheckin_ltjyStack); } }
public static bool VerifyDataD(this ObservableCollection <Checkin_ltjyStack> ListCheckin_ltjyStack, string _code) { Checkin_ltjyStack _Checkin_ltjyStack = ListCheckin_ltjyStack.Where(F => F.CRIB == _code).First(); if (_Checkin_ltjyStack != null) { return(true); } else { return(false); } }
public void TaskEndedByCatchD(Task <Checkin_ltjyStack> task) { if (task.IsCompleted) { Checkin_ltjyStack TaskResult = task.Result; if (TaskResult.Status.Contains("网络超时")) { return; } if (TaskResult.Status.Contains("成功")) { IEnumerator ienumerator = App.ListCheckin_ltjyStack.GetEnumerator(); int count = 0; while (ienumerator.MoveNext()) { if (((Checkin_ltjyStack)ienumerator.Current).CRIB == TaskResult.CRIB) { App.ListCheckin_ltjyStack[count].Status = TaskResult.Status; App.ListCheckin_ltjyStack[count].LISTPD_SIMPLE.ForEach(Ltjy => Ltjy.status = "同步成功"); return; } count++; } } else { IEnumerator ienumerator = App.ListCheckin_ltjyStack.GetEnumerator(); int ecount = 0; while (ienumerator.MoveNext()) { Checkin_ltjyStack _Checkin_ltjyStack = (Checkin_ltjyStack)ienumerator.Current; if (_Checkin_ltjyStack != null) { if (_Checkin_ltjyStack.CRIB == TaskResult.CRIB) { App.ListCheckin_ltjyStack[ecount].CRIB = TaskResult.CRIB; App.ListCheckin_ltjyStack[ecount].Status = TaskResult.Status; App.ListCheckin_ltjyStack[ecount].LISTPD_SIMPLE.Clear(); App.ListCheckin_ltjyStack[ecount].LISTPD_SIMPLE.AddRange(TaskResult.LISTPD_SIMPLE); return; } } ecount++; } } } }
/// <summary> /// 显示垛标对应的箱标信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Listviewsimple_CopyDoubleClick(object sender, RoutedEventArgs e) { if (this.Listviewsimple_Copy.Items.Count > 0) { Checkin_ltjyStack _PackData_Simple_New = this.Listviewsimple_Copy.SelectedItem as Checkin_ltjyStack; if (_PackData_Simple_New != null) { ViewInfo _view = new ViewInfo(_PackData_Simple_New, this.Listviewsimple_Copy.SelectedIndex); _view.Topmost = true; _view.ShowDialog(); PackCountTxtD.Content = App.ListCheckin_ltjyStack.Count.ToString(); } } }
public Checkin_ltjyStack HproseSendDataStow(Checkin_ltjyStack _PackData) { Checkin_ltjyStack _Checkin_ltjyStack = null; try { _Checkin_ltjyStack = hpclient.Invoke <Checkin_ltjyStack>("CheckInD", new Object[] { _PackData, App.UserReadonly.UserNunber, App.UserReadonly.UserToAge }); return(_Checkin_ltjyStack); } catch (System.Exception ex) { //Tools.Checkin_ltjyStack_Error.Add(_Checkin_ltjyStack); _PackData.Status = "网络超时"; return(_PackData); } }
/// <summary> /// 绑定垛号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBind_Click(object sender, RoutedEventArgs e) { if (CribTxt.Text.Trim().Length > 0 && PackData_Simpl.Count > 0) { string _code = this.CribTxt.Text.Trim(); if (App.ListCheckin_ltjyStack.VerifyDataD(_code)) { BeepUP.Beep(2000, 500); WringText.Content = "重复垛号"; return; } Checkin_ltjyStack _Checkin_ltjyD = new Checkin_ltjyStack(); _Checkin_ltjyD.LISTPD_SIMPLE = new List <Checkin_ltjy>(PackData_Simpl.Count); _Checkin_ltjyD.CRIB = this.CribTxt.Text.Trim(); _Checkin_ltjyD.LISTPD_SIMPLE.AddRange(PackData_Simpl); App.ListCheckin_ltjyStack.Insert(0, _Checkin_ltjyD); PackData_Simpl.Clear(); Tools.SerializeShared(PackData_Simpl); CribTxt.Text = ""; PackCountTxtD.Content = App.ListCheckin_ltjyStack.Count.ToString(); SendTask = new Task <Checkin_ltjyStack>(() => SendDataServerD(_Checkin_ltjyD)); SendTask.Start(); SendTask.ContinueWith(TaskEndedByCatchD); } else { MessageBox.Show(CribTxt.Text.Trim().Length > 0 ? "请输入完整 箱标条码与商品码" : "请输入完整的垛号"); return; } }
private Checkin_ltjyStack SendDataServerD(Checkin_ltjyStack _Checkin_ltjyStack) { return(App.Data_Sync.HproseSendDataStow(App.ListCheckin_ltjyStack[Idx])); }
public ViewInfo(Checkin_ltjyStack p, int idx) { this._Checkin_ltjyD = p; Idx = idx; InitializeComponent(); }
/// <summary> /// 数据同步任务 同步箱垛关系数据 /// </summary> /// <param name="packData_Simple_New"></param> /// <returns></returns> public Checkin_ltjyStack SendDataServerD(Checkin_ltjyStack packData_Simple_New) { return(App.Data_Sync.HproseSendDataStow(packData_Simple_New)); }