Esempio n. 1
0
        protected void ctrlProductScan_RmesDataChanged(object obj, Rmes.WinForm.Base.RMESEventArgs e)
        {
            string sn, quality_status = "A";

            if (e.MessageHead == null)
            {
                return;
            }
            if (e.MessageHead == "SN")
            {
                //上线后打印条码
                sn          = e.MessageBody.ToString();
                product     = ProductInfoFactory.GetByCompanyCodeSNSingle(CompanyCode, sn);//获取sn信息
                ThePlancode = product.PLAN_CODE;
                TheSo       = product.PLAN_SO;
                PublicClass.PrintTmISDE(product.PLAN_CODE, ThisSmTm);
                txtGTH.Text     = "";
                arg.MessageHead = "CLEAR1";
                arg.MessageBody = "";
                SendDataChangeMessage(arg);
                timer1.Enabled = true;
            }
            if (e.MessageHead == "ONLINEONLINE")
            {
                DataTable dt = dataConn.GetTable("select plan_code from data_plan where plan_qty<=online_qty and plan_code='" + ThePlancode + "'");
                if (dt.Rows.Count > 0)
                {
                    ProductDataFactory.ISDE_CREATE_JK_SJJHB(PlineCode1);
                }
                timer1.Enabled = true;
            }
        }
Esempio n. 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                timer1.Enabled = false;
                string    sql = "select jhmc from isde_jk_sjjhb ";
                DataTable dt  = dataConn.GetTable(sql);
                if (dt.Rows.Count == 0)
                {
                    ProductDataFactory.ISDE_CREATE_JK_SJJHB(PlineCode1);
                }

                sql = " select ewghtm,jhdm,jhso,ggxhmc from isde_jk_sjsxb where czzt='0' and rownum=1 ";
                dt  = dataConn.GetTable(sql);
                if (dt.Rows.Count == 0)
                {
                    timer1.Enabled = true;
                    return;
                }
                TheEwm      = dt.Rows[0][0].ToString();
                ThePlancode = dt.Rows[0][1].ToString();
                TheSo       = dt.Rows[0][2].ToString();
                ThePmodel   = dt.Rows[0][3].ToString();
                if (ThePlancode == "")
                {
                    timer1.Enabled = true;
                    return;
                }
                //初始化sn框
                TheEwm      = TheEwm.Replace("\r\n", "").Trim();
                txtGTH.Text = TheEwm;
                string sn = TheEwm;
                TheSn           = sn;
                ThisSmTm        = TheSo + "^DCEC^" + sn;
                arg.MessageHead = "FILLSN";
                arg.MessageBody = sn + "^" + TheSo + "^" + ThePmodel + "^" + ThePlancode;
                SendDataChangeMessage(arg);
                arg.MessageHead = "FILLSN1";
                arg.MessageBody = ThisSmTm;
                SendDataChangeMessage(arg);
                arg.MessageHead = "PRINTISDE";
                arg.MessageBody = ThisSmTm + "|" + ThePlancode;
                SendDataChangeMessage(arg);

                //arg.MessageHead = "FILLSN2";
                //arg.MessageBody = TheSo + "^" + ThePmodel + "^" + ThePlancode;
                //SendDataChangeMessage(arg);
            }
            catch
            {
                timer1.Enabled = true;
            }
        }