using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using ButterfieldGardens.Web; public partial class inventory_index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Navigation objNav = new Navigation(); header.InnerHtml = objNav.GetHeader(); nav.InnerHtml = objNav.GetMainNavSideMenu(); slideshow2.InnerHtml = objNav.GetRandomSlideShowImage(); subnav.InnerHtml = objNav.GetSubNavUnderMainImage(); footer.InnerHtml = objNav.GetFooter(true, false); Load_Inventory(); Page.MaintainScrollPositionOnPostBack = true; } public void Load_Inventory() { cInventoryDAO objInvDAO = new cInventoryDAO(); cInventoryList objInvList = objInvDAO.GetInventoryList(); int nInvCount = objInvList.count; //if there are no inventory items, tell the user and stop processing code if (nInvCount.Equals(0)) { Literal lit = new Literal(); lit.Text = "

There are no inventory homes currently for sale.

"; lit.Text += "


"; pnlInventory.Controls.Add(lit); lit.Dispose(); return; } for (int nInvIndex = 0; nInvIndex < nInvCount; nInvIndex++) { Literal litInv = new Literal(); String detailURL = "/build/inventory/details/?i=" + objInvList[nInvIndex].InventoryId.ToString(); String invDescrip = objInvList[nInvIndex].InventoryDescription; if (objInvList[nInvIndex].InventoryDescription.Length > 200) { invDescrip = objInvList[nInvIndex].InventoryDescription.Substring(0,200); } cImage objImg = objInvDAO.GetThumbnail(objInvList[nInvIndex].InventoryId.ToString()); litInv.Text = "
"; litInv.Text += "
"; litInv.Text += ""; //INSERT THUMBNAIL WITH ALT TAG litInv.Text += "
"; litInv.Text += "
"; litInv.Text += "

"; litInv.Text += objInvList[nInvIndex].InventoryTitle + "

"; litInv.Text += "

" + invDescrip; litInv.Text += "... more

"; litInv.Text += "
"; litInv.Text += "
"; if (!nInvIndex.Equals(nInvCount - 1)) { litInv.Text += "
"; } litInv.Text += "
"; pnlInventory.Controls.Add(litInv); litInv.Dispose(); } } }