Exemplo n.º 1
0
            //public bool updateBlockZoneQueue_ThrouTime(string car_id, string current_sec_id, out BLOCKZONEQUEUE throu_block_queue)
            public bool updateBlockZoneQueue_ThrouTime(string car_id, out BLOCKZONEQUEUE throu_block_queue)
            {
                bool isSeccess = true;

                //DBConnection_EF con = DBConnection_EF.GetContext();
                try
                {
                    //using (DBConnection_EF con = new DBConnection_EF())
                    using (DBConnection_EF con = DBConnection_EF.GetUContext())
                    {
                        //BLOCKZONEQUEUE blockObj = blockZoneQueueDao.getUsingBlockQueueByCarIDSecID(con, car_id, current_sec_id);
                        //throu_block_queue = blockZoneQueueDao.getThrouTimeNullBlockQueueByCarIDSecID(con, car_id, current_sec_id);

                        throu_block_queue = blockZoneQueueDao.getThrouTimeNullBlockQueueByCarID(con, car_id);
                        if (throu_block_queue != null)
                        {
                            throu_block_queue.THROU_TIME = DateTime.Now;
                            throu_block_queue.STATUS     = SCAppConstants.BlockQueueState.Through;
                            con.Entry(throu_block_queue).Property(p => p.THROU_TIME).IsModified = true;
                            con.Entry(throu_block_queue).Property(p => p.STATUS).IsModified     = true;

                            //bool isDetached = con.Entry(blockObj).State == EntityState.Modified;
                            //if (isDetached)
                            blockZoneQueueDao.Update(con, throu_block_queue);
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Exception");
                    isSeccess         = false;
                    throu_block_queue = null;
                }
                return(isSeccess);
            }
Exemplo n.º 2
0
        public bool updateBlockZoneQueue_ThrouTime(string car_id)
        {
            bool isSeccess = true;

            using (DBConnection_EF con = DBConnection_EF.GetUContext())
            {
                BLOCKZONEQUEUE throu_block_queue = blockZoneQueueDao.getThrouTimeNullBlockQueueByCarID(con, car_id);
                if (throu_block_queue != null)
                {
                    throu_block_queue.THROU_TIME = DateTime.Now;
                    throu_block_queue.STATUS     = SCAppConstants.BlockQueueState.Through;
                    con.Entry(throu_block_queue).Property(p => p.THROU_TIME).IsModified = true;
                    con.Entry(throu_block_queue).Property(p => p.STATUS).IsModified     = true;

                    blockZoneQueueDao.Update(con, throu_block_queue);
                }
            }
            return(isSeccess);
        }