コード例 #1
0
ファイル: ModuleData.cs プロジェクト: hanigamal/rb-vms
 public ModuleModel GetModule(string moduleNumber)
 {
     vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
     ModuleModel model = new ModuleModel();
     Module query = (from m in datacontext.Modules
                     where m.ModuleNumber == moduleNumber
                     select m).SingleOrDefault<Module>();
     model.ModuleNumber = query.ModuleNumber;
     model.ModuleType = query.ModuleType;
     model.IsActive = Convert.ToBoolean(query.IsActive);
     return model;
 }
コード例 #2
0
        public ModuleModel GetModule(string moduleNumber)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            ModuleModel model = new ModuleModel();
            Module      query = (from m in datacontext.Modules
                                 where m.ModuleNumber == moduleNumber
                                 select m).SingleOrDefault <Module>();

            model.ModuleNumber = query.ModuleNumber;
            model.ModuleType   = query.ModuleType;
            model.IsActive     = Convert.ToBoolean(query.IsActive);
            return(model);
        }
コード例 #3
0
ファイル: SystemLogData.cs プロジェクト: hanigamal/rb-vms
 public void Save(SystemLogModel model)
 {
     vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
     SystemLog log = new SystemLog();
     log.LogID = GetLongID();
     log.LogValue = model.LogValue;
     log.Type = model.LogType;
     log.Time = model.LogTime;
     log.Source = model.Source;
     log.StackTrace = model.StackTrace;
     datacontext.SystemLogs.InsertOnSubmit(log);
     datacontext.SubmitChanges();
 }
コード例 #4
0
ファイル: SystemLogData.cs プロジェクト: hanigamal/rb-vms
        public void Save(SystemLogModel model)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            SystemLog log = new SystemLog();

            log.LogID      = GetLongID();
            log.LogValue   = model.LogValue;
            log.Type       = model.LogType;
            log.Time       = model.LogTime;
            log.Source     = model.Source;
            log.StackTrace = model.StackTrace;
            datacontext.SystemLogs.InsertOnSubmit(log);
            datacontext.SubmitChanges();
        }
コード例 #5
0
ファイル: TrackingData.cs プロジェクト: hanigamal/rb-vms
 public void Save(TrackingModel model)
 {
     vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
     Tracking objTracking = new Tracking();
     objTracking.TrackingID = GetLongID();
     objTracking.ModuleID = model.ModuleNumber;
     objTracking.Longtitude = model.Longtitude;
     objTracking.Latitude = model.Latitude;
     objTracking.Speed = model.Speed;
     objTracking.FuelLevel = model.FuelLevel;
     objTracking.Time = DateTime.Now;
     datacontext.Trackings.InsertOnSubmit(objTracking);
     datacontext.SubmitChanges();
 }
コード例 #6
0
ファイル: TrackingData.cs プロジェクト: hanigamal/rb-vms
        public void Save(TrackingModel model)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            Tracking objTracking = new Tracking();

            objTracking.TrackingID = GetLongID();
            objTracking.ModuleID   = model.ModuleNumber;
            objTracking.Longtitude = model.Longtitude;
            objTracking.Latitude   = model.Latitude;
            objTracking.Speed      = model.Speed;
            objTracking.FuelLevel  = model.FuelLevel;
            objTracking.Time       = DateTime.Now;
            datacontext.Trackings.InsertOnSubmit(objTracking);
            datacontext.SubmitChanges();
        }
コード例 #7
0
ファイル: ModuleData.cs プロジェクト: hanigamal/rb-vms
        public void Save(ModuleModel model)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            Module objModule = new Module();
            try
            {
                objModule = datacontext.Modules.Single(m => m.ModuleNumber == model.ModuleNumber);

                objModule.ModuleNumber = model.ModuleNumber;
                objModule.ModuleType = model.ModuleType;
                objModule.IsActive = model.IsActive;
                datacontext.SubmitChanges();
            }
            catch
            {
                objModule.ModuleNumber = model.ModuleNumber;
                objModule.ModuleType = model.ModuleType;
                objModule.IsActive = model.IsActive;
                datacontext.Modules.InsertOnSubmit(objModule);
                datacontext.SubmitChanges();
            }
        }
コード例 #8
0
ファイル: Tracking.cs プロジェクト: hanigamal/rb-vms
 public TrackingModel GetModule(long id)
 {
     vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
     var query = (from t in datacontext.Trackings
                 where t.TrackingID == id
                 select t).SingleOrDefault();
     TrackingModel model = new TrackingModel();
     try
     {
         model.TrackingID = query.TrackingID;
         model.ModuleNumber = query.ModuleID;
         model.Longtitude = Convert.ToDouble(query.Longtitude);
         model.Latitude = Convert.ToDouble(query.Latitude);
         model.Speed = Convert.ToDouble(query.Speed);
         model.FuelLevel = Convert.ToDouble(query.FuelLevel);
         model.Time = Convert.ToDateTime(query.Time);
         return model;
     }
     catch
     {
         return null;
     }
 }
コード例 #9
0
        public void Save(ModuleModel model)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            Module objModule = new Module();

            try
            {
                objModule = datacontext.Modules.Single(m => m.ModuleNumber == model.ModuleNumber);

                objModule.ModuleNumber = model.ModuleNumber;
                objModule.ModuleType   = model.ModuleType;
                objModule.IsActive     = model.IsActive;
                datacontext.SubmitChanges();
            }
            catch
            {
                objModule.ModuleNumber = model.ModuleNumber;
                objModule.ModuleType   = model.ModuleType;
                objModule.IsActive     = model.IsActive;
                datacontext.Modules.InsertOnSubmit(objModule);
                datacontext.SubmitChanges();
            }
        }
コード例 #10
0
ファイル: Tracking.cs プロジェクト: hanigamal/rb-vms
        public TrackingModel GetModule(long id)
        {
            vmsServerLinqDataContext datacontext = new vmsServerLinqDataContext();
            var query = (from t in datacontext.Trackings
                         where t.TrackingID == id
                         select t).SingleOrDefault();
            TrackingModel model = new TrackingModel();

            try
            {
                model.TrackingID   = query.TrackingID;
                model.ModuleNumber = query.ModuleID;
                model.Longtitude   = Convert.ToDouble(query.Longtitude);
                model.Latitude     = Convert.ToDouble(query.Latitude);
                model.Speed        = Convert.ToDouble(query.Speed);
                model.FuelLevel    = Convert.ToDouble(query.FuelLevel);
                model.Time         = Convert.ToDateTime(query.Time);
                return(model);
            }
            catch
            {
                return(null);
            }
        }