Exemplo n.º 1
0
 public bool updateTravelBaseData(AVEHICLE_CONTROL_100 new_control_data)
 {
     try
     {
         using (sc.Data.DBConnection_EF con = sc.Data.DBConnection_EF.GetUContext())
         {
             con.AVEHICLE_CONTROL_100.Attach(new_control_data);
             con.Entry(new_control_data).Property(p => p.TRAVEL_RESOLUTION).IsModified        = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_START_STOP_SPEED).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_MAX_SPD).IsModified           = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_ACCEL_DECCEL_TIME).IsModified = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_HOME_DIR).IsModified          = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_HOME_SPD).IsModified          = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_KEEP_DIS_SPD).IsModified      = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_OBS_DETECT_LONG).IsModified   = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_OBS_DETECT_SHORT).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_MANUAL_HIGH_SPD).IsModified   = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_MANUAL_LOW_SPD).IsModified    = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_TEACHING_SPD).IsModified      = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_TRAVEL_DIR).IsModified        = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_F_DIR_LIMIT).IsModified       = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_R_DIR_LIMIT).IsModified       = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_S_CURVE_RATE).IsModified      = true;
             con.Entry(new_control_data).Property(p => p.TRAVEL_ENCODER_POLARITY).IsModified  = true;
             VehicleControlDao.update(con, new_control_data);
         }
         return(true);
     }
     catch (Exception ex)
     {
         NLog.LogManager.GetCurrentClassLogger().Error(ex, "Exception:");
         return(false);
     }
 }
Exemplo n.º 2
0
 public bool updateGuideData(AVEHICLE_CONTROL_100 new_control_data)
 {
     try
     {
         using (sc.Data.DBConnection_EF con = sc.Data.DBConnection_EF.GetUContext())
         {
             con.AVEHICLE_CONTROL_100.Attach(new_control_data);
             con.Entry(new_control_data).Property(p => p.GUIDE_START_STOP_SPEED).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_MAX_SPD).IsModified           = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_ACCEL_DECCEL_TIME).IsModified = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_S_CURVE_RATE).IsModified      = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_RUN_SPD).IsModified           = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_MANUAL_HIGH_SPD).IsModified   = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_MANUAL_LOW_SPD).IsModified    = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_LF_LOCK_POSITION).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_LB_LOCK_POSITION).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_RF_LOCK_POSITION).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_RB_LOCK_POSITION).IsModified  = true;
             con.Entry(new_control_data).Property(p => p.GUIDE_CHG_STABLE_TIME).IsModified   = true;
             VehicleControlDao.update(con, new_control_data);
         }
         return(true);
     }
     catch (Exception ex)
     {
         NLog.LogManager.GetCurrentClassLogger().Error(ex, "Exception:");
         return(false);
     }
 }
        public AVEHICLE_CONTROL_100 getReleaseVehicleControlData_100(string vh_id)
        {
            AVEHICLE_CONTROL_100 data = null;

            using (DBConnection_EF con = DBConnection_EF.GetUContext())
            {
                data = VehicleControlDao.getReleaseDataByVhID(con, vh_id);
            }
            return(data);
        }
 /// <summary>
 /// Updates the alarm.
 /// </summary>
 /// <param name="conn">The connection.</param>
 /// <param name="alarm">The alarm.</param>
 public void update(DBConnection_EF conn, AVEHICLE_CONTROL_100 entity)
 {
     try
     {
         conn.SaveChanges();
     }
     catch (Exception ex)
     {
         logger.Warn(ex);
         throw;
     }
 }