// Insert Vehicle States/ Alarms public int Insert_VState(string Filter, string TrackerID, int VID, double Latitude, double Longitude, FM_VehicleStates objTrackerAlarms) { SqlCommand loCommand = DataContext.OpenConnection(); try { loCommand = DataContext.SetStoredProcedure(loCommand, "FM_ManageVehicleTracking"); loCommand = DataContext.StartTransaction(loCommand); bool result = DataContext.ExecuteNonQuery(DataContext.AddParameters(loCommand, "@Filter", Filter, "@IMEI", TrackerID, "@Latitude", Latitude, "@Longitude", Longitude, "@Status", objTrackerAlarms.Status, "@AlarmCode", objTrackerAlarms.VStatusCode.ToString())); DataContext.EndTransaction(loCommand); return(Convert.ToInt32(result)); } catch (Exception ex) { throw ex; } finally { DataContext.CloseConnection(loCommand); } }
/* == Start Insert Tracker VStates == */ public int Insert_VState(string Filter, string TrackerID, int VID, double Latitude, double Longitude, FM_VehicleStates objTrackerAlarms) { try { return(model.Insert_VState(Filter, TrackerID, VID, Latitude, Longitude, objTrackerAlarms)); } catch (Exception ex) { throw ex; } }