FormatExMessage() 공개 정적인 메소드

public static FormatExMessage ( string message ) : string
message string
리턴 string
예제 #1
0
 protected virtual void OrderConfirm()
 {
     try
     {
         if (!Utility.IsHasTransformer(this.resolver))
         {
             this.DataBind();
             this.lblMessage.Text = "明细不能为空";
             this.tbBarCode.Focus();
             return;
         }
         Utility.RemoveLot(resolver);
         this.resolver.Input  = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
         this.resolver        = TheClientMgr.ScanBarcode(this.resolver);
         this.lblMessage.Text = this.resolver.Result;
         InitialAll();
     }
     catch (FaultException ex)
     {
         this.DataBind();
         this.lblMessage.Text = Utility.FormatExMessage(ex.Message);
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
         this.tbBarCode.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         InitialAll();
     }
 }
예제 #2
0
 protected override void OrderConfirm()
 {
     try
     {
         this.resolver.Input    = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
         this.resolver.PrintUrl = string.Empty;
         this.resolver          = TheClientMgr.ScanBarcode(this.resolver);
         if (this.resolver.PrintUrl != null && this.resolver.PrintUrl != string.Empty && this.resolver.NeedPrintAsn)
         {
             Utility.PrintOrder(this.resolver.PrintUrl, this, null);
         }
         this.lblMessage.Text = this.resolver.Result;
         InitialAll();
     }
     catch (FaultException ex)
     {
         this.lblMessage.Text = Utility.FormatExMessage(ex.Message);
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
         this.tbBarCode.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         InitialAll();
     }
 }
예제 #3
0
 private void OrderConfirm()
 {
     try
     {
         if (this.resolver.Transformers != null && this.resolver.Transformers.Length > 0)
         {
             this.resolver.Input = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
             string result = TheClientMgr.ScanBarcode(this.resolver).Result;
             this.lblMessage.Text = result;
             this.InitialAll();
         }
         else
         {
             this.InitialAll();
             this.lblMessage.Text = "明细不能为空";
         }
         this.DataBind();
     }
     catch (FaultException ex)
     {
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "错误:发货失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         this.tbBarCode.Focus();
         //InitialAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.InitialAll();
     }
 }
예제 #4
0
        private void Repack()
        {
            try
            {
                this.resolver.Input = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
                this.resolver       = TheClientMgr.ScanBarcode(this.resolver);

                if (this.resolver.PrintUrl != null && this.resolver.PrintUrl != string.Empty)
                {
                    Utility.PrintOrder(this.resolver.PrintUrl, this, null);
                }

                this.InitialAll();
                this.BindTransformer();
                this.lblMessage.Text = "翻箱成功!";
            }
            catch (FaultException ex)
            {
                MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "错误:翻箱失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.tbBarCode.Focus();
                //InitialAll();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.InitialAll();
            }
        }
예제 #5
0
        protected virtual void BarCodeScan()
        {
            try
            {
                this.tbBarCode.Text = this.tbBarCode.Text.Trim();
                #region 当输入框为空时,按回车焦点跳转
                if (this.tbBarCode.Text.Trim() == string.Empty && this.gvList.Rows.Count > 0)
                {
                    if (this.resolver.IsScanHu || this.gvHuList.Rows.Count > 0)
                    {
                        this.btnConfirm.Focus();
                        this.gvListDataBind();
                        //this.gvHuList.Visible = false;
                        //this.gvList.Visible = true;
                    }
                    else
                    {
                        this.gvList.Focus();
                        this.gvList.BeginEdit(true);
                    }
                    return;
                }
                if (this.tbBarCode.Text.Trim() == string.Empty)
                {
                    return;
                }
                #endregion

                this.resolver.Input = this.tbBarCode.Text;
                if (this.enableCache)
                {
                    this.originalResolver = Utility.ProcessOriginalResolver(this.resolver, this.originalResolver);
                    this.originalResolver = TheClientMgr.ScanBarcode(this.originalResolver);
                    this.resolver         = Utility.MergeResolver(this.resolver, this.originalResolver);
                }
                else
                {
                    this.resolver = TheClientMgr.ScanBarcode(this.resolver);
                }
                this.DataBind();
            }
            catch (FaultException ex)
            {
                string messageText = Utility.FormatExMessage(ex.Message);
                this.lblMessage.Text = messageText;
                MessageBox.Show(this, messageText);
                this.DataBind();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                InitialAll();
            }
        }
예제 #6
0
        protected override void OrderConfirm()
        {
            try
            {
                if (!Utility.IsHasTransformer(this.resolver))
                {
                    this.lblMessage.Text = "工单明细不能为空";
                    this.tbBarCode.Focus();
                    return;
                }
                MessageBoxButtons       messageBoxButtons       = MessageBoxButtons.OKCancel;
                MessageBoxDefaultButton messageBoxDefaultButton = MessageBoxDefaultButton.Button2;
                if (this.IsOdd)
                {
                    messageBoxButtons       = MessageBoxButtons.YesNoCancel;
                    messageBoxDefaultButton = MessageBoxDefaultButton.Button3;
                }
                DialogResult dialogResult = MessageBox.Show(this, message, caption, messageBoxButtons, MessageBoxIcon.Question, messageBoxDefaultButton);
                switch (dialogResult)
                {
                case DialogResult.Cancel:
                    break;

                case DialogResult.OK:
                case DialogResult.Yes:
                    this.resolver.IsOddCreateHu = true;
                    this.OrderOffline();
                    break;

                case DialogResult.No:
                    this.resolver.IsOddCreateHu = false;
                    this.OrderOffline();
                    break;

                default:
                    break;
                }
            }
            catch (FaultException ex)
            {
                this.lblMessage.Text = Utility.FormatExMessage(ex.Message);
                MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
                this.tbBarCode.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                InitialAll();
            }
        }
예제 #7
0
        private void WorkOrderScan()
        {
            try
            {
                this.InitialAll();
                if (orderNo.Length > 5)
                {
                    this.resolver.Input      = this.orderNo;
                    this.resolver.UserCode   = this.user.Code;
                    this.resolver.ModuleType = this.moduleType;

                    this.resolver = TheClientMgr.ScanBarcode(this.resolver);

                    this.lblMessage.Text      = resolver.Result;
                    this.lblMessage.ForeColor = Color.Black;
                    //this.resolver = TheClientMgr.GetTransformer(this.resolver);

                    this.gvOrderDataBind();
                    if (this.gvWODetail.Rows.Count > 0)
                    {
                        this.gvWODetail.Rows[0].Cells[this.gvWODetail.ColumnCount - 1].Selected = true;
                    }
                    this.gvWODetail.Focus();
                    //SendKeys.Send("{Tab}");
                    this.tbWO.Text      = this.orderNo;
                    this.tbWO.ForeColor = Color.Black;
                }
                else
                {
                    this.tbWO.Text            = string.Empty;
                    this.lblMessage.Text      = "请输入正确的工单号!";
                    this.lblMessage.ForeColor = Color.Red;
                    this.tbWO.Focus();
                }
            }
            catch (FaultException ex)
            {
                MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
                this.tbWO.Text = string.Empty;
                this.tbWO.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.tbWO.Text = string.Empty;
                this.tbWO.Focus();
            }
        }
예제 #8
0
 private void ShowHuStatus()
 {
     try
     {
         this.resolver.Input = this.tbBarCode.Text.Trim();
         if (this.resolver.Input != string.Empty)
         {
             this.resolver = TheClientMgr.ScanBarcode(this.resolver);
             if (this.resolver.Transformers != null &&
                 this.resolver.Transformers.Length == 1 &&
                 this.resolver.Transformers[0].TransformerDetails != null &&
                 this.resolver.Transformers[0].TransformerDetails.Length == 1)
             {
                 TransformerDetail t    = this.resolver.Transformers[0].TransformerDetails[0];
                 string            text = "条码信息:                                                \n条码:"
                                          + t.HuId + "\n物料代码:" + t.ItemCode
                                          + "\n物料描述:" + t.ItemDescription + "\n数量:" + t.Qty.ToString("0.########")
                                          + "\n批号:" + t.LotNo + "\n库位:" + t.LocationCode + "\n库格:" + t.StorageBinCode + "\n状态:" + t.Status;
                 string caption = "条码信息:";
                 MessageBox.Show(this, text, caption, MessageBoxButtons.OK);
                 this.resolver.Transformers[0].TransformerDetails = null;
                 this.tbBarCode.Text = string.Empty;
                 this.tbBarCode.Focus();
             }
         }
     }
     catch (FaultException ex)
     {
         string messageText = Utility.FormatExMessage(ex.Message);
         this.lblMessage.Text = messageText;
         MessageBox.Show(this, messageText);
         this.InitialAll();
         this.gvHuList.Visible = false;
         this.gvList.Visible   = false;
         this.tbBarCode.Text   = string.Empty;
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.InitialAll();
         this.gvHuList.Visible = false;
         this.gvList.Visible   = false;
         this.tbBarCode.Text   = string.Empty;
     }
 }
예제 #9
0
 private void BarCodeScan()
 {
     try
     {
         if (Utility.IsHasTransformer(this.resolver) && this.tbBarCode.Text.Trim() == string.Empty)
         {
             if (this.resolver.IOType == BusinessConstants.IO_TYPE_IN)
             {
                 this.resolver.IOType = BusinessConstants.IO_TYPE_OUT;
                 this.lblBarCode.Text = "拆箱后条码";
                 this.tbBarCode.Focus();
             }
             else if (this.resolver.Transformers[1] != null && this.resolver.Transformers[1].TransformerDetails != null &&
                      this.resolver.Transformers[1].TransformerDetails.Length > 0)
             {
                 this.btnDevanning.Focus();
             }
             return;
         }
         if (this.tbBarCode.Text.Trim() == string.Empty)
         {
             return;
         }
         this.tbBarCode.Text      = this.tbBarCode.Text.Trim();
         this.resolver.Input      = this.tbBarCode.Text;
         this.resolver.UserCode   = this.user.Code;
         this.resolver.ModuleType = BusinessConstants.TRANSFORMER_MODULE_TYPE_DEVANNING;
         this.resolver            = TheClientMgr.ScanBarcode(this.resolver);
         this.BindTransformer();
     }
     catch (FaultException ex)
     {
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "获取扫条码信息失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         this.tbBarCode.Text = string.Empty;
         this.tbBarCode.Focus();
         this.lblMessage.Text      = Utility.FormatExMessage(ex.Message);
         this.lblMessage.ForeColor = Color.Red;
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误, 请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.InitialAll();
     }
 }
예제 #10
0
        private void OrderNoScan()
        {
            try
            {
                this.gvList.Visible   = true;
                this.gvHuList.Visible = false;
                this.tbBarCode.Text   = this.tbBarCode.Text.Trim();

                #region 当输入框为空时,按回车焦点跳转
                if (this.tbBarCode.Text.Length == 0 && Utility.IsHasTransformerDetail(this.resolver))
                {
                    if (this.resolver.IsScanHu)
                    {
                        this.btnOrderReturn.Focus();
                    }
                    else
                    {
                        this.gvList.Focus();
                        this.gvList.BeginEdit(true);
                    }
                    this.gvListDataBind();
                    return;
                }
                #endregion

                this.resolver.Input = this.tbBarCode.Text;
                this.resolver       = TheClientMgr.ScanBarcode(this.resolver);

                this.DataBind();
            }
            catch (FaultException ex)
            {
                this.tbBarCode.Focus();
                this.tbBarCode.Text  = string.Empty;
                this.lblMessage.Text = Utility.FormatExMessage(ex.Message);
                MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "扫描条码失败", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.InitialAll();
            }
        }
예제 #11
0
 private void ReceiveOrder()
 {
     try
     {
         if (this.resolver.Transformers != null && this.resolver.Transformers.Length > 0)
         {
             List <string[]> workingHoursList = new List <string[]>();
             foreach (DataRow dr in this.dt.Rows)
             {
                 string[] stringArray = new string[2];
                 stringArray[0] = dr[0].ToString();
                 stringArray[1] = dr[2].ToString();
                 workingHoursList.Add(stringArray);
             }
             this.resolver.WorkingHours = workingHoursList.ToArray();
             this.resolver.Input        = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
             this.resolver = TheClientMgr.ScanBarcode(this.resolver);
             if (this.resolver.AutoPrintHu)
             {
                 Utility.PrintOrder(this.resolver.PrintUrl, this, null);
             }
             this.InitialAll();
             this.lblMessage.Text      = "收货成功!";
             this.lblMessage.ForeColor = Color.Green;
         }
         else
         {
             MessageBox.Show(this, "没有可收的货物!", "收货失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (FaultException ex)
     {
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
     }
     catch (Exception ex)
     {
         this.InitialAll();
         MessageBox.Show(this, ex.Message, "收货失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #12
0
 private void Devanning()
 {
     try
     {
         this.resolver.Input = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_OK;
         this.resolver       = TheClientMgr.ScanBarcode(this.resolver);
         this.InitialAll();
         this.BindTransformer();
         this.lblMessage.Text = "拆箱成功!";
     }
     catch (FaultException ex)
     {
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "错误:拆箱失败!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         this.tbBarCode.Focus();
         //InitialAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.InitialAll();
     }
 }
예제 #13
0
        private void CodeScan()
        {
            try
            {
                this.tbWO.Text = this.tbWO.Text.Trim().ToUpper();
                string woNo = this.tbWO.Text;
                this.resolver.Input = woNo;
                ClientMgrWSSoapClient TheClientMgr = new ClientMgrWSSoapClient();

                if (this.resolver.Input == string.Empty || this.resolver.Input == null)
                {
                    this.lblmessage.Text = "请扫描工单";
                    this.tbWO.Focus();
                    return;
                }
                string onlineDate = TheClientMgr.ScanBarcode(resolver).Result;
                this.lblmessage.Text = "工单:" + woNo + "上线成功!";
                if (resolver.ModuleType == BusinessConstants.TRANSFORMER_MODULE_TYPE_PICKLISTONLINE)
                {
                    this.lblmessage.Text = "拣货单:" + woNo + "上线成功!";
                }
                this.lblmessage.ForeColor = Color.Green;
                this.ShowOrders(woNo, onlineDate);
                this.tbWO.ForeColor = Color.Black;
                this.tbWO.Text      = string.Empty;
                this.tbWO.Focus();
            }
            catch (FaultException ex)
            {
                MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
                this.tbWO.Text = string.Empty;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.tbWO.Text = string.Empty;
            }
        }
예제 #14
0
 private void EmployeeScan()
 {
     try
     {
         this.tbEmployee.Text = this.tbEmployee.Text.Trim().ToUpper();
         if (this.tbEmployee.Text != string.Empty)
         {
             this.employee = TheClientMgr.LoadEmployee(this.tbEmployee.Text.Trim());
             if (employee != null)
             {
                 this.ShowEmployee(employee);
             }
             else
             {
                 this.tbEmployee.Text              = string.Empty;
                 this.lblEmployeeMessage.Text      = "此雇员信息不存在!";
                 this.lblEmployeeMessage.ForeColor = Color.Red;
             }
         }
         else
         {
             this.btnOffline.Focus();
         }
     }
     catch (FaultException ex)
     {
         MessageBox.Show(this, Utility.FormatExMessage(ex.Message));
         this.tbWO.Text = string.Empty;
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "获取雇员信息失败!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         this.tbEmployee.Text = string.Empty;
         this.tbEmployee.Focus();
     }
 }
예제 #15
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Control | Keys.Enter))
            {
                this.btnOrderReturn_Click(null, null);
                return(true);
            }
            else if (keyData == (Keys.Control | Keys.P))
            {
                this.PrintReceiver();
                return(true);
            }

            if (this.tbBarCode.Focused)
            {
                if (keyData == Keys.Enter)
                {
                    this.OrderNoScan();
                    return(true);
                }
                if (keyData == Keys.Escape)
                {
                    try
                    {
                        this.tbBarCode.Focus();
                        this.tbBarCode.Text = string.Empty;
                        this.resolver.Input = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_CANCEL;
                        this.resolver       = TheClientMgr.ScanBarcode(this.resolver);
                        this.DataBind();
                    }
                    catch (FaultException ex)
                    {
                        this.lblMessage.Text = Utility.FormatExMessage(ex.Message);
                        MessageBox.Show(this, Utility.FormatExMessage(ex.Message), "扫描条码失败", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(this, ex.Message, "程序内部错误,请与管理员联系", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.InitialAll();
                    }
                }
            }
            else if (this.btnOrderReturn.Focused)
            {
                if (keyData == Keys.Enter)
                {
                    this.OrderConfirm();
                    return(true);
                }
            }
            else if (this.gvList.Focused)
            {
                if (keyData == Keys.Enter)
                {
                    if (this.resolver != null && !this.resolver.IsScanHu)
                    {
                        int currentRowIndex = this.gvList.CurrentCell.RowIndex;
                        if (currentRowIndex == this.gvList.Rows.Count - 1)
                        {
                            this.gvHuList.ClearSelection();
                            this.btnOrderReturn.Focus();
                        }
                    }
                    else
                    {
                        this.btnOrderReturn.Focus();
                    }
                }
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }