Exemplo n.º 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;
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 public void Remove(VehicleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 4
0
 public int Add(VehicleObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 5
0
 // Called by VehicleObject when it changes
 internal void VehicleObjectChanged(VehicleObject Vehicle)
 {
     try
     {
         int index = List.IndexOf(Vehicle);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 6
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         VehicleObject Vehicle = new VehicleObject();
         List.Add(Vehicle);
         return(Vehicle);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 7
0
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         VehicleObject Vehicle = (VehicleObject)value;
         Vehicle.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 8
0
 public VehicleMileageObjectCollection GetByVehicle(VehicleObject vehicle)
 {
     VehicleMileageObjectCollection vehicleMileages;
     try
     {
         vehicleMileages = new VehicleMileageDataService().GetByVehicle(vehicle);
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return vehicleMileages;
 }
Exemplo n.º 9
0
 public MaterialObjectCollection GetByVehicle(VehicleObject vehicle)
 {
     MaterialObjectCollection materials;
     try
     {
         materials = new MaterialDataService().GetByVehicle(vehicle);
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return materials;
 }
 public MaintenanceVehicleObjectCollection GetByVehicleID(VehicleObject vehicle)
 {
     MaintenanceVehicleObjectCollection maintenanceVehicles = new MaintenanceVehicleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(MaintenanceVehicleObject.VEH_ID, vehicle.VehID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + MaintenanceVehicleObject.VEH_ID + " is not null ");
         maintenanceVehicles = MaintenanceVehicleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return maintenanceVehicles;
 }
Exemplo n.º 11
0
 public void Remove(VehicleObject vehicle)
 {
     try
     {
         CheckTransaction();
         new VehicleDataService(Transaction).Remove(vehicle);
         if (IsOwner) Transaction.Commit();
     }
     catch (Exception exception1)
     {
         if (IsOwner) Transaction.Rollback();
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (IsOwner) Connection.Close();
     }
 }
Exemplo n.º 12
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    VehicleObject oldVehicle = (VehicleObject)oldValue;
                    VehicleObject newVehicle = (VehicleObject)newValue;
                    oldVehicle.Parent = null;
                    newVehicle.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemplo n.º 13
0
 public VehicleMileageObjectCollection GetByVehicle(VehicleObject vehicle)
 {
     VehicleMileageObjectCollection vehicleMileages = new VehicleMileageObjectCollection();
     QueryBuilder builder;
     try
     {
         if (vehicle.VehicleTransicsLink != null)
         {
             builder = new QueryBuilder();
             builder.Append(this.BaseQuery(false, 0));
             builder.AppendWhereInteger(VehicleMileageObject.TRANSI_TNR_MAT, vehicle.VehicleTransicsLink.Transi_TNR_mat, QueryBuilder.ParameterLocation.FIRST_LAST);
             builder.AppendOrderBy(VehicleMileageObject.DATE, QueryBuilder.OrderByType.DESC, QueryBuilder.ParameterLocation.FIRST_LAST);
             vehicleMileages = VehicleMileageConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
         }
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return vehicleMileages;
 }
Exemplo n.º 14
0
 public Vehicle(PROF_IT.Common.Enumerations.TypeForm typeForm, VehicleObject vehicle)
 {
     try
     {
         InitializeComponent();
         _vehicle  = vehicle;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
             SetPermissions();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 15
0
 public Vehicle(PROF_IT.Common.Enumerations.TypeForm typeForm, VehicleObject vehicle)
 {
     try
     {
         InitializeComponent();
         _vehicle = vehicle;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
             SetPermissions();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 16
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedVehicle = Vehicle;
             _loadedExecutor = Executor;
             _loadedStartMaintenance = StartMaintenance;
             _loadedRemark = Remark;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 17
0
        public Material(PROF_IT.Common.Enumerations.TypeForm typeForm, VehicleObject vehicle)
        {
            try
            {
                InitializeComponent();

                _typeForm = typeForm;
                _material = new MaterialObject();
                if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
                {
                    Initialize();
                    louVehicle.EditValue = vehicle;
                    SetPermissions();
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemplo n.º 18
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaterialCategory = MaterialCategory;
             _loadedMaterialType = MaterialType;
             _loadedMaterialSubType = MaterialSubType;
             _loadedEmployeeCreator = EmployeeCreator;
             _loadedEmployeeResponsable = EmployeeResponsable;
             _loadedVehicle = Vehicle;
             _loadedSupplier = Supplier;
             _loadedName = Name;
             _loadedDescription = Description;
             _loadedType = Type;
             _loadedSerieNumber = SerieNumber;
             _loadedInternalNumber = InternalNumber;
             _loadedPurchasedOn = PurchasedOn;
             _loadedPrice = Price;
             _loadedNextMaintenance = NextMaintenance;
             _loadedMaintenanceFrequency = MaintenanceFrequency;
             _loadedActive = Active;
             _loadedBroken = Broken;
             //Child members
             _loadedMemos = Memos;
             _loadedMaintenances = Maintenances;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }