Beispiel #1
0
        static void DoWork(object state)
        {
            string strKey = (string)state;

            try
            {
                if (strKey != null && strKey.Length > 0)
                {
                    DataSet            dsReturn = new DataSet();
                    LotOperationEngine we       = new LotOperationEngine();
                    dsReturn = we.AutoTrackOut(strKey);
                    string msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);


                    lock (lstKey)
                    {
                        lstKey.Remove(strKey);
                    }
                    if (msg.Length > 0)
                    {
                        Thread threadLog = new Thread(new ParameterizedThreadStart(LogService.LogInfo));
                        threadLog.Start(msg);
                    }
                }
            }
            catch (Exception ex)
            {
                Thread threadError = new Thread(new ParameterizedThreadStart(LogService.LogError));
                threadError.Start(ex);
            }
        }
Beispiel #2
0
        static void DoWork(object state)
        {
            string strKey = (string)state;

            try
            {
                if (strKey != null && strKey.Length > 0)
                {
                    LotOperationEngine we = new LotOperationEngine();
                    DataSet            dt = we.AutoTrackOut(strKey);
                    int    code           = 0;
                    string strMsg         = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dt, ref code);
                    lock (lstKey)
                    {
                        lstKey.Remove(strKey);
                    }
                    if (strMsg.Length > 0)
                    {
                        Console.WriteLine(strMsg);
                    }
                }
                else
                {
                    LogService.LogInfo("Thread reporting for No duty.");
                }
            }
            catch (Exception ex)
            {
                Thread threadError = new Thread(new ParameterizedThreadStart(LogService.LogError));
                threadError.Start(ex);
            }
        }