Ejemplo n.º 1
0
 public static VehicleMileageObject VehicleMileageRowToObject(DataRow VehicleMileage)
 {
     VehicleMileageObject obj = new VehicleMileageObject();
     try
     {
         if (VehicleMileage != null)
         {
             if (RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.VehmID = RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, true, DataRowVersion.Current);
                 obj.Transi_TNR_mat = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.TRANSI_TNR_MAT, false, DataRowVersion.Current);
                 obj.Transi_NM_mat = RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.TRANSI_NM_MAT, false, DataRowVersion.Current);
                 obj.Date = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.DATE, false, DataRowVersion.Current));
                 obj.Mileage = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.MILEAGE, false, DataRowVersion.Current);
             }
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
Ejemplo n.º 2
0
        public static VehicleMileageObject VehicleMileageRowToObject(DataRow VehicleMileage)
        {
            VehicleMileageObject obj = new VehicleMileageObject();

            try
            {
                if (VehicleMileage != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.VehmID         = RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, true, DataRowVersion.Current);
                        obj.Transi_TNR_mat = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.TRANSI_TNR_MAT, false, DataRowVersion.Current);
                        obj.Transi_NM_mat  = RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.TRANSI_NM_MAT, false, DataRowVersion.Current);
                        obj.Date           = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.DATE, false, DataRowVersion.Current));
                        obj.Mileage        = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.MILEAGE, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
 public void Remove(VehicleMileageObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(VehicleMileageObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by VehicleMileageObject when it changes
 internal void VehicleMileageObjectChanged(VehicleMileageObject VehicleMileage)
 {
     try
     {
         int index = List.IndexOf(VehicleMileage);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         VehicleMileageObject VehicleMileage = new VehicleMileageObject();
         List.Add(VehicleMileage);
         return(VehicleMileage);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         VehicleMileageObject VehicleMileage = (VehicleMileageObject)value;
         VehicleMileage.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 8
0
 public void Remove(VehicleMileageObject vehicleMileage)
 {
     try
     {
         CheckTransaction();
         new VehicleMileageDataService(Transaction).Remove(vehicleMileage);
         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();
     }
 }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    VehicleMileageObject oldVehicleMileage = (VehicleMileageObject)oldValue;
                    VehicleMileageObject newVehicleMileage = (VehicleMileageObject)newValue;
                    oldVehicleMileage.Parent = null;
                    newVehicleMileage.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
 // Called by VehicleMileageObject when it changes
 internal void VehicleMileageObjectChanged(VehicleMileageObject VehicleMileage)
 {
     try
     {
         int index = List.IndexOf(VehicleMileage);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(VehicleMileageObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         VehicleMileageObject VehicleMileage = new VehicleMileageObject();
         List.Add(VehicleMileage);
         return VehicleMileage;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(VehicleMileageObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 14
0
 public void Save(VehicleMileageObject vehicleMileage)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "VehicleMileage_SAVE",
             CreateParameter("@vehmID", SqlDbType.UniqueIdentifier, vehicleMileage.VehmID, ParameterDirection.InputOutput),
             CreateParameter("@transi_TNR_mat", SqlDbType.Int, vehicleMileage.Transi_TNR_mat),
             CreateParameter("@transi_NM_mat", SqlDbType.NVarChar, vehicleMileage.Transi_NM_mat),
             CreateParameter("@Date", SqlDbType.NVarChar, vehicleMileage.Date),
             CreateParameter("@Mileage", SqlDbType.NVarChar, vehicleMileage.Mileage)
         );
         vehicleMileage.VehmID = (Guid)cmd.Parameters["@vehmID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Ejemplo n.º 15
0
 public bool Remove(VehicleMileageObject vehicleMileage)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "VehicleMileage_DELETE",
             CreateParameter("@vehmID", SqlDbType.UniqueIdentifier, vehicleMileage.VehmID, ParameterDirection.Input)
             );
         return true;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }