Ejemplo n.º 1
0
        private void quitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                if (station == null)
                {
                    MessageBox.Show("无法取得站台信息", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                station.INTO_FLAG = "1";
                station.Save();

                FNJISEKIEntity jiseki = new FNJISEKIEntity();
                jiseki.SAGYOKBN    = "G";
                jiseki.USERID      = GlobalAccess.UserId;
                jiseki.USERNAME    = GlobalAccess.UserName;
                jiseki.SAKUSEIHIJI = DateTime.Now.ToString("yyyyMMddHHmmss");
                jiseki.ENDSTNO     = GlobalAccess.StationNo;
                jiseki.Save();

                this.Close();
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
        }
Ejemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                if (station == null)
                {
                    MessageBox.Show("无法取得站台信息", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                station.INTO_FLAG = rdoAllowed.Checked ? "0" : "1";
                station.Save();

                FNJISEKIEntity jiseki = new FNJISEKIEntity();
                jiseki.SAGYOKBN    = rdoAllowed.Checked ? "F" : "G";
                jiseki.USERID      = GlobalAccess.UserId;
                jiseki.USERNAME    = GlobalAccess.UserName;
                jiseki.SAKUSEIHIJI = DateTime.Now.ToString("yyyyMMddHHmmss");
                jiseki.ENDSTNO     = GlobalAccess.StationNo;
                jiseki.Save();

                MessageBox.Show("设定成功", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                setUI();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 3
0
        private void checkStockInMode()
        {
            FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);

            if (station == null)
            {
                return;
            }
            if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
            {
                if (statusBox.Text != "空箱登录模式")
                {
                    setStatusBox("空箱登录模式");
                    setUIOnEmptyBucketMode();
                    ClearAll();
                    msgBox.Text = string.Empty;
                }
            }
            else
            {
                if (statusBox.Text != "正常")
                {
                    setStatusBox("正常");
                    setUIOnNormalMode();
                    ClearAll();
                    msgBox.Text = string.Empty;
                }
            }
        }
Ejemplo n.º 4
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);

            if (station == null)
            {
                return;
            }
            txtEnterStatus.Text      = station.INTO_FLAG == "0" ? "许可" : "禁止";
            txtEnterStatus.BackColor = station.INTO_FLAG == "0" ? Color.Lime : Color.Red;
        }
Ejemplo n.º 5
0
        private bool DoBucketNo()
        {
            if (string.IsNullOrEmpty(bucketNoBox.Text))
            {
                msgBox.Text = "BucketNo不可为空";
                return(false);
            }

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

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

            if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
            {
                setStatusBox("空箱登录模式");
                bucketWeightBox.Clear();
                return(true);
            }
            else if (station.NYUSYUMODE == Nyusyumode.Normal)    //入库模式
            {
                _bucket = DbAccess.GetBucket(bucketNoBox.Text);
                if (_bucket == null)
                {
                    setStatusBox("空箱未登录");
                    bucketWeightBox.Clear();
                    return(false);
                }

                if (DbAccess.IsBucketInAutoWarehouse(_bucket.BUCKET_NO) ||
                    DbAccess.IsBucketInLocation(_bucket.BUCKET_NO))
                {
                    setStatusBox("Bucket重复");
                    bucketWeightBox.Clear();
                    return(false);
                }

                setStatusBox("正常");
                bucketWeightBox.Text = _bucket.PACKING_WEIGHT.ToString();
                ticketNoBox.Focus();
                ticketNoBox.SelectAll();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 6
0
        public static string GetStockInMode(string stationNo)
        {
            FNSTATIONEntity station = DbAccess.GetStation(stationNo);

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

            if (station.NYUSYUMODE == Nyusyumode.Normal)
            {
                return(StockInMode.Normal);
            }
            else if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
            {
                return(StockInMode.EmptyBucket);
            }
            return(null);
        }
Ejemplo n.º 7
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);
                    }
                }

                FNSTATIONEntity station = DbAccess.GetStation(GlobalAccess.StationNo);
                if (station == null)
                {
                    return;
                }

                if (station.NYUSYUMODE == Nyusyumode.Empty_Bucket)
                {
                    setStatusBox("空箱登录模式");
                }
                else if (station.NYUSYUMODE == Nyusyumode.Normal)    //入库模式
                {
                    if (string.IsNullOrEmpty(statusBox.Text.Trim()) || statusBox.Text == "空箱登录模式")
                    {
                        setStatusBox("正常");
                    }
                }
            }
            catch (Exception ex)
            {
                msgBox.Text = ex.Message;
            }
        }
Ejemplo n.º 8
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();
            }
        }
Ejemplo n.º 9
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;
            }
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 12
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);
        }