/// <summary>
        /// 厂家 废弃
        /// </summary>
        private void Dispose(string data)
        {
            tbDocno.Text = GetDocNo();

            string sql = "update pacsd_pm_box set final_move_type = '551',final_move_code = 'MOVE0601',final_doc_no = :final_doc_no," +
                         " last_doc_no = final_doc_no,operation_window = 'SCRAP',box_case_status = :box_case_status,box_status = :box_status," +
                         " update_date = to_char(sysdate,'yyyyMMdd'),update_time = to_char(sysdate,'hh24miss'),update_user = :update_user,update_ip = :update_ip,final_vend_to = :final_vend_to " +
                         " where box_label = '" + data + "' " +
                         " and fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' ";

            OracleParameter[] cmdParam = new OracleParameter[] {
                new OracleParameter(":final_doc_no", OracleType.VarChar, 50),
                new OracleParameter(":update_user", OracleType.VarChar, 50),
                new OracleParameter(":update_ip", OracleType.VarChar, 50),
                new OracleParameter(":box_case_status", OracleType.VarChar, 50),
                new OracleParameter(":box_status", OracleType.VarChar, 50),
                new OracleParameter(":final_vend_to", OracleType.VarChar, 50)    //add by dyz@2014/10/5 [5]
            };
            cmdParam[0].Value = docno;
            cmdParam[1].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[2].Value = PaCSGlobal.GetClientIp();

            DataTable dtStatus = TonerGlobal.GetCommInfoByCode("MOVE0601");

            if (dtStatus.Rows.Count > 0)
            {
                cmdParam[3].Value = dtStatus.Rows[0]["BOX_CASE_STATUS"].ToString();
                cmdParam[4].Value = dtStatus.Rows[0]["BOX_STATUS"].ToString();
            }
            else
            {
                cmdParam[3].Value = "";
                cmdParam[4].Value = "";
            }

            cmdParam[5].Value = PaCSGlobal.LoginUserInfo.Venderid;

            int i = OracleHelper.ExecuteNonQuery(sql, cmdParam);

            //插入prog表
            TonerGlobal.InsertIntoProg(data);
            lbStatus.Text         = "【" + data + "】:废弃成功";
            panelStatus.BackColor = Color.GreenYellow;
            //提示成功语音
            PaCSGlobal.PlayWavOk();

            //刷新列表
            TonerGlobal.SetGridView(GetData(docno), gridView1, gridControl1);
        }
Beispiel #2
0
        private void Init()
        {
            cmbVendor.Properties.BeginUpdate();
            TonerGlobal.LoadCmbVendor(cmbVendor);
            cmbVendor.Properties.EndUpdate();

            if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C660A"))
            {
                cmbDPI.SelectedIndex = 0;
            }
            else if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C6H0A"))
            {
                cmbDPI.SelectedIndex = 1;
            }
        }
Beispiel #3
0
        private void Init()
        {
            PaCSGlobal.InitComPort("Toner", "GRCJ", ports);

            if (ports[0].IsOpen)
            {
                ports[0].DataReceived += new SerialDataReceivedEventHandler(serialPortGRCJ_DataReceived);//重新绑定
            }
            switch (PaCSGlobal.LoginUserInfo.Venderid)
            {
            case "C660":
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadBufferByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                break;

            case "C6H0":
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadBufferByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                break;

            case "O-0192":
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadBufferByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                break;

            case "L107LO":
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadStockByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                break;

            case "C660_SVC":
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadStockByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                break;

            default:
                cmbLoc.Properties.BeginUpdate();
                TonerGlobal.LoadStockByVendCode(cmbLoc);
                cmbLoc.Properties.EndUpdate();
                cmbLoc.SelectedIndex = 0;
                break;
            }
        }
 //使用类型
 private void cmbType_SelectedIndexChanged(object sender, EventArgs e)
 {
     cmbDest.Properties.Items.Clear();
     if (cmbType.SelectedIndex == 0)//到buffer 楼层
     {
         cmbDest.Properties.BeginUpdate();
         TonerGlobal.LoadBufferByVendCode(cmbDest);
         cmbDest.Properties.EndUpdate();
     }
     else if (cmbType.SelectedIndex == 1)//到其他厂家
     {
         cmbDest.Properties.BeginUpdate();
         TonerGlobal.LoadCmbUseVendor(cmbDest, true);
         cmbDest.Properties.EndUpdate();
     }
     else if (cmbType.SelectedIndex == 2)//销售出库(svc,先优)
     {
         cmbDest.Properties.Items.Clear();
     }
 }
Beispiel #5
0
        /// <summary>
        /// 厂家 废弃
        /// </summary>
        private void Dispose(string data)
        {
            string sql = "update pacsd_pm_box set final_move_type = '551',final_move_code = 'MOVE0601',final_doc_no = :final_doc_no," +
                         " last_doc_no = final_doc_no,operation_window = 'SCRAP',box_case_status = :box_case_status,box_status = :box_status," +
                         " update_date = to_char(sysdate,'yyyyMMdd'),update_time = to_char(sysdate,'hh24miss'),update_user = :update_user,update_ip = :update_ip " +
                         " where box_label = '" + data + "' " +
                         " and fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' ";

            OracleParameter[] cmdParam = new OracleParameter[] {
                new OracleParameter(":final_doc_no", OracleType.VarChar, 50),
                new OracleParameter(":update_user", OracleType.VarChar, 50),
                new OracleParameter(":update_ip", OracleType.VarChar, 50),
                new OracleParameter(":box_case_status", OracleType.VarChar, 50),
                new OracleParameter(":box_status", OracleType.VarChar, 50)
            };
            cmdParam[0].Value = TonerGlobal.GenerateDocNo();
            cmdParam[1].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[2].Value = PaCSGlobal.GetClientIp();

            DataTable dtStatus = TonerGlobal.GetCommInfoByCode("MOVE0601");

            if (dtStatus.Rows.Count > 0)
            {
                cmdParam[3].Value = dtStatus.Rows[0]["BOX_CASE_STATUS"].ToString();
                cmdParam[4].Value = dtStatus.Rows[0]["BOX_STATUS"].ToString();
            }
            else
            {
                cmdParam[3].Value = "";
                cmdParam[4].Value = "";
            }

            int i = OracleHelper.ExecuteNonQuery(sql, cmdParam);

            //插入prog表
            TonerGlobal.InsertIntoProg(data);
            //提示成功语音
            PaCSGlobal.PlayWavOk();
            XtraMessageBox.Show("废弃成功!", "提示");
        }
        private void Init()
        {
            PaCSGlobal.InitComPort("Toner", "GICJ", ports);

            if (ports[0].IsOpen)
            {
                ports[0].DataReceived += new SerialDataReceivedEventHandler(serialPortGICJ_DataReceived);//重新绑定
            }
            cmbLoc.Properties.BeginUpdate();
            TonerGlobal.LoadStockByVendCode(cmbLoc);
            cmbLoc.Properties.EndUpdate();
            cmbLoc.SelectedIndex = 0;

            cmbDest.Properties.BeginUpdate();
            TonerGlobal.LoadBufferByVendCode(cmbDest);
            cmbDest.Properties.EndUpdate();

            if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C6H0A")) //2014/12/03
            {
                GIType = 1;                                        //0:buffer 1:其他厂家
                cmbType.SelectedIndex = 1;
                cmbType.Enabled       = false;
            }
        }
Beispiel #7
0
        /// <summary>
        /// 厂家 入库
        /// </summary>
        private void GR(string data)
        {
            tbDocno.Text = GetDocNo();

            string moveType   = "";
            string moveCode   = "";
            string stockCode  = "";
            string bufferCode = "";

            switch (PaCSGlobal.LoginUserInfo.Venderid)
            {
            case "C660":
                moveType   = "311";  //SSSDP入库到Buffer
                moveCode   = "MOVE0302";
                stockCode  = "SSDP_STOCK";
                bufferCode = (cmbLoc.SelectedItem as ComboxData).Value;    //楼层
                break;

            case "C6H0":
                moveType   = "311";  //SSSDP入库到Buffer
                moveCode   = "MOVE0302";
                stockCode  = "SESC_STOCK";
                bufferCode = (cmbLoc.SelectedItem as ComboxData).Value;    //楼层
                break;

            case "O-0192":
                moveType   = "311";  //SSSDP入库到Buffer
                moveCode   = "MOVE0302";
                stockCode  = "EVA_6TH_STOCK";
                bufferCode = (cmbLoc.SelectedItem as ComboxData).Value;    //楼层
                break;

            case "L107LO":
                moveType  = "551";   //厂家入库Stock
                moveCode  = "MOVE0303";
                stockCode = (cmbLoc.SelectedItem as ComboxData).Value;
                break;

            case "C660_SVC":
                moveType  = "551";   //厂家入库Stock
                moveCode  = "MOVE0303";
                stockCode = (cmbLoc.SelectedItem as ComboxData).Value;
                break;

            default:
                moveType  = "352";   //厂家入库Stock
                moveCode  = "MOVE0301";
                stockCode = (cmbLoc.SelectedItem as ComboxData).Value;
                break;
            }

            string sql = "update pacsd_pm_box set final_move_type = '" + moveType + "',final_move_code = '" + moveCode + "',final_buffer_to = :final_buffer_to,final_stock_to = :final_stock_to," +
                         " final_doc_no = :final_doc_no,last_doc_no = final_doc_no,operation_window = 'GRCJ',box_case_status = :box_case_status,box_status = :box_status," +
                         " update_date = to_char(sysdate,'yyyyMMdd'),update_time = to_char(sysdate,'hh24miss'),update_user = :update_user,update_ip = :update_ip,final_vend_to = :final_vend_to " +
                         " where box_label = '" + data + "' " +
                         " and fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' ";

            OracleParameter[] cmdParam = new OracleParameter[] {
                new OracleParameter(":final_doc_no", OracleType.VarChar, 50),
                new OracleParameter(":update_user", OracleType.VarChar, 50),
                new OracleParameter(":update_ip", OracleType.VarChar, 50),
                new OracleParameter(":box_case_status", OracleType.VarChar, 50),
                new OracleParameter(":box_status", OracleType.VarChar, 50),
                new OracleParameter(":final_buffer_to", OracleType.VarChar, 50),
                new OracleParameter(":final_stock_to", OracleType.VarChar, 50),
                new OracleParameter(":final_vend_to", OracleType.VarChar, 50)    //add by dyz@2014/10/5 [7]
            };
            cmdParam[0].Value = docno;
            cmdParam[1].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[2].Value = PaCSGlobal.GetClientIp();

            DataTable dtStatus = TonerGlobal.GetCommInfoByCode(moveCode);

            if (dtStatus.Rows.Count > 0)
            {
                cmdParam[3].Value = dtStatus.Rows[0]["BOX_CASE_STATUS"].ToString();
                cmdParam[4].Value = dtStatus.Rows[0]["BOX_STATUS"].ToString();
            }
            else
            {
                cmdParam[3].Value = "";
                cmdParam[4].Value = "";
            }
            cmdParam[5].Value = bufferCode;
            cmdParam[6].Value = stockCode;

            cmdParam[7].Value = PaCSGlobal.LoginUserInfo.Venderid;

            int i = OracleHelper.ExecuteNonQuery(sql, cmdParam);

            //插入prog表
            TonerGlobal.InsertIntoProg(data);
            lbStatus.Text         = "【" + data + "】:入库成功";
            panelStatus.BackColor = Color.GreenYellow;
            //提示成功语音
            PaCSGlobal.PlayWavOk();
            //刷新列表
            TonerGlobal.SetGridView(GetData(docno), gridView1, gridControl1);
        }
Beispiel #8
0
        private void DoData(string data)
        {
            flagCancel = checkEdit2.Checked;//是否是入库取消模式

            //要委托的代码
            tbBucket.Text           = receivedata;
            tbBucket.SelectionStart = receivedata.Length;

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);

            if (dtThis.Rows.Count == 0)
            {
                PaCSGlobal.Speak("库存中不存在");
                lbStatus.Text         = "【" + data + "】:库存中不存在";
                panelStatus.BackColor = Color.Yellow;
                return;
            }
            curentMoveType = dtThis.Rows[0]["movetype"].ToString(); //获取当前MOVE_TYPE
            curentMoveCode = dtThis.Rows[0]["movecode"].ToString(); //获取当前MOVE_CODE

            //add by dyz@2014/10/5
            if (curentMoveType.Equals("999"))
            {
                GR(data);
                return;
            }

            if (flagCancel)
            {
                //入库取消 模式
                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("GRCJ"))
                {
                    PaCSGlobal.Speak("不能在此做取消操作");
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                CancelGR(data);
                tbBucket.Text = "";
            }
            else
            {
                //入库
                if (cmbLoc.SelectedIndex == -1)
                {
                    PaCSGlobal.Speak("请选择 入库地点");
                    lbStatus.Text         = "请选择 入库地点";
                    panelStatus.BackColor = Color.Yellow;
                    cmbLoc.Focus();
                    return;
                }

                final_vend_to = dtThis.Rows[0]["final_vend_to"].ToString();//获取当前final_vend_to
                if (!final_vend_to.Equals(PaCSGlobal.LoginUserInfo.Venderid))
                {
                    PaCSGlobal.Speak("不是出库到此的,不能进行 【入库】");
                    lbStatus.Text         = "【" + data + "】:不是出库到此的,不能进行 【入库】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                //判断状态
                if (!curentMoveType.Equals("351"))
                {
                    string tip = "";
                    if (int.Parse(curentMoveCode.Substring(4, 4)) > 301 && int.Parse(curentMoveCode.Substring(4, 4)) != 402)
                    {
                        PaCSGlobal.Speak("碳粉已经入库,不能再次 【入库】");
                        tip = "碳粉已经入库,不能再次 【入库】";
                    }

                    PaCSGlobal.Speak(tip);
                    lbStatus.Text         = "【" + data + "】:" + tip;
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                GR(data);
                tbBucket.Text = "";
            }
        }
        private void DoData(string data)
        {
            flagCancel = checkEdit2.Checked;//是否是取消模式

            //要委托的代码
            tbBucket.Text           = receivedata;
            tbBucket.SelectionStart = receivedata.Length;

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);

            if (dtThis.Rows.Count == 0)
            {
                PaCSGlobal.Speak("库存中不存在");
                lbStatus.Text = "【" + data + "】:库存中不存在";

                panelStatus.BackColor = Color.Yellow;
                return;
            }
            curentMoveType = dtThis.Rows[0]["movetype"].ToString();//获取当前MOVE_TYPE

            //add by dyz@2014/10/5
            if (curentMoveType.Equals("999"))
            {
                Dispose(data);
                return;
            }

            if (flagCancel)
            {
                //废弃取消 模式
                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("SCRAP"))
                {
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                CancelDispose(data);
            }
            else
            {
                //废弃
                final_vend_to = dtThis.Rows[0]["final_vend_to"].ToString();//获取当前final_vend_to
                if (!final_vend_to.Equals(PaCSGlobal.LoginUserInfo.Venderid))
                {
                    lbStatus.Text         = "【" + data + "】:不是出库到此的,不能进行 【废弃】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                //判断状态
                if (!curentMoveType.Equals("261"))
                {
                    lbStatus.Text         = "【" + data + "】:没有出库到Line,不能进行 【废弃】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                //已废弃
                if (curentMoveType.Equals("551"))
                {
                    lbStatus.Text         = "【" + data + "】:已经 【废弃】,不能再次废弃!";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                Dispose(data);
            }
        }
        /// <summary>
        /// 原材料仓库 入库
        /// </summary>
        private void GR(string data)
        {
            //判断状态
            tbDocno.Text = GetDocNo();

            string lotNo = "";
            string boxNo = "";
            string qty   = "";

            if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C660A"))
            {
                lotNo = data.Substring(15, 6);
                boxNo = data.Substring(21, 4);
                qty   = data.Substring(25, 6);
            }
            else if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C6H0A"))
            {
                //SESC
                lotNo = data.Substring(15, 10);
                boxNo = data.Substring(11, 4);
                qty   = data.Substring(25, 6);
            }

            string sql = "insert into pacsd_pm_box(BOX_LABEL,ITEM,MAKE_VEND_CODE,LOT_NO,BOX_NO,QTY," +
                         " FINAL_MOVE_CODE,FINAL_MOVE_TYPE,FINAL_VEND_FROM,FINAL_VEND_TO,FINAL_DOC_NO," +
                         " CREATE_USER,CREATE_IP,BOX_CASE_STATUS,BOX_STATUS,OPERATION_WINDOW,update_date,update_time,update_user,update_ip,fct_code) " +
                         " values(:BOX_LABEL,:ITEM,:MAKE_VEND_CODE,:LOT_NO,:BOX_NO,:QTY," +
                         " :FINAL_MOVE_CODE,'101',:FINAL_VEND_FROM,:FINAL_VEND_TO,:FINAL_DOC_NO," +
                         " :CREATE_USER,:CREATE_IP,:BOX_CASE_STATUS,:BOX_STATUS,'GREJH',to_char(sysdate,'yyyyMMdd'),to_char(sysdate,'hh24miss'),:update_user,:update_ip,:fct_code) ";

            OracleParameter[] cmdParam = new OracleParameter[] {
                new OracleParameter(":BOX_LABEL", OracleType.VarChar, 50),
                new OracleParameter(":ITEM", OracleType.VarChar, 50),
                new OracleParameter(":MAKE_VEND_CODE", OracleType.VarChar, 50),
                new OracleParameter(":LOT_NO", OracleType.VarChar, 50),
                new OracleParameter(":BOX_NO", OracleType.VarChar, 50),
                new OracleParameter(":QTY", OracleType.VarChar, 50),
                new OracleParameter(":FINAL_MOVE_CODE", OracleType.VarChar, 50),
                new OracleParameter(":FINAL_VEND_FROM", OracleType.VarChar, 50),
                new OracleParameter(":FINAL_VEND_TO", OracleType.VarChar, 50),
                new OracleParameter(":FINAL_DOC_NO", OracleType.VarChar, 50),
                new OracleParameter(":CREATE_USER", OracleType.VarChar, 20),
                new OracleParameter(":CREATE_IP", OracleType.VarChar, 20),
                new OracleParameter(":BOX_CASE_STATUS", OracleType.VarChar, 20),
                new OracleParameter(":BOX_STATUS", OracleType.VarChar, 20),
                new OracleParameter(":update_user", OracleType.VarChar, 20),
                new OracleParameter(":update_ip", OracleType.VarChar, 20),
                new OracleParameter(":fct_code", OracleType.VarChar, 20)
            };
            cmdParam[0].Value  = data;
            cmdParam[1].Value  = item;
            cmdParam[2].Value  = vendor;
            cmdParam[3].Value  = lotNo;
            cmdParam[4].Value  = boxNo;
            cmdParam[5].Value  = qty;
            cmdParam[6].Value  = "MOVE0101";
            cmdParam[7].Value  = vendor;
            cmdParam[8].Value  = vend_to;
            cmdParam[9].Value  = docno;
            cmdParam[10].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[11].Value = PaCSGlobal.GetClientIp();

            DataTable dtStatus = TonerGlobal.GetCommInfoByCode("MOVE0101");

            if (dtStatus.Rows.Count > 0)
            {
                cmdParam[12].Value = dtStatus.Rows[0]["BOX_CASE_STATUS"].ToString();
                cmdParam[13].Value = dtStatus.Rows[0]["BOX_STATUS"].ToString();
            }
            else
            {
                cmdParam[12].Value = "";
                cmdParam[13].Value = "";
            }
            cmdParam[14].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[15].Value = PaCSGlobal.GetClientIp();
            cmdParam[16].Value = PaCSGlobal.LoginUserInfo.Fct_code;

            int i = OracleHelper.ExecuteNonQuery(sql, cmdParam);

            //插入prog表
            TonerGlobal.InsertIntoProg(data);
            lbStatus.Text         = "【" + data + "】:入库成功";
            panelStatus.BackColor = Color.GreenYellow;
            //提示成功语音
            PaCSGlobal.PlayWavOk();
            //刷新列表
            TonerGlobal.SetGridView(GetData(docno), gridView1, gridControl1);
        }
        private void DoData(string data)
        {
            if (cmbVendor.SelectedIndex == -1)
            {
                PaCSGlobal.Speak("请选择 生产厂家");
                lbStatus.Text         = "请选择 生产厂家";
                panelStatus.BackColor = Color.Yellow;
                cmbVendor.Focus();
                return;
            }
            else if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C660A"))
            {
                vendor  = (cmbVendor.SelectedItem as ComboxData).Value;//制造厂家
                vend_to = "DRI2";
                if (!vendor.Equals(data.Substring(11, 4)))
                {
                    PaCSGlobal.Speak("扫描碳粉生产厂家与选择厂家不符");
                    lbStatus.Text         = "扫描碳粉生产厂家【" + PaCSGlobal.GetVendorNameByCode(data.Substring(11, 4)) + "】与选择厂家【" + (cmbVendor.SelectedItem as ComboxData).Text + "】不符";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
            }
            else if (PaCSGlobal.LoginUserInfo.Fct_code.Equals("C6H0A"))
            {
                vendor = (cmbVendor.SelectedItem as ComboxData).Value;//制造厂家
                //vendor = "R100";
                vend_to = "RCAE";
                if (data.Substring(11, 4).Equals("R100"))
                {
                    PaCSGlobal.Speak("请扫描标签下方的条码");
                    lbStatus.Text         = "请扫描标签下方的条码";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
            }

            if (cmbItem.SelectedIndex == -1)
            {
                PaCSGlobal.Speak("请选择 材料编号");
                lbStatus.Text         = "请选择 材料编号";
                panelStatus.BackColor = Color.Yellow;
                cmbItem.Focus();
                return;
            }
            else
            {
                item = cmbItem.SelectedItem.ToString();
                if (!item.Equals(data.Substring(0, 11)))
                {
                    PaCSGlobal.Speak("扫描碳粉材料编号与选择编号不符");
                    lbStatus.Text         = "扫描碳粉材料编号与选择编号不符";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
            }

            flagCancel = checkEdit2.Checked;//是否是入库取消模式

            //要委托的代码
            tbBucket.Text           = receivedata;
            tbBucket.SelectionStart = receivedata.Length;

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);//获取扫描的记录信息(未入库000,已入库101,入库取消102)


            if (flagCancel)
            {
                //入库取消 模式
                if (dtThis.Rows.Count == 0)
                {
                    PaCSGlobal.Speak("库存中不存在");
                    lbStatus.Text         = "【" + data + "】:库存中不存在";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("GREJH"))
                {
                    PaCSGlobal.Speak("不能在此做取消操作");
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                CancelGR(data);
                tbBucket.Text = "";
            }
            else
            {
                //入库
                switch (radioGroup1.SelectedIndex)
                {
                case 0:    //首次入库
                    if (dtThis.Rows.Count > 0)
                    {
                        PaCSGlobal.Speak("已入库,不能再次入库");
                        lbStatus.Text         = "【" + data + "】:已入库,不能再次入库";
                        panelStatus.BackColor = Color.Yellow;
                        return;
                    }
                    GR(data);    //insert
                    tbBucket.Text = "";
                    break;

                case 1:    //返退入库
                    if (dtThis.Rows.Count == 0)
                    {
                        PaCSGlobal.Speak("库存中不存在");
                        lbStatus.Text         = "【" + data + "】:库存中不存在!";
                        panelStatus.BackColor = Color.Yellow;
                        return;
                    }
                    else
                    {
                        curentMoveType = dtThis.Rows[0]["movetype"].ToString();    //获取当前MOVE_TYPE
                        if (!curentMoveType.Equals("351"))
                        {
                            PaCSGlobal.Speak("不是在途状态,不能入库");
                            lbStatus.Text         = "【" + data + "】:不是在途状态,不能入库";
                            panelStatus.BackColor = Color.Yellow;
                            return;
                        }
                    }
                    GRAgain(data);    //update
                    tbBucket.Text = "";
                    break;
                }
            }
        }
        private void DoData(string data)
        {
            flagCancel = checkEdit2.Checked;        //是否是出库取消模式
            flagType   = radioGroup1.SelectedIndex; //出库类型

            //要委托的代码
            tbBucket.Text           = receivedata;
            tbBucket.SelectionStart = receivedata.Length;

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);

            if (dtThis.Rows.Count == 0)
            {
                PaCSGlobal.Speak("库存中不存在");
                lbStatus.Text         = "【" + data + "】:库存中不存在";
                panelStatus.BackColor = Color.Yellow;
                return;
            }
            curentMoveType = dtThis.Rows[0]["movetype"].ToString(); //获取当前MOVE_TYPE
            curentMoveCode = dtThis.Rows[0]["movecode"].ToString(); //获取当前MOVE_CODE

            if (flagCancel)
            {
                //出库取消 模式
                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("GIEJH"))
                {
                    PaCSGlobal.Speak("不能在此做取消操作");
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                CancelGI(data);
            }
            else
            {
                //出库
                final_vend_to = dtThis.Rows[0]["final_vend_to"].ToString();//获取当前final_vend_to
                if (!final_vend_to.Equals(PaCSGlobal.LoginUserInfo.Venderid))
                {
                    PaCSGlobal.Speak("不在此处,不能进行 【出库】");
                    lbStatus.Text         = "【" + data + "】:不在此处,不能进行 【出库】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                switch (flagType)
                {
                case 0:    //正常出库
                    if (cmbDestVendor.SelectedIndex == -1)
                    {
                        PaCSGlobal.Speak("请选择 目的厂家");
                        lbStatus.Text         = "请选择 目的厂家";
                        panelStatus.BackColor = Color.Yellow;
                        cmbDestVendor.Focus();
                        return;
                    }
                    else
                    {
                        vendorDest = (cmbDestVendor.SelectedItem as ComboxData).Value;    //目的厂家
                    }

                    //判断状态
                    if (!curentMoveType.Equals("101"))
                    {
                        string tip = "";
                        if (int.Parse(curentMoveCode.Substring(4, 4)) >= 201)
                        {
                            PaCSGlobal.Speak("碳粉已经出库,不能再次 【出库】");
                            tip = "碳粉已经出库,不能再次 【出库】";
                        }

                        PaCSGlobal.Speak(tip);
                        lbStatus.Text         = "【" + data + "】:" + tip;
                        panelStatus.BackColor = Color.Yellow;
                        return;
                    }
                    GI(data);
                    break;

                case 1:    //返退出库
                    GIBack(data);
                    break;

                case 2:    //出库即报废
                    if (String.IsNullOrEmpty(tbERP.Text.Trim()))
                    {
                        PaCSGlobal.Speak("请填写 【ERP秉义号】");
                        lbStatus.Text         = "请填写 【ERP秉义号】";
                        panelStatus.BackColor = Color.Yellow;
                        tbERP.Focus();
                        return;
                    }
                    GIScrap(data);
                    break;
                }
            }
        }
        /// <summary>
        /// 厂家 出库
        /// </summary>
        private void GI(string data)
        {
            string moveCode = "";

            switch (GIType)
            {
            case 0:
                moveCode = "MOVE0401";    //buffer
                break;

            case 1:
                moveCode = "MOVE0402";    //其他厂家
                break;
            }

            tbDocno.Text = GetDocNo();

            string stock_block = GIType == 0 ? "" : "final_stock_to = null,";//final_stock_to = decode(GIType,0,final_stock_to,null)
            //出库
            string sql = "update pacsd_pm_box set final_move_type = '" + destMoveType + "',final_move_code = '" + moveCode + "',final_vend_to = :final_vend_to, final_vend_from = final_vend_to," + stock_block +
                         " final_buffer_to = :final_buffer_to,final_doc_no = :final_doc_no,last_doc_no = final_doc_no,operation_window = 'GICJ',box_case_status = :box_case_status,box_status = :box_status, " +
                         " update_date = to_char(sysdate,'yyyyMMdd'),update_time = to_char(sysdate,'hh24miss'),update_user = :update_user,update_ip = :update_ip" +
                         " where box_label = '" + data + "' " +
                         " and fct_code = '" + PaCSGlobal.LoginUserInfo.Fct_code + "' ";

            OracleParameter[] cmdParam = new OracleParameter[] {
                new OracleParameter(":final_vend_to", OracleType.VarChar, 50),
                new OracleParameter(":final_doc_no", OracleType.VarChar, 50),
                new OracleParameter(":update_user", OracleType.VarChar, 50),
                new OracleParameter(":update_ip", OracleType.VarChar, 50),
                new OracleParameter(":box_case_status", OracleType.VarChar, 50),
                new OracleParameter(":box_status", OracleType.VarChar, 50),
                new OracleParameter(":final_buffer_to", OracleType.VarChar, 50)
            };

            cmdParam[0].Value = GIType == 0 ? PaCSGlobal.LoginUserInfo.Venderid : destCode;
            cmdParam[1].Value = docno;
            cmdParam[2].Value = PaCSGlobal.LoginUserInfo.Id;
            cmdParam[3].Value = PaCSGlobal.GetClientIp();

            DataTable dtStatus = TonerGlobal.GetCommInfoByCode(moveCode);

            if (dtStatus.Rows.Count > 0)
            {
                cmdParam[4].Value = dtStatus.Rows[0]["BOX_CASE_STATUS"].ToString();
                cmdParam[5].Value = dtStatus.Rows[0]["BOX_STATUS"].ToString();
            }
            else
            {
                cmdParam[4].Value = "";
                cmdParam[5].Value = "";
            }

            cmdParam[6].Value = GIType == 0 ? destCode : "";

            int i = OracleHelper.ExecuteNonQuery(sql, cmdParam);

            //插出prog表
            TonerGlobal.InsertIntoProg(data);
            lbStatus.Text         = "【" + data + "】:出库成功";
            panelStatus.BackColor = Color.GreenYellow;
            //提示成功语音
            PaCSGlobal.PlayWavOk();
            //刷新列表
            TonerGlobal.SetGridView(GetData(docno), gridView1, gridControl1);
        }
        private void DoData(string data)
        {
            string loc = "";

            flagCancel = checkEdit2.Checked;//是否是出库取消模式

            //要委托的代码
            tbBucket.Text           = receivedata;
            tbBucket.SelectionStart = receivedata.Length;

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);

            if (dtThis.Rows.Count == 0)
            {
                PaCSGlobal.Speak("库存中不存在");
                lbStatus.Text         = "【" + data + "】:库存中不存在";
                panelStatus.BackColor = Color.Yellow;
                return;
            }
            curentMoveType = dtThis.Rows[0]["movetype"].ToString(); //获取当前MOVE_TYPE
            curentMoveCode = dtThis.Rows[0]["movecode"].ToString(); //获取当前MOVE_CODE

            //add by dyz@2014/10/5
            GIType       = cmbType.SelectedIndex;       //0:buffer -- 1:其他厂家
            destMoveType = GIType == 0 ? "311" : "351"; //目的移动类型
            if (curentMoveType.Equals("999"))
            {
                GI(data);
                return;
            }

            if (flagCancel)
            {
                //出库取消 模式
                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("GICJ"))
                {
                    PaCSGlobal.Speak("不能在此做取消操作");
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                CancelGI(data);
                tbBucket.Text = "";
            }
            else
            {
                if (cmbDest.SelectedIndex == -1 && cmbType.SelectedIndex != 2)
                {
                    PaCSGlobal.Speak("请选择 出库目的地");
                    lbStatus.Text         = "请选择 出库目的地";
                    panelStatus.BackColor = Color.Yellow;
                    cmbDest.Focus();
                    return;
                }
                else
                {
                    destCode = (cmbDest.SelectedItem as ComboxData).Value;//目的地
                }

                final_stock_to = dtThis.Rows[0]["final_stock_to"].ToString();//获取当前final_vend_to
                if (cmbLoc.SelectedIndex > -1)
                {
                    loc = (cmbLoc.SelectedItem as ComboxData).Value;
                    if (!loc.Equals(final_stock_to))
                    {
                        PaCSGlobal.Speak("所在库存位置与选择库存位置不符");
                        lbStatus.Text         = "所在库存位置与选择库存位置不符";
                        panelStatus.BackColor = Color.Yellow;
                        return;
                    }
                }

                //出库
                final_vend_to = dtThis.Rows[0]["final_vend_to"].ToString();//获取当前final_vend_to
                if (!final_vend_to.Equals(PaCSGlobal.LoginUserInfo.Venderid))
                {
                    PaCSGlobal.Speak("不在此处,不能进行 【出库】");
                    lbStatus.Text         = "【" + data + "】:不在此处,不能进行 【出库】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                //判断状态
                if (!curentMoveType.Equals("352") && !curentMoveType.Equals("311"))
                {
                    string tip = "";
                    if (int.Parse(curentMoveCode.Substring(4, 4)) < 301)
                    {
                        PaCSGlobal.Speak("碳粉尚未入库,不能进行 【出库】");
                        tip = "碳粉尚未入库,不能进行 【出库】";
                    }
                    else if (int.Parse(curentMoveCode.Substring(4, 4)) > 302)////
                    {
                        PaCSGlobal.Speak("碳粉已经出库,不能再次 【出库】");
                        tip = "碳粉已经出库,不能再次 【出库】";
                    }

                    PaCSGlobal.Speak(tip);
                    lbStatus.Text         = "【" + data + "】:" + tip;
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                GIType = cmbType.SelectedIndex;

                switch (GIType)
                {
                case 0:
                    destMoveType = "311";    //buffer
                    break;

                case 1:
                    destMoveType = "351";    //其他厂家
                    break;
                }

                //  destMoveType = GIType == 0 ? "311" : "351";//目的移动类型

                GI(data);
                tbBucket.Text = "";
            }
        }
        private void DoData(string data)
        {
            flagCancel = checkEdit2.Checked;//是否是出库取消模式

            DataTable dtThis = TonerGlobal.ScanRecordStatus(data);

            if (dtThis.Rows.Count == 0)
            {
                PaCSGlobal.Speak("库存中不存在");
                lbStatus.Text         = "【" + data + "】:库存中不存在";
                panelStatus.BackColor = Color.Yellow;
                return;
            }
            curentMoveType = dtThis.Rows[0]["movetype"].ToString();//获取当前MOVE_TYPE

            //add by dyz@2014/10/5
            if (curentMoveType.Equals("999"))
            {
                GI(data);
                tbBucket.Text = "";
                return;
            }

            if (flagCancel)
            {
                //出库取消 模式
                currentDocno     = dtThis.Rows[0]["currentDocno"].ToString();     //获取当前finaldocno
                lastdocno        = dtThis.Rows[0]["lastdocno"].ToString();        //获取当前lastdocno
                operation_window = dtThis.Rows[0]["operation_window"].ToString(); //获取当前operation_window

                if (!operation_window.Equals("LINE"))
                {
                    PaCSGlobal.Speak("不能在此做取消操作");
                    lbStatus.Text         = "【" + data + "】:不能在此做取消操作";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                tbBucket.Text           = receivedata;
                tbBucket.SelectionStart = receivedata.Length;
                CancelGI(data);
                tbBucket.Text = "";
            }
            else
            {
                //校验楼层
                finalBuffer = dtThis.Rows[0]["final_buffer_to"].ToString();//获取当前MOVE_TYPE

                if (cmbBuffer.SelectedIndex == -1)
                {
                    PaCSGlobal.Speak("请选择 来自楼层");
                    lbStatus.Text         = "请选择 来自楼层";
                    panelStatus.BackColor = Color.Yellow;
                    cmbBuffer.Focus();
                    return;
                }
                else if (!(cmbBuffer.SelectedItem as ComboxData).Value.Equals(finalBuffer))
                {
                    PaCSGlobal.Speak("所在楼层与选择楼层不符");
                    lbStatus.Text         = "【" + data + "】:所在楼层与选择楼层不符";
                    panelStatus.BackColor = Color.Yellow;
                    cmbBuffer.Focus();
                    return;
                }

                if (cmbLine.SelectedIndex == -1)
                {
                    PaCSGlobal.Speak("请选择 生产线");
                    lbStatus.Text         = "请选择 生产线";
                    panelStatus.BackColor = Color.Yellow;
                    cmbLine.Focus();
                    return;
                }
                else
                {
                    lineCode = (cmbLine.SelectedItem as ComboxData).Value;//目的地
                }

                //出库
                final_vend_to = dtThis.Rows[0]["final_vend_to"].ToString();//获取当前final_vend_to
                if (!final_vend_to.Equals(PaCSGlobal.LoginUserInfo.Venderid))
                {
                    PaCSGlobal.Speak("不在此处,不能进行 【出库】");
                    lbStatus.Text         = "【" + data + "】:不在此处,不能进行 【出库】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }

                //判断状态
                if (!curentMoveType.Equals("311"))
                {
                    PaCSGlobal.Speak("该碳粉不是缓冲区状态,不能进行 【出库】");
                    lbStatus.Text         = "【" + data + "】:不是Buffer状态,不能进行 【出库到Line】";
                    panelStatus.BackColor = Color.Yellow;
                    return;
                }
                tbBucket.Text           = receivedata;
                tbBucket.SelectionStart = receivedata.Length;
                GI(data);
                tbBucket.Text = "";
            }
        }