Пример #1
0
        private bool DoBucketNo()
        {
            string bucketNo = bucketNoBox.Text;

            zaiKo = DbAccess.GetZaiKoByBucketNo(bucketNo);
            if (zaiKo == null)
            {
                DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                msgBox.Text        = "没有库存数据";
                itemCodeBox.Text   = string.Empty;
                itemName1Box.Text  = string.Empty;
                itemName2Box.Text  = string.Empty;
                itemName3Box.Text  = string.Empty;
                colorCodeBox.Text  = string.Empty;
                planCountBox.Text  = string.Empty;
                planWeightBox.Text = string.Empty;
                unitWeightBox.Text = string.Empty;
                return(false);
            }
            else
            {
                if (zaiKo.STORAGE_PLACE_FLAG == "0") //非平库
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    msgBox.Text = "库存已存在";
                    return(false);
                }

                zKey = DbAccess.GetManagedZKey(zaiKo.ZAIKEY);
                if (zKey == null)
                {
                    DbAccess.callSwitchOnLight(GlobalAccess.StationNo, LightType.Data_Error);
                    msgBox.Text = "没有此Item主数据";
                    return(false);
                }
                else
                {
                    msgBox.Clear();

                    itemCodeBox.Text         = zKey.ZAIKEY;
                    itemName1Box.Text        = zKey.ZKNAME1;
                    itemName2Box.Text        = zKey.ZKNAME2;
                    itemName3Box.Text        = zKey.ZKNAME3;
                    colorCodeBox.Text        = zaiKo.COLOR_CODE;
                    planCountBox.Text        = zaiKo.PLAN_QTY.ToString();
                    planWeightBox.Text       = zaiKo.PLAN_WEIGHT.ToString();
                    unitWeightBox.Text       = zaiKo.REAL_UNIT_WEIGHT.ToString();
                    plasticBagStatusBox.Text = zaiKo.BAG_FLAG.Trim() == "1" ? "有" : "无";
                    fixedWeightBox.Text      = (GlobalAccess.FixedWeight * 1000).ToString();

                    DoRange(zaiKo); //处理原单位,入库许可上下限
                    return(true);
                }
            }
        }
Пример #2
0
        private void setBtn_Click(object sender, EventArgs e)
        {
            string schno = string.Empty;

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

                if (isOperating == false)
                {
                    return;
                }

                if (statusBox.Text == "空箱登录模式" || statusBox.Text == "正常")
                {
                    if (statusBox.Text == "正常")
                    {
                        if (string.IsNullOrEmpty(unitWeightBox.Text))
                        {
                            msgBox.Text = "请先获得单位重量";
                            unitWeightBox.Focus();
                            unitWeightBox.SelectAll();
                            return;
                        }

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

                        if (itemCountBox.Value <= 0)
                        {
                            msgBox.Text = "Item数量必须大于0";
                            weightLoadBtn.Focus();
                            return;
                        }
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        if (string.IsNullOrEmpty(itemWeightBox.Text))
                        {
                            msgBox.Text = "请先读取Item重量";
                            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.SYORIFLG = "0";
                    fngset.MOTOSTNO = GlobalAccess.StationNo;
                    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.TICKET_NO = ticketNoBox.Text;
                        fngset.BUCKET_NO = bucketNoBox.Text;
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        fngset.PACKING_WEIGHT = Convert.ToDecimal(itemWeightBox.Text);
                    }
                    fngset.Save();
                    DbAccess.callProcedure(schno, "stockin_3");
                    if (statusBox.Text == "正常")
                    {
                        FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByBucketNo(bucketNoBox.Text);
                        DbAccess.callAfterStockin(zaikoEntity.WEIGHT_REPORT_COMPLETE_FLAG);
                    }
                    else if (statusBox.Text == "空箱登录模式")
                    {
                        DbAccess.callAfterStockin(string.Empty);
                    }
                    msgBox.Text = "设定成功";
                    ClearAll();
                    weightLoadBtn.Focus();
                    isOperating  = false;
                    isRangeError = false;
                }
                else
                {
                    exportBtn.PerformClick();
                }
            }
            catch (Exception ex)
            {
                manCheck.Checked = true;
                msgBox.Text      = ex.Message;
            }
            finally
            {
                DbAccess.UpdateFngset(schno);
            }
        }
Пример #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);
        }