Example #1
0
        public bool updateBlockZoneQueue_ForceRelease(string vhID)
        {
            bool isSeccess = true;

            using (DBConnection_EF con = DBConnection_EF.GetUContext())
            {
                List <BLOCKZONEQUEUE> blockObjs = blockZoneQueueDao.loadUsingBlockQueueByCarID(con, vhID);
                if (blockObjs != null && blockObjs.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (var blockObj in blockObjs)
                    {
                        blockObj.RELEASE_TIME = DateTime.Now;
                        blockObj.STATUS       = SCAppConstants.BlockQueueState.Abnormal_Release_ForceRelease;
                        con.Entry(blockObj).Property(p => p.RELEASE_TIME).IsModified = true;
                        con.Entry(blockObj).Property(p => p.STATUS).IsModified       = true;
                        blockZoneQueueDao.Update(con, blockObj);

                        sb.Append($"vh id:{vhID},block id:{blockObj.ENTRY_SEC_ID},request time:{blockObj.REQ_TIME.ToString(SCAppConstants.DateTimeFormat_19)}");
                        sb.AppendLine();
                    }
                    LogHelper.Log(logger: logger, LogLevel: LogLevel.Warn, Class: nameof(BlockControlBLL), Device: "AGVC",
                                  Details: $"Excute block force release:{sb.ToString()},by vh id:{vhID}",
                                  VehicleID: vhID);
                }
            }
            return(isSeccess);
        }
Example #2
0
            public List <BLOCKZONEQUEUE> loadNonReleaseBlockQueueByCarID(string vh_id)
            {
                List <BLOCKZONEQUEUE> blockZoneQueues = null;

                //DBConnection_EF con = DBConnection_EF.GetContext();
                //using (DBConnection_EF con = new DBConnection_EF())
                using (DBConnection_EF con = DBConnection_EF.GetUContext())
                {
                    blockZoneQueues = blockZoneQueueDao.loadUsingBlockQueueByCarID(con, vh_id);
                }
                return(blockZoneQueues);
            }