public bool updateControlData(CONTROL_DATA new_control_data) { try { using (sc.Data.DBConnection_EF con = sc.Data.DBConnection_EF.GetUContext()) { con.CONTROL_DATA.Attach(new_control_data); con.Entry(new_control_data).Property(p => p.T1).IsModified = true; con.Entry(new_control_data).Property(p => p.T2).IsModified = true; con.Entry(new_control_data).Property(p => p.T3).IsModified = true; con.Entry(new_control_data).Property(p => p.T4).IsModified = true; con.Entry(new_control_data).Property(p => p.T5).IsModified = true; con.Entry(new_control_data).Property(p => p.T6).IsModified = true; con.Entry(new_control_data).Property(p => p.T7).IsModified = true; con.Entry(new_control_data).Property(p => p.T8).IsModified = true; con.Entry(new_control_data).Property(p => p.BLOCK_REQ_TIME_OUT).IsModified = true; ControlDataDao.update(con, new_control_data); } return(true); } catch (Exception ex) { NLog.LogManager.GetCurrentClassLogger().Error(ex, "Exception:"); return(false); } }
public void start(SCApplication app) { AddressDataDao = app.AddressDataDao; ScaleBaseDataDao = app.ScaleBaseDataDao; ControlDataDao = app.ControlDataDao; VehicleControlDao = app.VehicleControlDao; }
public void start(ViewSectionDao viewSectionDao, SegmentDao segmentDao, AddressDataDao addressDataDao, ScaleBaseDataDao scaleBaseDataDao, ControlDataDao controlDataDao, VehicleControlDao vehicleControlDao) { VSection100Dao = viewSectionDao; AddressDataDao = addressDataDao; ScaleBaseDataDao = scaleBaseDataDao; ControlDataDao = controlDataDao; VehicleControlDao = vehicleControlDao; SegmentDao = segmentDao; }
public CONTROL_DATA getReleaseCONTROL_DATA() { CONTROL_DATA data = null; using (DBConnection_EF con = DBConnection_EF.GetUContext()) { data = ControlDataDao.getReleaseData(con); } return(data); }
public VehicleDataSetting() { VSection100Dao = new ViewSectionDao(); SegmentDao = new SegmentDao(); AddressDataDao = new AddressDataDao(); ScaleBaseDataDao = new ScaleBaseDataDao(); ControlDataDao = new ControlDataDao(); VehicleControlDao = new VehicleControlDao(); SectionDao = new SectionDao(); sectionControlDao = new ohxc.winform.Dao.MirleOHS_100.SectionControlDao(); start(VSection100Dao, SegmentDao, AddressDataDao, ScaleBaseDataDao, ControlDataDao, VehicleControlDao); }