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); }
public static MaterialTypeObject MaterialTypeRowToObject(DataRow MaterialType, string alias) { MaterialTypeObject obj = new MaterialTypeObject(); try { if (MaterialType != null) { if (RowFunctions.GetValueFromRowToGuid(MaterialType, MaterialTypeObject.ConvertColumnToAlias(MaterialTypeObject.MATTYP_ID, alias), false, DataRowVersion.Current) != Guid.Empty) { obj.MatTypID = RowFunctions.GetValueFromRowToGuid(MaterialType, MaterialTypeObject.ConvertColumnToAlias(MaterialTypeObject.MATTYP_ID, alias), true, DataRowVersion.Current); obj.MaterialCategory = MaterialCategoryConvertor.MaterialCategoryRowToObject(MaterialType, alias); obj.Type = RowFunctions.GetValueFromRowToString(MaterialType, MaterialTypeObject.ConvertColumnToAlias(MaterialTypeObject.TYPE, alias), false, DataRowVersion.Current); return(obj); } else { return(null); } } return(null); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
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); }