Exemplo n.º 1
0
        private void BtnFinsh_Click(object sender, RoutedEventArgs e)
        {
            if (TBWarehouse.Text.Length > 0 && TBPosition.Text.Length > 0)
            {
                if (int.Parse(LabPackNum.Content.ToString()) > 0)
                {
                    if (SPDataSource != null)
                    {
                        ProcessMsg msg = packageStoreService.CompleteStore(SPDataSource.Select(t => t.packageID).ToList <string>(), TBWarehouse.Text, TBPosition.Text.ToString());

                        if (msg.result)
                        {
                            string errorMsg = msg.GetMessage(ReturnCode.Warning).Trim();
                            if (errorMsg.Length > 0)
                            {
                                new InfoBoard(MsgLevel.Warning, errorMsg).ShowDialog();
                            }
                            TBTrayId.Text         = msg.GetMessage(ReturnCode.OK).Trim();
                            TBPackageId.IsEnabled = false;
                            BtnFinsh.IsEnabled    = false;
                            BtnRePrint.IsEnabled  = true;
                            BtnNew.IsEnabled      = true;
                            bool?print = new InfoBoard(MsgLevel.Successful, "入库成功,是否打印包装箱标签?\n标签号为:" + TBTrayId.Text).ShowDialog();
                            if ((bool)print)
                            {
                                this.PrintTrayLabel(TBTrayId.Text);
                            }
                        }
                        else
                        {
                            new InfoBoard(MsgLevel.Warning, msg.GetAllLevelMsgs()).ShowDialog();
                        }
                    }
                }
                else
                {
                    new InfoBoard(MsgLevel.Warning, "未开始入库!").ShowDialog();
                }
            }
            else
            {
                new InfoBoard(MsgLevel.Warning, "未输入仓库或库位!").ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void BtnFinsh_Click(object sender, RoutedEventArgs e)
        {
            if (TBWarehouse.Text.Length > 0 && TBPosition.Text.Length > 0)
            {
                if (int.Parse(LabPackNum.Content.ToString()) > 0)
                {
                    if (SPDataSource != null)
                    {
                      ProcessMsg msg= packageStoreService.CompleteStore(SPDataSource.Select(t => t.packageID).ToList<string>(), TBWarehouse.Text, TBPosition.Text.ToString());

                      if (msg.result)
                      {
                          string errorMsg = msg.GetMessage(ReturnCode.Warning).Trim();
                          if (errorMsg.Length > 0) {
                              new InfoBoard(MsgLevel.Warning, errorMsg).ShowDialog();
                          }
                          TBTrayId.Text = msg.GetMessage(ReturnCode.OK).Trim();
                          TBPackageId.IsEnabled = false;
                          BtnFinsh.IsEnabled = false;
                          BtnRePrint.IsEnabled = true;
                          BtnNew.IsEnabled = true;
                          bool? print = new InfoBoard(MsgLevel.Successful, "入库成功,是否打印包装箱标签?\n标签号为:" + TBTrayId.Text).ShowDialog();
                          if ((bool)print)
                          {
                              this.PrintTrayLabel(TBTrayId.Text);
                          }
                      }
                      else
                      {
                          new InfoBoard(MsgLevel.Warning, msg.GetAllLevelMsgs()).ShowDialog();
                      }
                    }
                }
                else {
                    new InfoBoard(MsgLevel.Warning, "未开始入库!").ShowDialog();
                }
            }
            else
            {
                new InfoBoard(MsgLevel.Warning,  "未输入仓库或库位!").ShowDialog();
            }
        }