protected void Page_Load(object sender, EventArgs e) { MLS mls = new MLS(); Listing l = mls.getListingByID(Convert.ToInt32(Request.QueryString["id"].ToString())); if (l.selling_point != null) { ltSellingPoint.Text = l.selling_point; } ltImageGallery.Text = l.image_gallery; if (Request.QueryString["type_id"] == "100") { ltPrice.Text = l.price; } else if (Request.QueryString["type_id"] == "200") { ltPrice.Text = l.rent + "/month"; } ltBed.Text = l.bed.ToString(); ltBath.Text = l.bath.ToString(); if (l.style != null) { ltStyle.Text = l.style.ToString(); } if (l.city != null) { ltCity.Text = l.city; } if (l.description != null) { ltDescription.Text = l.description; } if (l.status == 0) { imgStatus.ImageUrl = "/images/sale.png"; } else if (l.status == 1) { imgStatus.ImageUrl = "/images/undercontract_large.png"; } else if (l.status == 2) { imgStatus.ImageUrl = "/images/sold_large.png"; } else if (l.status == 3) { imgStatus.ImageUrl = "/images/leased_large.png"; } }
public string sContent = string.Empty;//For email blaster protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { MLS mls = new MLS(); Listing l = mls.getListingByID(Convert.ToInt32(Request.QueryString["id"].ToString())); tbSellingPoint.Text = l.selling_point; ltImageGallery.Text = l.image_gallery; tbListingID.Text = l.listing_id.ToString(); tbNumOfImages.Text = l.number_of_images.ToString(); //tbTimeStamp.Text = l.ts; //tbPath.Text = l.path.ToString(); tbBed.Text = l.bed.ToString(); if (l.bath != null) { tbBath.Text = l.bath.ToString(); } //tbStyle.Text = l.style; if (l.style != null) { ddlStyle.SelectedValue = l.style.ToString(); } tbAddress.Text = l.address; tbCity.Text = l.city; tbZip.Text = l.zip; if (l.description != null) { sContent = RTESafe(l.description); } if (l.sale) { cbSale.Checked = true; tbPrice.Text = l.price; } if (l.rental) { cbRental.Checked = true; tbRent.Text = l.rent; } if (l.featured) { cbFeatured.Checked = true; } ddlStatus.SelectedValue = l.status.ToString(); if (l.status == 0) { imgStatus.ImageUrl = "/images/sale.png"; } else if (l.status == 1) { imgStatus.ImageUrl = "/images/undercontract_large.png"; } else if (l.status == 2) { imgStatus.ImageUrl = "/images/sold_large.png"; } else if (l.status == 3) { imgStatus.ImageUrl = "/images/leased_large.png"; } } this.Master.Change_Nav("<a href=\"./\">Admin</a> :: Edit"); }