private void RenderPicture(int id) { Label lblSold = FormView1.FindControl("lblSold") as Label; Label lblPrice = FormView1.FindControl("lblPrice") as Label; Label lblPrints = FormView1.FindControl("lblPrints") as Label; HtmlTableRow row = FormView1.FindControl("tdPrints") as HtmlTableRow; HiddenField Available = FormView1.FindControl("Available") as HiddenField; ArtGalleryDS.ReproductionDataTable rpt = ReproductionDL.GetByPictureId(id); // no originals left, but there are prints if (rpt.Rows.Count > 0 && Available.Value == "False") { lblPrice.Visible = false; btnBuy.Visible = false; lblPrints.Text = rpt[0].description; } // only originals left else if (Available.Value == "True" && rpt.Rows.Count == 0) { lblSold.Visible = false; row.Visible = false; } // prints and originals left else if (Available.Value == "True" && rpt.Rows.Count > 0) { lblSold.Visible = false; lblPrints.Text = rpt[0].description; } up1.Update(); up2.Update(); Label frame = FormView1.FindControl("lblFrame") as Label; Panel pnlFramed = FormView1.FindControl("pnlFramed") as Panel; CheckBox chkUnframed = FormView1.FindControl("chkUnframed") as CheckBox; pnlFramed.Visible = Available.Value == "True" && !frame.Text.ToUpper().Contains("UNFRAMED"); chkUnframed.Checked = !pnlFramed.Visible; }
protected bool GenerateInvoiceReproduction(int id, SpiceLogic.PayPalCtrlForWPS.Controls.BuyNowButton btnBuy) { ArtGalleryDS.ReproductionDataTable table = ReproductionDL.GetById(id); if (table == null || table.Rows.Count != 1) { return(false); } ArtGalleryDS.ReproductionRow row = table[0]; btnBuy.ItemName = string.Format("{0}: Print {1:0.00} by {2:0.00}", row.Title, row.height, row.width); btnBuy.ItemNumber = row.pictureid.ToString(); btnBuy.Weight = 1; btnBuy.ItemNumber = string.Format("{0:0}:{1:0}", row.pictureid, id); btnBuy.Handling = 10; btnBuy.Amount = row.price; btnBuy.Height = (int)Math.Min(row.width, row.height); btnBuy.Width = 3; btnBuy.AdditionalDataItems["unframed"] = "true"; btnBuy.AdditionalDataItems["width"] = row.width.ToString(); btnBuy.AdditionalDataItems["height"] = row.height.ToString(); btnBuy.AdditionalDataItems["strongbox"] = "none needed"; return(true); }