Exemple #1
0
        private void setUI()
        {
            FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);

            if (station == null)
            {
                MessageBox.Show("无法取得站台信息", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (station.INTO_FLAG == "0")
            {
                txtCurrentStatus.Text      = "进入许可";
                txtCurrentStatus.BackColor = Color.Lime;
                rdoAllowed.Select();
            }
            else
            {
                txtCurrentStatus.Text      = "进入禁止";
                txtCurrentStatus.BackColor = Color.Red;
                rdoProhibited.Select();
            }
        }
Exemple #2
0
        private void Stockout_Load(object sender, EventArgs e)
        {
            try
            {
                timer2.Start();
                timer2_Tick(null, null);

                userIdBox.Text               = GlobalAccess.UserId;
                userNameBox.Text             = GlobalAccess.UserName;
                GlobalAccess.UseMockWeighter = AppConfig.Get("MockWeighter") == "1";
                FNSTATIONEntity stationEntity = DbAccess.GetStation(GlobalAccess.StationNo);
                if (stationEntity == null)
                {
                    GlobalAccess.ShowDebugInfo("cannot find fnstation data");
                    return;
                }

                if (stationEntity.CHUDANFLG == null)
                {
                    GlobalAccess.ShowDebugInfo("fnstation -> chudanflg is null");
                    return;
                }

                if (stationEntity.CHUDANFLG == "0")
                {
                    setJobStatus("作业开始");
                }
                else
                {
                    setJobStatus("作业中断");
                }
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
        }
Exemple #3
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);
        }
Exemple #4
0
        private void setBtn_Click(object sender, EventArgs e)
        {
            string schno = string.Empty;

            try
            {
                if (statusBox.Text == "系统Offline")
                {
                    return;
                }

                if (statusBox.Text == "通过")
                {
                    return;
                }

                if (_isOperating == false)
                {
                    return;
                }

                if (_touCyaKu == null)
                {
                    msgBox.Text = "没有到达报告";
                    return;
                }

                if (statusBox.Text == "空箱登录模式" || statusBox.Text == "正常")
                {
                    if (statusBox.Text == "正常")
                    {
                        FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                        if (station == null)
                        {
                            msgBox.Text = "无法取得站台信息";
                            return;
                        }

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

                        if (ticketNoBox.Text.Trim() == string.Empty)
                        {
                            msgBox.Text = "TicketNo不能为空";
                            ticketNoBox.Focus();
                            ticketNoBox.SelectAll();
                            return;
                        }
                        if (effectiveTicketNo != ticketNoBox.Text)
                        {
                            msgBox.Text = "TicketNo无效";
                            ticketNoBox.Focus();
                            ticketNoBox.SelectAll();
                            return;
                        }
                        if (string.IsNullOrEmpty(unitWeightBox.Text))
                        {
                            msgBox.Text = "请先获得单位重量";
                            unitWeightLoadBtn.Focus();
                            return;
                        }

                        if (decimal.Parse(unitWeightBox.Text) == 0)
                        {
                            msgBox.Text = "单位重量必须大于0";
                            unitWeightBox.Focus();
                            unitWeightBox.SelectAll();
                            return;
                        }
                        if (string.IsNullOrEmpty(itemWeightBox.Text))
                        {
                            msgBox.Text = "请先读取Item重量";
                            weightLoadBtn.Focus();
                            return;
                        }
                        if (itemCountBox.Value <= 0)
                        {
                            msgBox.Text = "Item数量必须大于0";
                            itemCountBox.Focus();
                            itemCountBox.Select();
                            return;
                        }
                        if (Encoding.Default.GetByteCount(this.memoBox.Text) > memoBox.MaxLength)
                        {
                            msgBox.Text = "备注超长(规定长度是100个半角字符,1个汉字等于2个半角字符)";
                            memoBox.Focus();
                            memoBox.SelectAll();
                            return;
                        }
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                        if (station == null)
                        {
                            msgBox.Text = "无法取得站台信息";
                            return;
                        }

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

                        if (string.IsNullOrEmpty(itemWeightBox.Text))
                        {
                            msgBox.Text = "请先读取Item重量";
                            weightLoadBtn.Focus();
                            return;
                        }

                        if (decimal.Parse(itemWeightBox.Text) == 0)
                        {
                            msgBox.Text = "Item重量不可为0";
                            weightLoadBtn.Focus();
                            return;
                        }
                    }
                    schno = DbAccess.generateScheduleNo();
                    FNGSETEntity fngset = new FNGSETEntity();
                    fngset.SCHNO    = schno;
                    fngset.MOTOSTNO = GlobalAccess.StationNo;
                    fngset.SYORIFLG = "0";
                    fngset.USERID   = GlobalAccess.UserId;
                    fngset.USERNAME = GlobalAccess.UserName;
                    if (statusBox.Text == "正常")
                    {
                        fngset.UNIT_WEIGHT    = Convert.ToDecimal(unitWeightBox.Text) / 1000;
                        fngset.MEASURE_WEIGHT = Convert.ToDecimal(itemWeightBox.Text);
                        fngset.NYUSYUSU       = itemCountBox.Value;
                        fngset.MEMO           = string.IsNullOrEmpty(memoBox.Text.Trim()) ? " " : memoBox.Text;
                        fngset.TICKET_NO      = effectiveTicketNo;
                        fngset.SAINYUKBN      = chkReStockIn.Checked ? "1" : " ";
                        fngset.BAG_FLAG       = chkUsingPlasticBag.Checked ? "1" : "0";
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        fngset.PACKING_WEIGHT = Convert.ToDecimal(itemWeightBox.Text);
                    }
                    fngset.Save();
                    DbAccess.callProcedure(schno, "stockin_1");
                    if (statusBox.Text == "正常")
                    {
                        FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(effectiveTicketNo);
                        _preZaiKey     = zaikoEntity.ZAIKEY;
                        _preColorCode  = zaikoEntity.COLOR_CODE;
                        _preUnitWeight = decimal.Parse(unitWeightBox.Text);
                        DbAccess.callAfterStockin(zaikoEntity.WEIGHT_REPORT_COMPLETE_FLAG);
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        DbAccess.callAfterStockin(string.Empty);
                    }
                    msgBox.Text = "设定成功";
                    ClearAll();
                    ticketNoBox.Focus();
                    ticketNoBox.SelectAll();
                    _isOperating = false;
                    isRangeError = false;
                }
                else
                {
                    exportBtn.PerformClick();
                }
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
            finally
            {
                DbAccess.UpdateFngset(schno);
            }
        }
Exemple #5
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);
        }