/// <summary> /// Returns the Iteration ID instance that matches this ID /// </summary> /// <param name="ID">The ID of a Iteration object we want retrieved. </param> /// <returns> A Iteration business container with Iteration ID record information. </returns> public static Biz.Containers.Iteration Get(int ID) { Data.Sql.IterationSql IterationSql = new Data.Sql.IterationSql(); Data.Containers.Iteration data = IterationSql.GetByID(ID); Biz.Containers.Iteration toReturn = ConvertFromDataContainer(data); return toReturn; }//end method
}//end method #endregion #region Conversion Methods /// <summary> /// Converts Data Container object to Business Container object /// </summary> /// <param name="data"> The data container Iteration object. </param> /// <returns> The business container Iteration object. </returns> internal static Biz.Containers.Iteration ConvertFromDataContainer(Data.Containers.Iteration data) { return new Biz.Containers.Iteration() { ID = data.ID, Region = Region.ConvertFromDataContainer(Data.Sql.RegionSql.CachedValues.Value.FirstOrDefault(x => x.ID == data.RegionID)), Product = Product.ConvertFromDataContainer(Data.Sql.ProductSql.CachedValues.Value.FirstOrDefault(x => x.ID == data.ProductID)), Configuration = Configuration.ConvertFromDataContainer(Data.Sql.ConfigurationSql.CachedValues.Value.FirstOrDefault(x => x.ID == data.ConfigurationID)), SKU = SKU.ConvertFromDataContainer(Data.Sql.SKUSql.CachedValues.Value.FirstOrDefault(x => x.ID == data.SKUID)), Measure = Measure.ConvertFromDataContainer(Data.Sql.MeasureSql.CachedValues.Value.FirstOrDefault(x => x.ID == data.MeasureID)) }; }//end Method