예제 #1
0
        private void UpdateOrderTable(object obj)
        {
            int SerialNumber = -1;

            if (obj != null)
            {
                SerialNumber = Convert.ToInt32(obj);
            }
            Thread.Sleep(TimeSpan.FromSeconds(4));
            DataBaseHandle db          = new DataBaseHandle();
            SqlConnection  con         = new SqlConnection();
            string         OrderStyle  = "";
            int            WHTrayStyle = db.SelectOTbySerialNumber(con, SerialNumber, ref OrderStyle);

            if (OrderStyle == "入库订单")
            {
                //更新订单表
                if (WHTrayStyle == ConfigClass.Tray_A2)   //入库加工成品托盘A2
                {
                    db.UpdateOrderNum(con, "加工订单");
                    Thread.Sleep(1);
                    CheckWHNumber("加工订单");
                    UpdateOrderThreadState = false;
                    return;
                }
                if (WHTrayStyle == ConfigClass.Tray_A3)  //入库加工检测托盘A3
                {
                    db.UpdateOrderNum(con, "检测订单");
                    Thread.Sleep(1);
                    CheckWHNumber("检测订单");
                    UpdateOrderThreadState = false;
                    return;
                }
                if (WHTrayStyle == ConfigClass.Tray_B2)   //入库螺钉完成托盘
                {
                    db.UpdateOrderNum(con, "拧螺丝订单");
                    Thread.Sleep(1);
                    CheckWHNumber("拧螺丝订单");
                    UpdateOrderThreadState = false;
                    return;
                }
                if (WHTrayStyle == ConfigClass.Tray_A5)  //入库轴承压装完成托盘
                {
                    db.UpdateOrderNum(con, "轴承压装订单");
                    Thread.Sleep(1);
                    CheckWHNumber("轴承压装订单");
                    UpdateOrderThreadState = false;
                    return;
                }
            }
        }