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; }
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); }
public void Remove(MaintenanceVehicleObject value) { try { List.Remove(value); } 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); } }
// 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); } }
// 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); } }
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); } }
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(); } }
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); } }
// 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; } }
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); } }