コード例 #1
0
        public static RevisionObject RevisionRowToObject(DataRow Revision)
        {
            RevisionObject obj = new RevisionObject();

            try
            {
                if (Revision != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Revision, RevisionObject.REV_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.RevID            = RowFunctions.GetValueFromRowToGuid(Revision, RevisionObject.REV_ID, true, DataRowVersion.Current);
                        obj.MaterialCategory = MaterialCategoryConvertor.MaterialCategoryRowToObject(Revision, "");
                        obj.MaterialType     = MaterialTypeConvertor.MaterialTypeRowToObject(Revision, "");
                        obj.MaterialSubType  = MaterialSubTypeConvertor.MaterialSubTypeRowToObject(Revision, "");
                        obj.Revision         = RowFunctions.GetValueFromRowToString(Revision, RevisionObject.REVISION, 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 MaterialSubTypeObjectCollection GetAll()
        {
            MaterialSubTypeObjectCollection materialSubTypes = new MaterialSubTypeObjectCollection();
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendOrderBy(MaterialSubTypeObject.SUBTYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
                materialSubTypes = MaterialSubTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(materialSubTypes);
        }
コード例 #3
0
        public static MaterialObject MaterialRowToObject(DataRow Material)
        {
            MaterialObject obj = new MaterialObject();

            try
            {
                if (Material != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Material, MaterialObject.MAT_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.MatID               = RowFunctions.GetValueFromRowToGuid(Material, MaterialObject.MAT_ID, true, DataRowVersion.Current);
                        obj.MaterialCategory    = MaterialCategoryConvertor.MaterialCategoryRowToObject(Material, "");
                        obj.MaterialType        = MaterialTypeConvertor.MaterialTypeRowToObject(Material, "");
                        obj.MaterialSubType     = MaterialSubTypeConvertor.MaterialSubTypeRowToObject(Material, "");
                        obj.EmployeeCreator     = EmployeeConvertor.EmployeeRowToObject(Material, "Creator");
                        obj.EmployeeResponsable = EmployeeConvertor.EmployeeRowToObject(Material, "Responsable");
                        obj.Vehicle             = VehicleConvertor.VehicleRowToObject(Material);
                        obj.Supplier            = SupplierConvertor.SupplierRowToObject(Material);
                        obj.Name                 = RowFunctions.GetValueFromRowToString(Material, MaterialObject.NAME, false, DataRowVersion.Current);
                        obj.Description          = RowFunctions.GetValueFromRowToString(Material, MaterialObject.DESCRIPTION, false, DataRowVersion.Current);
                        obj.Type                 = (TIS.Framework.Common.Enumeration.Material.Type)RowFunctions.GetValueFromRowToInteger(Material, MaterialObject.TYPE, false, DataRowVersion.Current);
                        obj.SerieNumber          = RowFunctions.GetValueFromRowToString(Material, MaterialObject.SERIE_NUMBER, false, DataRowVersion.Current);
                        obj.InternalNumber       = RowFunctions.GetValueFromRowToString(Material, MaterialObject.INTERNAL_NUMBER, false, DataRowVersion.Current);
                        obj.PurchasedOn          = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Material, MaterialObject.PURCHASEDON, false, DataRowVersion.Current), false);
                        obj.Price                = RowFunctions.GetValueFromRowToDecimal(Material, MaterialObject.PRICE, false, DataRowVersion.Current);
                        obj.NextMaintenance      = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Material, MaterialObject.NEXT_MAINTENANCE, false, DataRowVersion.Current), false);
                        obj.MaintenanceFrequency = RowFunctions.GetValueFromRowToInteger(Material, MaterialObject.MAINTENANCE_FREQUENCY, false, DataRowVersion.Current);
                        obj.Broken               = RowFunctions.GetValueFromRowToBoolean(Material, MaterialObject.BROKEN, false, DataRowVersion.Current);
                        obj.Active               = RowFunctions.GetValueFromRowToBoolean(Material, MaterialObject.ACTIVE, false, DataRowVersion.Current);
                    }

                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
コード例 #4
0
        public MaterialSubTypeObjectCollection GetSubTypeByType(MaterialTypeObject type)
        {
            MaterialSubTypeObjectCollection materialSubTypes = new MaterialSubTypeObjectCollection();
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString(MaterialSubTypeObject.MATTYP_ID, type.MatTypID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
                builder.Append("AND " + MaterialSubTypeObject.MATTYP_ID + " is not null ");
                builder.AppendOrderBy(MaterialSubTypeObject.SUBTYPE, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
                materialSubTypes = MaterialSubTypeConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(materialSubTypes);
        }