Пример #1
0
        private void frmDgv2_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F21)         //环形键
            {
                if (Global.curFrame.KZ == "重") //入库作业
                {
                    string data = Global.sUserId + AllCode.stringInterfaceChar;
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar;
                    data += Global.sBb + AllCode.stringInterfaceChar;                              //班别
                    data += Global.sZyq + AllCode.stringInterfaceChar;                             //作业区
                    data += Global.curFrame.TCH + AllCode.stringInterfaceChar;                     //停车号
                    data += Global.curFrame.QY + Global.curFrame.CH + AllCode.stringInterfaceChar; //车号

                    int    cnt = 0;
                    string msg = "";

                    foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils)
                    {
                        Coil c = kv.Value;
                        if (c.clh != "")
                        {
                            msg += c.p.barcode.Substring(c.p.barcode.Length - 3, 2) + AllCode.stringInterfaceChar;                  //层号
                            // msg += c.p.barcode + AllCode.stringInterfaceChar;                  //层号
                            //msg += c.zzdy + AllCode.stringInterfaceChar;                        //制造单元
                            msg += c.clh + AllCode.stringInterfaceChar;                        //材料号
                            //msg += c.scantime + AllCode.stringInterfaceChar;                  //扫描时间
                            // msg += c.qa + AllCode.stringInterfaceChar;                         //质量代码
                            // msg += c.scanflag.ToString() + AllCode.stringInterfaceChar;       //处理标志
                            // msg += c.wide + AllCode.stringInterfaceChar;                   //钢卷宽度
                            //msg += c.diameter + AllCode.stringInterfaceChar;                   //钢卷内径

                            cnt++;
                        }
                    }

                    if (cnt > 0)
                    {
                        data += cnt.ToString() + AllCode.stringInterfaceChar;//材料数量
                        if (msg.Length > 0)
                        {
                            msg = msg.Substring(0, msg.Length - 1);
                        }
                        data += msg;
                        data += AllCode.stringInterfaceChar;

                        if (Global.sDebug == "False")
                        {
                            frmMessage frmMessage = new frmMessage();
                            frmMessage.ShowDialog("是否上传入库手持扫描结果?", "选择", "确定", "取消");
                            if (frmMessage.ret == true)
                            {
                                Business.SendText(Business.msg.Package("ZDUA17", data));//入库手持扫描完成
                            }
                            frmMessage.Dispose();
                        }
                    }
                }
                else//出库作业
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += Global.curFrame.TCH + ";";
                    data += Global.curFrame.QY + Global.curFrame.CH + ";";

                    int    cnt = 0;
                    string msg = "";

                    foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils)
                    {
                        Coil c = kv.Value;
                        if (c.clh != "")
                        {
                            msg += c.p.barcode + ";";                   //逻辑位置
                            msg += c.zzdy + ";";                        //制造单元
                            msg += c.clh + ";";                         //材料号
                            msg += c.scantime + ";";                    //扫描时间
                            msg += c.qa + ";";                          //质量代码
                            msg += c.wide + ";";                        //钢卷宽度
                            msg += c.diameter + ";";                    //钢卷内径

                            cnt++;
                        }
                    }

                    if (cnt > 0)
                    {
                        data += cnt.ToString() + ";";
                        if (msg.Length > 0)
                        {
                            msg = msg.Substring(0, msg.Length - 1);
                        }
                        data += msg;

                        if (Global.sDebug == "False")
                        {
                            frmMessage frmMessage = new frmMessage();
                            frmMessage.ShowDialog("是否上传出库手持扫描结果?", "选择", "确定", "取消");
                            if (frmMessage.ret == true)
                            {
                                Business.SendText(Business.msg.Package("ZDUA07", data));//出库手持扫描完成
                            }
                            frmMessage.Dispose();
                        }
                    }
                }

                if (Global.curFrame.KZ == "重")
                {
                    frmSxChange frmSxChange = new frmSxChange();
                    Global.frmCurrent = frmSxChange;
                    frmSxChange.Owner = this;
                    frmSxChange.Show();
                    this.Hide();
                }
            }
            else if (e.KeyCode == Keys.Escape)
            {
                Global.frmCurrent = this.Owner;
                this.Owner.Show();
                this.Owner = null;
                this.Close();
            }
            else if (e.KeyCode == Keys.Tab)
            {
                if (Global.curFrame.KZ == "重")
                {
                    frmSxChange frmSxChange = new frmSxChange();
                    Global.frmCurrent = frmSxChange;
                    frmSxChange.Owner = this;
                    frmSxChange.Show();
                    this.Hide();
                }
            }
            else if (e.KeyCode == Keys.F5)//F1键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "15" + ";";//15号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制15号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F3)//F3键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "17" + ";";//17号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制17号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F4)//F4键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "21" + ";";//21号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制21号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F2)//F2键
            {
                if (Global.sDebug == "False")
                {
                    string data = Global.sUserId + ";";
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";";
                    data += Global.sBb + ";";
                    data += Global.sZyq + ";";
                    data += "22" + ";";//22号行车
                    data += System.DateTime.Now.ToString("yyyyMMddHHmmss");

                    Business.SendText(Business.msg.Package("ZDUA06", data));//控制22号行车紧停
                }
            }
            else if (e.KeyCode == Keys.F22 || e.KeyCode == Keys.F23)
            {
                if (curPoint.row >= 0)
                {
                    if (Global.coils.ContainsKey(curPoint))
                    {
                        Coil   coil = Global.coils[curPoint];
                        string clh  = coil.clh;
                        string qa   = coil.qa;
                        if (clh != "")
                        {
                            frmQuality frmQuality = new frmQuality();
                            Global.frmCurrent = frmQuality;
                            frmQuality.Owner  = this;
                            this.Hide();
                            frmQuality.Show(clh, qa, curPoint);
                        }

                        coil = null;
                    }
                }
            }
        }
Пример #2
0
        private void dgWtdCl_KeyUp(object sender, KeyEventArgs e)
        {
            if (curRow >= 0)
            {
                string jhh   = Global.storage.jhh;
                string clh   = dtCl.Rows[curRow]["CLH"].ToString();
                string lbl   = dtCl.Rows[curRow]["LBL"].ToString();
                string qa    = dtCl.Rows[curRow]["QA"].ToString();
                string kw    = dtCl.Rows[curRow]["KW"].ToString();
                string sJs   = dtCl.Rows[curRow]["JS"].ToString();
                string sZl   = dtCl.Rows[curRow]["ZL"].ToString();
                string sFlag = dtCl.Rows[curRow]["FLAG"].ToString();

                if (e.KeyCode == Keys.Enter)
                {
                    if (dtCl.Rows[curRow]["WCFlag"].ToString() == "0" || dtCl.Rows[curRow]["WCFlag"].ToString() == "")
                    {
                        //弹出窗体,输入件数、重量
                        //条码字段为空,要求重新绑定条码
                        wtd2kw(clh, "", jhh, sJs, sZl);
                    }
                    else if (dtCl.Rows[curRow]["WCFlag"].ToString() == "1")
                    {
                        frmMessage frm = new frmMessage();
                        frm.ShowDialog("是否取消消帐材料" + clh, "提示");
                        if (frm.ret)
                        {
                            Storage.ClearWtdInScanStatus(jhh, lbl, sFlag);
                            RefreshData();
                            curRow = -1;
                        }
                        frm.Dispose();
                    }
                }

                if (e.KeyCode == Keys.F2)
                {
                    if (dtCl.Rows[curRow]["WCFlag"].ToString() == "1")
                    {
                        frmWtdInCl frmWtdInCl = new frmWtdInCl();
                        frmWtdInCl.ShowDialog(clh, lbl, kw, sJs, sZl);
                        if (frmWtdInCl.ret)
                        {
                            kw  = frmWtdInCl.sKw;
                            sJs = frmWtdInCl.sJs;
                            sZl = frmWtdInCl.sZL;
                            lbl = frmWtdInCl.sLbl;

                            dtCl.Rows[curRow]["KW"] = kw;
                            dtCl.Rows[curRow]["JS"] = sJs;
                            dtCl.Rows[curRow]["ZL"] = sZl;


                            Storage.SaveCurrentKw("0000000000", jhh, "SGYS", kw);
                            Storage.UpdateWtdInKw(jhh, lbl, Global.sKb + kw, sJs, sZl);

                            RefreshData();
                        }

                        frmWtdInCl.Dispose();
                    }
                }
                if (e.KeyCode == Keys.F22 || e.KeyCode == Keys.F23)
                {
                    frmQuality frmQuality = new frmQuality();
                    Global.frmCurrent = frmQuality;
                    frmQuality.Owner  = this;
                    this.Hide();
                    frmQuality.Show(clh, qa);
                }
            }
        }