示例#1
0
        private void ClearAll()
        {
            bucketNoBox.Clear();
            bucketWeightBox.Clear();
            ticketNoBox.Clear();
            itemCodeBox.Clear();
            itemName1Box.Clear();
            itemName2Box.Clear();
            itemName3Box.Clear();
            colorCodeBox.Clear();
            planCountBox.Clear();
            planWeightBox.Clear();
            unitWeightBox.Clear();
            itemWeightErrorBox.Clear();
            itemWeightRangeLimitFromBox.Clear();
            itemWeightRangeLimitToBox.Clear();
            itemWeightBox.Clear();
            itemCountBox.Value = itemCountBox.Minimum;
            fixedWeightBox.Clear();
            plasticBagStatusBox.Clear();

            touCyaKu = null;
            zaiKo    = null;
            zKey     = null;
            bucket   = null;

            itemCountBox.ReadOnly = true;
        }
示例#2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                datetimeLb.Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
                if (!DbAccess.IsSystemOnline())
                {
                    setStatusBox("系统Offline");
                    return;
                }
                else
                {
                    if (statusBox.Text == "系统Offline")
                    {
                        setStatusBox(string.Empty);
                    }
                }

                if (!isOperating)
                {
                    checkStockInMode();

                    touCyaKu = DbAccess.GetTouCyaKu(GlobalAccess.StationNo);
                    if (touCyaKu != null)
                    {
                        if (DoTouCyaKu(touCyaKu))
                        {
                            weightLoadBtn.PerformClick();
                            if (!manCheck.Checked && !isRangeError)
                            {
                                if (statusBox.Text == "空箱登录模式" || itemCountBox.Value > 0)
                                {
                                    setBtn.PerformClick();
                                }
                                else
                                {
                                    exportBtn.PerformClick();
                                }
                            }
                        }
                    }
                    else
                    {
                        ClearAll();
                    }
                }
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
        }
示例#3
0
        private void ClearAll()
        {
            bucketNoBox.Clear();
            bucketWeightBox.Clear();
            ticketNoBox.Clear();
            itemCodeBox.Clear();
            itemNameBox1.Clear();
            itemNameBox2.Clear();
            itemNameBox3.Clear();
            colorCodeBox.Clear();
            lineBox.Clear();
            sectionBox.Clear();
            planCountBox.Clear();
            planWeightBox.Clear();
            unitWeightBox.Clear();
            measureFlagBox.Clear();
            checkCountBox.Value = checkCountBox.Minimum;
            unitWeightErrorBox.Clear();
            itemWeightErrorBox.Clear();
            unitWeightRangeLimitFromBox.Clear();
            itemWeightRangeLimitFromBox.Clear();
            unitWeightRangeLimitToBox.Clear();
            itemWeightRangeLimitToBox.Clear();
            itemWeightBox.Clear();
            itemCountBox.Value = itemCountBox.Minimum;
            memoBox.Clear();
            chkReStockIn.Checked = false;
//            manCheck.Checked = false;
            chkUsingPlasticBag.Checked = false;
            fixedWeightBox.Clear();

            _touCyaKu = null;
            _zaiKo    = null;
            _zKey     = null;
            _bucket   = null;

            itemCountBox.ReadOnly = true;
        }
示例#4
0
        private bool DoTouCyaKu(FNTOUCYAKUEntity touCyaKu)
        {
            bucketNoBox.Text = touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR" ? string.Empty : touCyaKu.BUCKET_NO;

            if (touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR")
            {
                DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                setStatusBox("条码未读取");
                setUIOnExport();
                isOperating = true;
                return(false);
            }

            FNHANSOEntity hanSo = DbAccess.GetHanSo(touCyaKu.MCKEY);

            if (hanSo == null)
            {
                setStatusBox("排出");
                touCyaKu.SYORIFLG = "1";
                touCyaKu.Save();
                setUIOnExport();
                isOperating = true;
                return(false);
            }

            if (touCyaKu.HEIGHT_FLAG == "3")    //货形高低异常
            {
                DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error);
                setStatusBox("Bucket高度异常");
                setUIOnExport();
                isOperating = true;
                return(false);
            }

            FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);

            if (station == null)
            {
                return(false);
            }

            if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
            {
                setStatusBox("空箱登录模式");
                isOperating = true;
                return(true);
            }

            if (station.NYUSYUMODE == Nyusyumode.Normal)    //入库模式
            {
                bucket = DbAccess.GetBucket(touCyaKu.BUCKET_NO);
                if (bucket == null)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    setStatusBox("空箱未登录");
                    setUIOnExport();
                    isOperating = true;
                    return(false);
                }

                bucketWeightBox.Text = bucket.PACKING_WEIGHT.ToString();
                if (bucket.HEIGHT_FLAG != touCyaKu.HEIGHT_FLAG)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error);
                    setStatusBox("Bucket高度异常");
                    setUIOnExport();
                    isOperating = true;
                    return(false);
                }

                if (DbAccess.IsBucketInLocation(bucket.BUCKET_NO))
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    setStatusBox("Bucket重复");
                    setUIOnExport();
                    isOperating = true;
                    return(false);
                }

                zaiKo = DbAccess.GetZaiKoByBucketNo(bucket.BUCKET_NO);
                if (zaiKo == null)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    setStatusBox("Bucket未设定");
                    setUIOnExport();
                    isOperating = true;
                    return(false);
                }

                msgBox.Clear();
                setStatusBox("正常");
                isOperating      = true;
                ticketNoBox.Text = zaiKo.TICKET_NO;
                return(DoBucketNo());
            }
            return(false);
        }
示例#5
0
        private void setBtn_Click(object sender, EventArgs e)
        {
            string schno = string.Empty;

            try
            {
                if (parentWindowType == 1)
                {
                    touCyaKu = DbAccess.GetTouCyaKu(GlobalAccess.StationNo);
                    if (touCyaKu == null)
                    {
                        msgBox.Text = "没有到达报告";
                        return;
                    }
                }
                if (string.IsNullOrEmpty(itemCodeBox.Text))
                {
                    msgBox.Text = "Item Name不能为空";
                    itemCodeBox.Focus();
                    itemCodeBox.SelectAll();
                    return;
                }
                else if (DoItemCode(itemCodeBox.Text) == false)
                {
                    return;
                }
                else if (string.IsNullOrEmpty(colorCodeBox.Text))
                {
                    msgBox.Text = "Color Code不能为空";
                    colorCodeBox.Focus();
                    colorCodeBox.SelectAll();
                    return;
                }
                else if (itemCountBox.Value == 0)
                {
                    msgBox.Text = "Item个数不能为0";
                    itemCountBox.Focus();
                    itemCountBox.Select();
                    return;
                }

                schno = DbAccess.generateScheduleNo();
                FNGSETEntity fngset = new FNGSETEntity();
                fngset.SCHNO      = schno;
                fngset.MOTOSTNO   = GlobalAccess.StationNo;
                fngset.BUCKET_NO  = bucketNoBox.Text;
                fngset.ZAIKEY     = itemCodeBox.Text;
                fngset.COLOR_CODE = colorCodeBox.Text;
                fngset.NYUSYUSU   = itemCountBox.Value;
                fngset.USERID     = GlobalAccess.UserId;
                fngset.USERNAME   = GlobalAccess.UserName;
                fngset.SYORIFLG   = "0";
                fngset.Save();

                if (parentWindowType == 1)
                {
                    DbAccess.callProcedure(schno, "unmanaged_stockin_1_start");
                }
                else if (parentWindowType == 2)
                {
                    DbAccess.callProcedure(schno, "unmanaged_stockin_2_start");
                }
                DbAccess.callAfterStockin(string.Empty);
                msgBox.Text = "设定成功";

                ClearAll();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
            finally
            {
                DbAccess.UpdateFngset(schno);
            }
        }
示例#6
0
        private bool DoTouCyaKu(FNTOUCYAKUEntity touCyaKu)
        {
            bucketNoBox.Text = touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR" ? string.Empty : touCyaKu.BUCKET_NO;
            if (touCyaKu.BUCKET_NO.Trim().ToUpper() == "BR")
            {
                DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                setStatusBox("条码未读取");
                setUIOnExport();
                _isOperating = true;
                return(false);
            }

            FNHANSOEntity hanSo = DbAccess.GetHanSo(touCyaKu.MCKEY);

            if (hanSo == null)
            {
                setStatusBox("排出");
                touCyaKu.SYORIFLG = "1";
                touCyaKu.Save();
                setUIOnExport();
                _isOperating = true;
                return(false);
            }

            if (hanSo.SAGYOKBN == Sagyokbn.ReInput) //再入库
            {
                setStatusBox("通过");
                ShowInfo(hanSo.SYSTEMID);
                return(false);
            }

            if (touCyaKu.HEIGHT_FLAG == "3")    //货形高低异常
            {
                DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error);
                setStatusBox("Bucket高度异常");
                setUIOnExport();
                _isOperating = true;
                return(false);
            }

            FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);

            if (station == null)
            {
                return(false);
            }

            if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
            {
                setStatusBox("空箱登录模式");
                _isOperating = true;
                return(true);
            }

            if (station.NYUSYUMODE == Nyusyumode.Normal)    //入库模式
            {
                _bucket = DbAccess.GetBucket(touCyaKu.BUCKET_NO);
                if (_bucket == null)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    setStatusBox("空箱未登录");
                    setUIOnExport();
                    _isOperating = true;
                    return(false);
                }
                bucketWeightBox.Text = _bucket.PACKING_WEIGHT.ToString();

                if (_bucket.HEIGHT_FLAG != touCyaKu.HEIGHT_FLAG)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Height_Error);
                    setStatusBox("Bucket高度异常");
                    setUIOnExport();
                    _isOperating = true;
                    return(false);
                }

                if (DbAccess.IsBucketInAutoWarehouse(_bucket.BUCKET_NO) ||
                    DbAccess.IsBucketInLocation(_bucket.BUCKET_NO))
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    setStatusBox("Bucket重复");
                    setUIOnExport();
                    _isOperating = true;
                    return(false);
                }

                msgBox.Clear();
                setStatusBox("正常");
                _isOperating = true;
            }
            return(false);
        }