Ejemplo n.º 1
0
        public static T_SysVehicle NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new T_SysVehicle();

            //车辆标识号
            item.VehicleID = reader.GetInt64("F_ID");
            //车牌号
            if (!reader.IsDBNull("F_PLATE_CODE"))
            {
                item.Name = reader.GetString("F_PLATE_CODE");
            }
            //车牌颜色
            if (!reader.IsDBNull("F_PLATE_COLOR"))
            {
                item.PlateColor = (JTPlateColor)Convert.ToByte(reader.GetString("F_PLATE_COLOR"));
            }
            if (!reader.IsDBNull("F_ENTERPRISE_CODE"))
            {
                item.EnterpriseCode = reader.GetString("F_ENTERPRISE_CODE");
            }
            else
            {
                item.EnterpriseCode = "";
            }
            return(item);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="reader"></param>
        public SupplementGpsModel(SQ.Base.MyDataReader reader)
        {
            RowID = reader.GetInt32("RowID");
            //车牌号
            PlateName = reader.GetString("PlateName");
            //车牌颜色
            PlateColor = reader.GetInt16("PlateColor");

            var lon        = reader.GetInt32("F_LONGITUDE");
            var lat        = reader.GetInt32("F_LATITUDE");
            var GpsEncrypt = (int)reader.GetInt16("F_GpsEncrypt");
            var tmpstate   = reader.GetInt64("F_GPSSTATE");
            var GPSSTATE   = (uint)(tmpstate & 0xFFFFFFFF);

            Gnss = new JTSVehicleGpsMsgDatas
            {
                ENCRYPT   = GpsEncrypt == 1 ? JTSEncrypt.Encrypt : JTSEncrypt.NoneEncrypt,
                datetime  = reader.GetDateTime("F_GPS_TIME"),
                LON       = (uint)Math.Abs(lon),
                LAT       = (uint)Math.Abs(lat),
                VEC1      = (UInt16)reader.GetInt16("F_SPEED"),
                VEC2      = (UInt16)reader.GetInt16("F_DSPEED"),
                VEC3      = (UInt32)reader.GetInt32("F_MILEAGE"),
                DIRECTION = (UInt16)reader.GetInt16("F_DIRECTION"),
                ALTITUDE  = (UInt16)reader.GetInt16("F_HIGH"),
                STATE     = new JTGPSStateInfo(GPSSTATE),// GetGpsStatus(TrackID),
                ALARM     = (JTAlarmType)reader.GetInt32("F_ALARM_DATA")
            };
        }
Ejemplo n.º 3
0
        public static CRVehicle NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new CRVehicle();

            item.VehicleName = reader.GetString("F_VIN");
            item.PlateColor  = (JTPlateColor)reader.GetByte("F_VEHICLE_COLOR");
            return(item);
        }
Ejemplo n.º 4
0
        public static DeviceYb NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new DeviceYb();

            if (!reader.IsDBNull("F_VEHICLE_ID"))
            {
                item.VehicleID = reader.GetInt64("F_VEHICLE_ID");
            }
            if (!reader.IsDBNull("F_VEHICLE_CODE"))
            {
                item.YbVehicleID = reader.GetString("F_VEHICLE_CODE");
            }
            if (!reader.IsDBNull("F_PLATE_CODE"))
            {
                item.YbVehicleName = reader.GetString("F_PLATE_CODE");
            }
            if (!reader.IsDBNull("F_PLATE_COLOR"))
            {
                item.YbVehicleColor = reader.GetString("F_PLATE_COLOR");
            }
            if (!reader.IsDBNull("F_VEHICLE_FRAME_NO"))
            {
                item.VIN = reader.GetString("F_VEHICLE_FRAME_NO");
            }
            if (!reader.IsDBNull("F_SHENG"))
            {
                item.Provice = reader.GetString("F_SHENG");
            }
            else
            {
                item.Provice = "";
            }
            if (!reader.IsDBNull("F_SHI"))
            {
                item.City = reader.GetString("F_SHI");
            }
            else
            {
                item.City = "9";
            }
            //if (!reader.IsDBNull("F_ENTERPRISE_CODE"))
            //    item.CompanyCode = reader.GetString("F_ENTERPRISE_CODE");
            //else
            //    item.CompanyCode = "";
            item.ZiCompanyCode = "";
            if (!reader.IsDBNull("F_LINE_NO"))
            {
                item.LineMark = reader.GetString("F_LINE_NO");
            }
            else
            {
                item.LineMark = "";
            }
            return(item);
        }
Ejemplo n.º 5
0
        public static NotSendBillInfo NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new NotSendBillInfo();

            //车牌号
            item.Name = reader.GetString("Name");
            //车牌颜色
            item.PlateColor = reader.GetByte("PlateColor");
            //运单信息
            item.BillInfo = reader.GetString("BillInfo");

            return(item);
        }
Ejemplo n.º 6
0
        public static NotSendAuditAlarmInfo NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new NotSendAuditAlarmInfo();

            item.ID         = reader.GetInt64("F_ID");
            item.Name       = reader.GetString("F_PLATE_CODE");
            item.PlateColor = (byte)reader.GetInt16("F_VEHICLE_COLOR");
            item.AlarmType  = (byte)reader.GetInt64("F_ALARM_TYPE_ID");
            //报警编号
            item.AlarmId = reader.GetInt64("F_ALARM_HISTORY_ID");
            //报警类型
            item.Status = (byte)reader.GetInt16("F_STATUS");
            //车牌颜色
            return(item);
        }
Ejemplo n.º 7
0
        public static MonSendFailGps NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new MonSendFailGps();

            //
            item.RowID = reader.GetInt32("RowID");
            //跟踪ID
            item.TrackID = reader.GetInt64("TrackID");
            //车牌号
            item.PlateName = reader.GetString("PlateName");
            //车牌颜色
            item.PlateColor = reader.GetInt16("PlateColor");

            return(item);
        }
Ejemplo n.º 8
0
        public static DeviceInfo NewItem(SQ.Base.MyDataReader reader)
        {
            var item = new DeviceInfo();

            // 终端ID
            item.DeviceID = reader.GetInt64("F_ID");
            //终端Code
            if (!reader.IsDBNull("F_CODE"))
            {
                item.CDeviceID = reader.GetString("F_CODE");
            }
            //省域ID
            if (!reader.IsDBNull("F_PROVINCE"))
            {
                item.ProvinceID = reader.GetString("F_PROVINCE").Trim();
                if (item.ProvinceID.Length > 2)
                {
                    item.ProvinceID = item.ProvinceID.Substring(0, 2);
                }
                //区域ID
                while (item.ProvinceID.Length < 2)
                {
                    item.ProvinceID = "0" + item.ProvinceID;
                }
            }
            else
            {
                item.ProvinceID = "00";
            }
            //市域ID
            if (!reader.IsDBNull("F_CITY_ID"))
            {
                item.CityID = reader.GetString("F_CITY_ID").Trim();
                if (item.CityID.Length > 2)
                {
                    item.CityID = item.CityID.Substring(0, 2);
                }
                //区域ID
                while (item.CityID.Length < 2)
                {
                    item.CityID = "0" + item.CityID;
                }
            }
            else
            {
                item.CityID = "00";
            }
            item.MakerPCID = item.ProvinceID + item.CityID + "00";
            //if (!reader.IsDBNull("F_AREA_ID"))
            //    item.MakerPCID = reader.GetString("F_AREA_ID");
            //制造商ID
            if (!reader.IsDBNull("F_MANUFACTURER_ID"))
            {
                item.MakerID = reader.GetString("F_MANUFACTURER_ID");
            }
            //终端型号
            if (!reader.IsDBNull("F_EQUIPMENT_MODE"))
            {
                item.CDeviceType = reader.GetString("F_EQUIPMENT_MODE");
            }
            //车牌颜色
            if (!reader.IsDBNull("F_PLATE_COLOR"))
            {
                item.F_PLATE_COLOR = (JTPlateColor)Convert.ToByte(reader.GetString("F_PLATE_COLOR"));
            }
            if (!reader.IsDBNull("F_PLATE_CODE"))
            {
                item.VehcileName = reader.GetString("F_PLATE_CODE");
            }
            //手机号
            if (!reader.IsDBNull("F_MOBILE_CODE"))
            {
                item.Sim = reader.GetString("F_MOBILE_CODE");
            }
            //车辆ID
            if (!reader.IsDBNull("F_VEHICLE_ID"))
            {
                item.VehicleID = reader.GetInt64("F_VEHICLE_ID");
            }
            //企业编号
            //if (!reader.IsDBNull("F_ENTERPRISE_CODE"))
            //    item.F_ENTERPRISE_CODE = reader.GetString("F_ENTERPRISE_CODE");
            //else
            //    item.F_ENTERPRISE_CODE = string.Empty;
            //注册状态
            if (reader.HasCol("F_IS_LOGOUT") && !reader.IsDBNull("F_IS_LOGOUT"))
            {
                item.IsReg = reader.GetInt16("F_IS_LOGOUT") == 0;
            }
            else
            {
                item.IsReg = false;
            }
            //鉴权码
            if (reader.HasCol("F_AUTH_CODE") && !reader.IsDBNull("F_AUTH_CODE"))
            {
                item.AuthorityID = reader.GetString("F_AUTH_CODE");
            }
            //协议版本 F_PROTOCOL_VERSION
            if (!reader.IsDBNull("F_PROTOCOL_VERSION"))
            {
                item.ProtocolVersion = reader.GetInt32("F_PROTOCOL_VERSION");
            }
            //终端使用的CAN数据配置版本
            if (!reader.IsDBNull("F_CAN_CFG_VERSION"))
            {
                item.CANCFGVersion = reader.GetInt64("F_CAN_CFG_VERSION");
            }
            if (reader.HasCol("F_PAUSE") && !reader.IsDBNull("F_PAUSE"))
            {
                item.Pause = reader.GetInt16("F_PAUSE") == 1;
            }
            else
            {
                item.Pause = false;
            }
            if (reader.HasCol("DeviceRegID") && !reader.IsDBNull("DeviceRegID"))
            {
                item.DeviceRegID = reader.GetInt64("DeviceRegID");
            }

            if (reader.HasCol("F_GATEWAY_ID") && !reader.IsDBNull("F_GATEWAY_ID"))
            {
                item.GatewayID = reader.GetInt64("F_GATEWAY_ID");
            }

            if (reader.HasCol("F_AUTH_CODE") && !reader.IsDBNull("F_AUTH_CODE"))
            {
                item.AuthorityID = reader.GetString("F_AUTH_CODE");
            }
            if (reader.HasCol("F_REGISTER_DATE") && !reader.IsDBNull("F_REGISTER_DATE"))
            {
                item.RegisterDate = reader.GetDateTime("F_REGISTER_DATE");
            }
            if (reader.HasCol("F_AUTH_DATE") && !reader.IsDBNull("F_AUTH_DATE"))
            {
                item.AuthDate = reader.GetDateTime("F_AUTH_DATE");
            }
            if (reader.HasCol("F_LOGOUT_DATE") && !reader.IsDBNull("F_LOGOUT_DATE"))
            {
                item.LogoutDate = reader.GetDateTime("F_LOGOUT_DATE");
            }
            if (reader.HasCol("F_IP_ADDRESS") && !reader.IsDBNull("F_IP_ADDRESS"))
            {
                item.IpAddress = reader.GetString("F_IP_ADDRESS");
            }
            if (reader.HasCol("F_PORT") && !reader.IsDBNull("F_PORT"))
            {
                item.Port = reader.GetInt32("F_PORT");
            }
            if (reader.HasCol("F_ONLINE") && !reader.IsDBNull("F_ONLINE"))
            {
                item.Online = reader.GetInt16("F_ONLINE") == 1;
            }
            else
            {
                item.Online = false;
            }
            if (reader.HasCol("F_CREATE_DATE") && !reader.IsDBNull("F_CREATE_DATE"))
            {
                item.CreateDate = reader.GetDateTime("F_CREATE_DATE");
            }
            if (reader.HasCol("F_UPDATE_DATE") && !reader.IsDBNull("F_UPDATE_DATE"))
            {
                item.UpdateDate = reader.GetDateTime("F_UPDATE_DATE");
            }
            if (reader.HasCol("F_CAR_COLOR") && !reader.IsDBNull("F_CAR_COLOR"))
            {
                item.Car_Color = reader["F_CAR_COLOR"].ToString();
            }
            else
            {
                item.Car_Color = "未知";
            }
            //是否启用救援
            if (reader.HasCol("F_RESCUE_ENABLED") && !reader.IsDBNull("F_RESCUE_ENABLED"))
            {
                item.RescueEnabled = reader.GetInt16("F_RESCUE_ENABLED") == 1;
            }
            else
            {
                item.RescueEnabled = false;
            }
            //救援服务商
            if (reader.HasCol("F_RESCUE_SP") && !reader.IsDBNull("F_RESCUE_SP"))
            {
                item.RescueServiceProvider = reader.GetInt16("F_RESCUE_SP");
            }
            else
            {
                item.RescueServiceProvider = 0;
            }
            //if (reader.HasCol("F_DP_ID") && !reader.IsDBNull("F_DP_ID"))
            //{
            //    item.F_DP_ID = reader.GetInt64("F_DP_ID");
            //}
            //else
            //{
            //    item.F_DP_ID = 0;
            //}
            if (reader.HasCol("F_CAR_VIN") && !reader.IsDBNull("F_CAR_VIN"))
            {
                item.VIN = reader.GetString("F_CAR_VIN");
            }

            return(item);
        }