}//end method /// <summary> /// Adds a record to the database via a RegionSql container. /// </summary> /// <param name="info"> The Region business container that needs to be added. </param> /// <returns> The Region ID of the item added to the database. </returns> public static int Add(Biz.Containers.Region info) { var data = ConvertToDataContainer(info); Data.Sql.RegionSql RegionSql = new Data.Sql.RegionSql(); int toReturn = RegionSql.Add(data); return toReturn; }//end method
/// <summary> /// Returns the Region ID instance that matches this ID /// </summary> /// <param name="ID">The ID of a Region object we want retrieved. </param> /// <returns> A Region business container with Region ID record information. </returns> public static Biz.Containers.Region Get(int ID) { Data.Sql.RegionSql RegionSql = new Data.Sql.RegionSql(); Data.Containers.Region data = RegionSql.GetByID(ID); Biz.Containers.Region toReturn = ConvertFromDataContainer(data); return toReturn; }//end method
}//end method /// <summary> /// Returns all Region items /// </summary> /// <returns> An array of Region Business containers. </returns> public static Biz.Containers.Region[] GetAll() { Data.Sql.RegionSql RegionSql = new Data.Sql.RegionSql(); Data.Containers.Region[] data = RegionSql.GetAll(); List<Biz.Containers.Region> toReturn = new List<Biz.Containers.Region>(); foreach (var info in data) { Biz.Containers.Region Region = ConvertFromDataContainer(info); toReturn.Add(Region); } return toReturn.ToArray(); }//end method
}//end method /// <summary> Deletes an Region record via RegionSql container. </summary> /// <param name="ID"> The ID of the Region record you want deleted. </param> public static void Delete(int ID) { Data.Sql.RegionSql RegionSql = new Data.Sql.RegionSql(); RegionSql.Delete(ID); }//end method
}//end method /// <summary> /// Updates a record via the RegionSql container. /// </summary> /// <param name="info"> The Region container object we want to update. </param> public static void Update(Biz.Containers.Region info) { var data = ConvertToDataContainer(info); Data.Sql.RegionSql RegionSql = new Data.Sql.RegionSql(); RegionSql.Update(data); }//end method