コード例 #1
0
        public static MaintenanceObject MaintenanceRowToObject(DataRow Maintenance)
        {
            MaintenanceObject obj = new MaintenanceObject();

            try
            {
                if (Maintenance != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Maintenance, MaintenanceObject.MAINT_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.MaintID = RowFunctions.GetValueFromRowToGuid(Maintenance, MaintenanceObject.MAINT_ID, true, DataRowVersion.Current);
                        //obj.Material = MaterialConvertor.MaterialRowToObject(Maintenance);
                        //obj.MaintenanceVehicle = TIS.DL.Internal.MaintenanceVehicle.MaintenanceVehicleConvertor.MaintenanceVehicleRowToObject(Maintenance);
                        obj.Executor         = EmployeeConvertor.EmployeeRowToObject(Maintenance, "");
                        obj.StartMaintenance = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Maintenance, MaintenanceObject.START_MAINTENANCE, false, DataRowVersion.Current), false);
                        obj.Remark           = RowFunctions.GetValueFromRowToString(Maintenance, MaintenanceObject.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 MaintenanceObject MaintenanceRowToObject(DataRow Maintenance)
 {
     MaintenanceObject obj = new MaintenanceObject();
     try
     {
         if (Maintenance != null)
         {
             if (RowFunctions.GetValueFromRowToGuid(Maintenance, MaintenanceObject.MAINT_ID, false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.MaintID = RowFunctions.GetValueFromRowToGuid(Maintenance, MaintenanceObject.MAINT_ID, true, DataRowVersion.Current);
                 //obj.Material = MaterialConvertor.MaterialRowToObject(Maintenance);
                 //obj.MaintenanceVehicle = TIS.DL.Internal.MaintenanceVehicle.MaintenanceVehicleConvertor.MaintenanceVehicleRowToObject(Maintenance);
                 obj.Executor = EmployeeConvertor.EmployeeRowToObject(Maintenance,"");
                 obj.StartMaintenance = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Maintenance, MaintenanceObject.START_MAINTENANCE, false, DataRowVersion.Current), false);
                 obj.Remark = RowFunctions.GetValueFromRowToString(Maintenance, MaintenanceObject.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 int Add(MaintenanceObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #4
0
 public void Remove(MaintenanceObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #5
0
 // Called by MaintenanceObject when it changes
 internal void MaintenanceObjectChanged(MaintenanceObject Maintenance)
 {
     try
     {
         int index = List.IndexOf(Maintenance);
         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
     {
         MaintenanceObject Maintenance = new MaintenanceObject();
         List.Add(Maintenance);
         return(Maintenance);
     }
     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
     {
         MaintenanceObject Maintenance = (MaintenanceObject)value;
         Maintenance.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 MaterialRevisionObjectCollection GetByMaintenance(MaintenanceObject maintenance)
 {
     MaterialRevisionObjectCollection materialRevisions;
     try
     {
         materialRevisions = new MaterialRevisionDataService().GetByMaintenance(maintenance);
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return materialRevisions;
 }
コード例 #9
0
 public MaterialRevisionObjectCollection GetByMaintenance(MaintenanceObject maintenance)
 {
     MaterialRevisionObjectCollection materialRevisions = new MaterialRevisionObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(MaterialRevisionObject.MAINT_ID, maintenance.MaintID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + MaterialRevisionObject.MAINT_ID + " is not null ");
         materialRevisions = MaterialRevisionConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return materialRevisions;
 }
コード例 #10
0
 public MaintenanceObject GetNewest()
 {
     try
     {
         MaintenanceObject maintenance = new MaintenanceObject();
         foreach (MaintenanceObject obj in this.GetActive())
         {
             if (obj.StartMaintenance > maintenance.StartMaintenance)
             {
                 maintenance = obj;
             }
         }
         return(maintenance);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #11
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    MaintenanceObject oldMaintenance = (MaintenanceObject)oldValue;
                    MaintenanceObject newMaintenance = (MaintenanceObject)newValue;
                    oldMaintenance.Parent = null;
                    newMaintenance.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
コード例 #12
0
ファイル: Maintenance.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Remove(MaintenanceObject maintenance)
 {
     try
     {
         CheckTransaction();
         if (maintenance.MaterialRevisions.Count != 0)
             new BL.Internal.MaterialRevision(Transaction).RemoveAll(maintenance.MaterialRevisions);
         new MaintenanceDataService(Transaction).Remove(maintenance);
         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();
     }
 }
コード例 #13
0
 public Maintenance(PROF_IT.Common.Enumerations.TypeForm typeForm, MaterialObject material, MaintenanceObject maintenance)
 {
     try
     {
         InitializeComponent();
         _material    = material;
         _maintenance = maintenance;
         _typeForm    = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #14
0
ファイル: Maintenance.cs プロジェクト: GianiWVL/VUYLSTEKE
 public Maintenance(PROF_IT.Common.Enumerations.TypeForm typeForm, MaterialObject material, MaintenanceObject maintenance)
 {
     try
     {
         InitializeComponent();
         _material = material;
         _maintenance = maintenance;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #15
0
 public void Save(MaintenanceObject maintenance)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Maintenance_SAVE",
             CreateParameter("@maintID", SqlDbType.UniqueIdentifier, maintenance.MaintID, ParameterDirection.InputOutput),
             CreateParameter("@maintvehID", SqlDbType.UniqueIdentifier, maintenance.MaintenanceVehicle == null? Guid.Empty : maintenance.MaintenanceVehicle.MaintVehID),
             CreateParameter("@matID", SqlDbType.UniqueIdentifier, maintenance.Material.MatID),
             CreateParameter("@empIDExecutor", SqlDbType.UniqueIdentifier, maintenance.Executor == null ? Guid.Empty : maintenance.Executor.EmpID),
             CreateParameter("@Remark", SqlDbType.VarChar, maintenance.Remark),
             CreateParameter("@StartMaintenance", SqlDbType.VarChar, PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(maintenance.StartMaintenance))
             );
         maintenance.MaintID = (Guid)cmd.Parameters["@maintID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
コード例 #16
0
 public bool Remove(MaintenanceObject maintenance)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Maintenance_DELETE",
             CreateParameter("@maintID", SqlDbType.UniqueIdentifier, maintenance.MaintID, 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;
     }
 }
コード例 #17
0
 // Called by MaintenanceObject when it changes
 internal void MaintenanceObjectChanged(MaintenanceObject Maintenance)
 {
     try
     {
         int index = List.IndexOf(Maintenance);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #18
0
 public void Remove(MaintenanceObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #19
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         MaintenanceObject Maintenance = new MaintenanceObject();
         List.Add(Maintenance);
         return Maintenance;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #20
0
 public MaintenanceObject GetNewest()
 {
     try
     {
         MaintenanceObject maintenance = new MaintenanceObject();
         foreach (MaintenanceObject obj in this.GetActive())
         {
             if (obj.StartMaintenance > maintenance.StartMaintenance)
                 maintenance = obj;
         }
         return maintenance;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #21
0
 public int Add(MaintenanceObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #22
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedAnswer = Answer;
             _loadedMaintenance = Maintenance;
             _loadedRevision = Revision;
             _loadedCategory = Category;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
コード例 #23
0
ファイル: Maintenance.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Save(MaintenanceObject maintenance)
 {
     try
     {
         CheckTransaction();
         new MaintenanceDataService(Transaction).Save(maintenance);
         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();
     }
 }
コード例 #24
0
ファイル: Maintenance.cs プロジェクト: GianiWVL/VUYLSTEKE
 public void Initialize()
 {
     try
     {
         MaintenanceMember = new MaintenanceObject();
         MaintenanceMember.Material = Material;
         CreateNewMaterialRevisions();
         gdcRevision.DataSource = MaterialRevisions;
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }