コード例 #1
0
        public static VehicleObject VehicleRowToObject(DataRow Vehicle)
        {
            VehicleObject obj = new VehicleObject();

            try
            {
                if (Vehicle != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Vehicle, VehicleObject.VEHID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.VehID              = RowFunctions.GetValueFromRowToGuid(Vehicle, VehicleObject.VEHID, true, DataRowVersion.Current);
                        obj.Transc_VehicleID   = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.TRANSC_VEHICLE_ID, false, DataRowVersion.Current);
                        obj.Transc_VehicleType = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.TRANSC_VEHICLE_TYPE, false, DataRowVersion.Current);
                        obj.Name                = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.NAME, false, DataRowVersion.Current);
                        obj.LicenseNumber       = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.LICENSE_NUMBER, false, DataRowVersion.Current);
                        obj.Euronorm            = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.EURONORM, false, DataRowVersion.Current);
                        obj.Chassis             = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.CHASSIS, false, DataRowVersion.Current);
                        obj.Brand               = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.BRAND, false, DataRowVersion.Current);
                        obj.Icon                = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.ICON, false, DataRowVersion.Current);
                        obj.VehicleType         = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.VEHICLETYPE, false, DataRowVersion.Current);
                        obj.VehicleTransicsLink = VehicleTransicsLinkConvertor.VehicleTransicsLinkRowToObject(Vehicle);
                        obj.ContactTransics     = RowFunctions.GetValueFromRowToBoolean(Vehicle, VehicleObject.CONTACT_TRANSICS, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
コード例 #2
0
        public VehicleTransicsLinkObjectCollection GetAll()
        {
            VehicleTransicsLinkObjectCollection vehicleTransicsLinks = new VehicleTransicsLinkObjectCollection();
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                vehicleTransicsLinks = VehicleTransicsLinkConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(vehicleTransicsLinks);
        }