コード例 #1
0
        private void Mat_ChangeLocation(string location)
        {
            string serialno = this.txt01SERIAL_NO.Text;

            string resultMsg = string.Empty;

            ServiceRef.MaterialCard mCard = null;


            if (string.IsNullOrEmpty(serialno))
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);

                return;
            }


            if (string.IsNullOrEmpty(location))
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01LOCATION, false);

                return;
            }



            try
            {
                base.ShowWaitProcess();
                mCard = ServiceProvider.Instance.Proxy.ScanMat_ChangeLocation(serialno, location, this.USER_ID, out resultMsg);
                base.HideWaitProcess();

                if (mCard != null)
                {
                    this.lblSUPPLIER.Text  = mCard.PARTY_NAME;
                    this.lblMTL_CODE.Text  = mCard.MTL_CODE;
                    this.lblMTL_NAME.Text  = mCard.MTL_NAME;
                    this.lblMTL_GRADE.Text = mCard.MTL_GRADE;
                    this.lblMTL_COLOR.Text = mCard.MTL_COLOR;

                    this.lblQTY.Text        = string.Format("{0:#,##0.0000} {1}.", mCard.QTY, mCard.UNIT_ID);
                    this.lblARRIVAL_NO.Text = mCard.ARRIVAL_NO;


                    this.lblCARGO_STATUS.Text = ResourceManager.Instance.GetString(mCard.CARGO_STATUS);



                    if (resultMsg == "OK")
                    {
                        this.lblLOCATION.Text = mCard.LOCATION_ID;



                        this.lbl01CHANGE_LOCATION.Visible = false;

                        this.txt01LOCATION.Text    = string.Empty;
                        this.txt01LOCATION.Visible = false;

                        this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                    }
                    else
                    {
                        base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                        this.SetTextFocusControl(this.txt01LOCATION, false);
                    }
                }
                else
                {
                    base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                    this.SetTextFocusControl(this.txt01LOCATION, false);
                }
            }
            catch (WebException wex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(wex.Message, "WebException");

                this.SetTextFocusControl(this.txt01LOCATION, false);
            }
            catch (Exception ex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(ex.Message, "Exception");

                this.SetTextFocusControl(this.txt01LOCATION, false);
            }
        }
コード例 #2
0
        private void MatStock(string serialno)
        {
            string resultMsg = string.Empty;

            ServiceRef.MaterialCard mCard = null;

            if (string.IsNullOrEmpty(serialno))
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);

                return;
            }

            try
            {
                base.ShowWaitProcess();
                mCard = ServiceProvider.Instance.Proxy.ScanMat_Stock(serialno, out resultMsg);
                base.HideWaitProcess();

                this.ClearScreenDetail();

                if (mCard != null)
                {
                    this.lblSUPPLIER.Text  = mCard.PARTY_NAME;
                    this.lblMTL_CODE.Text  = mCard.MTL_CODE;
                    this.lblMTL_NAME.Text  = mCard.MTL_NAME;
                    this.lblMTL_GRADE.Text = mCard.MTL_GRADE;
                    this.lblMTL_COLOR.Text = mCard.MTL_COLOR;

                    if (mCard.QTY <= mCard.MIN_QTY)
                    {
                        this.lblQTY.ForeColor = Color.Red;
                    }
                    else if (mCard.QTY >= mCard.MAX_QTY)
                    {
                        this.lblQTY.ForeColor = Color.Orange;
                    }
                    else
                    {
                        this.lblQTY.ForeColor = Color.Green;
                    }

                    this.lblQTY.Text  = string.Format("{0:#,##0.0000}", mCard.QTY);
                    this.lblUnit.Text = mCard.UNIT_ID;

                    this.lblMIN_QTY.Text = string.Format("{0:#,##0.0000}", mCard.MIN_QTY);
                    this.lblMAX_QTY.Text = string.Format("{0:#,##0.0000}", mCard.MAX_QTY);



                    if (resultMsg == "OK")
                    {
                        this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                    }
                    else
                    {
                        base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                        this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                    }
                }
                else
                {
                    base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                    this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                }
            }
            catch (WebException wex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(wex.Message, "WebException");

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);
            }
            catch (Exception ex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(ex.Message, "Exception");

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);
            }
        }
コード例 #3
0
ファイル: frmMatIn.cs プロジェクト: wangscript007/FGTrack_PLM
        private void MatIn_Complete(string serialno)
        {
            //string location = this.txt01LOCATION.Text;
            string numBox = this.txt01NO_OF_BOX.Text;

            string resultMsg = string.Empty;

            ServiceRef.MaterialCard mCard = null;

            //if (string.IsNullOrEmpty(location))
            //{
            //    base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
            //                , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

            //    this.SetTextFocusControl(this.txt01LOCATION, false);

            //    return;
            //}

            if (string.IsNullOrEmpty(numBox))
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01NO_OF_BOX, false);

                return;
            }

            int iNumBox = int.Parse(numBox, NumberStyles.AllowThousands);

            if (iNumBox <= 0)
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_INPUT_WRONG_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01NO_OF_BOX, false);

                return;
            }

            if (string.IsNullOrEmpty(serialno))
            {
                base.ShowErrorBox(string.Format("{0}", ResourceManager.Instance.GetString("ERR_PLEASE_INPUT_VALUE"))
                                  , ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);

                return;
            }

            try
            {
                base.ShowWaitProcess();
                mCard = ServiceProvider.Instance.Proxy.ScanMatIn_Complete(serialno, string.Empty, this.USER_ID, out resultMsg);
                base.HideWaitProcess();

                if (mCard != null)
                {
                    this.lblSUPPLIER.Text     = mCard.PARTY_NAME;
                    this.lblMTL_CODE.Text     = mCard.MTL_CODE;
                    this.lblMTL_NAME.Text     = mCard.MTL_NAME;
                    this.lblMTL_GRADE.Text    = mCard.MTL_GRADE;
                    this.lblMTL_COLOR.Text    = mCard.MTL_COLOR;
                    this.lblQTY.Text          = string.Format("{0:#,##0.0000} {1}.", mCard.QTY, mCard.UNIT_ID);
                    this.lblARRIVAL_NO.Text   = mCard.ARRIVAL_NO;
                    this.lblCARGO_STATUS.Text = ResourceManager.Instance.GetString(mCard.CARGO_STATUS);


                    if (resultMsg == "OK")
                    {
                        this.SCANED_BOX++;
                        this.lblSCANED_BOX.Text = string.Format("SCANED {0:#,##0}/{1:#,##0} BOX.", this.SCANED_BOX, this.TOTAL_BOX);

                        this.SetTextFocusControl(this.txt01SERIAL_NO, false);

                        if (this.SCANED_BOX == this.TOTAL_BOX)
                        {
                            base.StartPlayTon_Complete();

                            this.SetTextReadOnlyControl(this.txt01SERIAL_NO);

                            this.txt01NO_OF_BOX.Text = string.Empty;
                            this.SetTextFocusControl(this.txt01NO_OF_BOX, false);
                        }
                    }
                    else
                    {
                        this.lblSCANED_BOX.Text = string.Format("SCANED {0:#,##0}/{1:#,##0} BOX.", this.SCANED_BOX, this.TOTAL_BOX);

                        base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                        this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                    }
                }
                else
                {
                    base.ShowWarningBox(ResourceManager.Instance.GetString(resultMsg), ResourceManager.Instance.GetString("TITLE_PLEASE_CHECK"));

                    this.SetTextFocusControl(this.txt01SERIAL_NO, false);
                }
            }
            catch (WebException wex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(wex.Message, "WebException");

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);
            }
            catch (Exception ex)
            {
                base.HideWaitProcess();
                base.ShowErrorBox(ex.Message, "Exception");

                this.SetTextFocusControl(this.txt01SERIAL_NO, false);
            }
        }