public static MaintenanceVehicleObject MaintenanceVehicleRowToObject(DataRow MaintenanceVehicle)
 {
     MaintenanceVehicleObject obj = new MaintenanceVehicleObject();
     try
     {
         if (MaintenanceVehicle != null)
         {
             if (RowFunctions.GetValueFromRowToGuid(MaintenanceVehicle, MaintenanceVehicleObject.MAINTVEH_ID, false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.MaintVehID = RowFunctions.GetValueFromRowToGuid(MaintenanceVehicle, MaintenanceVehicleObject.MAINTVEH_ID, true, DataRowVersion.Current);
                 //obj.Vehicle = TIS.DL.Internal.Vehicle.VehicleConvertor.VehicleRowToObject(MaintenanceVehicle);
                 obj.Executor = EmployeeConvertor.EmployeeRowToObject(MaintenanceVehicle, "");
                 obj.StartMaintenance = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(MaintenanceVehicle, MaintenanceVehicleObject.START_MAINTENANCE, false, DataRowVersion.Current));
                 obj.Remark = RowFunctions.GetValueFromRowToString(MaintenanceVehicle, MaintenanceVehicleObject.REMARK, 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 static MaintenanceVehicleObject MaintenanceVehicleRowToObject(DataRow MaintenanceVehicle)
        {
            MaintenanceVehicleObject obj = new MaintenanceVehicleObject();

            try
            {
                if (MaintenanceVehicle != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(MaintenanceVehicle, MaintenanceVehicleObject.MAINTVEH_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.MaintVehID = RowFunctions.GetValueFromRowToGuid(MaintenanceVehicle, MaintenanceVehicleObject.MAINTVEH_ID, true, DataRowVersion.Current);
                        //obj.Vehicle = TIS.DL.Internal.Vehicle.VehicleConvertor.VehicleRowToObject(MaintenanceVehicle);
                        obj.Executor         = EmployeeConvertor.EmployeeRowToObject(MaintenanceVehicle, "");
                        obj.StartMaintenance = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(MaintenanceVehicle, MaintenanceVehicleObject.START_MAINTENANCE, false, DataRowVersion.Current));
                        obj.Remark           = RowFunctions.GetValueFromRowToString(MaintenanceVehicle, MaintenanceVehicleObject.REMARK, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
示例#3
0
 public void Remove(MaintenanceVehicleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#4
0
 public int Add(MaintenanceVehicleObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#5
0
 // Called by MaintenanceVehicleObject when it changes
 internal void MaintenanceVehicleObjectChanged(MaintenanceVehicleObject MaintenanceVehicle)
 {
     try
     {
         int index = List.IndexOf(MaintenanceVehicle);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#6
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         MaintenanceVehicleObject MaintenanceVehicle = new MaintenanceVehicleObject();
         List.Add(MaintenanceVehicle);
         return(MaintenanceVehicle);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#7
0
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         MaintenanceVehicleObject MaintenanceVehicle = (MaintenanceVehicleObject)value;
         MaintenanceVehicle.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
示例#8
0
 public void Remove(MaintenanceVehicleObject maintenanceVehicle)
 {
     try
     {
         CheckTransaction();
         new MaintenanceVehicleDataService(Transaction).Remove(maintenanceVehicle);
         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();
     }
 }
示例#9
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    MaintenanceVehicleObject oldMaintenanceVehicle = (MaintenanceVehicleObject)oldValue;
                    MaintenanceVehicleObject newMaintenanceVehicle = (MaintenanceVehicleObject)newValue;
                    oldMaintenanceVehicle.Parent = null;
                    newMaintenanceVehicle.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
 // Called by MaintenanceVehicleObject when it changes
 internal void MaintenanceVehicleObjectChanged(MaintenanceVehicleObject MaintenanceVehicle)
 {
     try
     {
         int index = List.IndexOf(MaintenanceVehicle);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(MaintenanceVehicleObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         MaintenanceVehicleObject MaintenanceVehicle = new MaintenanceVehicleObject();
         List.Add(MaintenanceVehicle);
         return MaintenanceVehicle;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(MaintenanceVehicleObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public bool Remove(MaintenanceVehicleObject maintenanceVehicle)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "MaintenanceVehicle_DELETE",
             CreateParameter("@maintvehID", SqlDbType.UniqueIdentifier, maintenanceVehicle.MaintVehID, 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;
     }
 }
 public void Save(MaintenanceVehicleObject maintenanceVehicle)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "MaintenanceVehicle_SAVE",
             CreateParameter("@maintvehID", SqlDbType.UniqueIdentifier, maintenanceVehicle.MaintVehID, ParameterDirection.InputOutput),
             CreateParameter("@vehID", SqlDbType.UniqueIdentifier, maintenanceVehicle.Vehicle == null ? Guid.Empty : maintenanceVehicle.Vehicle.VehID),
             CreateParameter("@empIDExecutor", SqlDbType.UniqueIdentifier, maintenanceVehicle.Executor == null ? Guid.Empty : maintenanceVehicle.Executor.EmpID),
             CreateParameter("@StartMaintenance", SqlDbType.VarChar, PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(maintenanceVehicle.StartMaintenance)),
             CreateParameter("@Remark", SqlDbType.VarChar, maintenanceVehicle.Remark)
             );
         maintenanceVehicle.MaintVehID = (Guid)cmd.Parameters["@maintvehID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
示例#16
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaintenanceVehicle = MaintenanceVehicle;
             _loadedMaterial = Material;
             _loadedExecutor = Executor;
             _loadedRemark = Remark;
             _loadedStartMaintenance = StartMaintenance;
             _loadedMaterialRevisions = MaterialRevisions;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }