public void DenetimleriDoldur() { ProductRecomment.LoadCartRecomment(); DataTable dt = CartAccess.GetItems(); if (dt.Rows.Count == 0) { btnUpdate.Enabled = false; btnCheckOut.Enabled = false; lblNumberOfProduct.Text = "Sepetinizde Ürün Bulunmamaktadır"; grid.Visible = false; lblTotalAmount.Text = String.Format("{0:c}", 0); } else { grid.Visible = true; grid.DataSource = dt; grid.DataBind(); //string numberOfProduct = "6"; //lblNumberOfProduct.Text = "Toplam " + numberOfProduct + " ürün seçtiniz."; decimal amount = CartAccess.GetTotalAmount(); lblTotalAmount.Text = String.Format("{0:c}", amount); } }
public void DenetimleriYukle(ProductDetail prod) { ProductRecomment.LoadProductRecomment(prod.ProductID.ToString()); lblProdName.Text = prod.Name; lblProdPrice.Text = String.Format("{0:c}", prod.Price); lblProdDescription.Text = prod.Description; lblProdTakeTime.Text = prod.TakeTime; this.Title = Configuration.SiteName + " -> " + prod.Name; DataTable slider = CatalogAccess.GetProductPhotos(prod.ProductID.ToString()); ProdSlider.DataSource = slider; ProdSlider.DataBind(); string prevAttributeValue = ""; string attributeName, attributeValue, attributeValueID; Label attributeNameLabel; DropDownList attributeValuesDropDown = new DropDownList(); DataTable attrTable = CatalogAccess.GetProductAttributeValues(prod.ProductID.ToString()); foreach (DataRow r in attrTable.Rows) { attributeName = r["AttributeName"].ToString(); attributeValue = r["AttributeValue"].ToString(); attributeValueID = r["AttributeValueID"].ToString(); if (attributeName != prevAttributeValue) { prevAttributeValue = attributeName; attributeNameLabel = new Label(); attributeNameLabel.Text = attributeName + ":"; attributeValuesDropDown = new DropDownList(); attrPlaceHolder.Controls.Add(attributeNameLabel); attrPlaceHolder.Controls.Add(attributeValuesDropDown); } attributeValuesDropDown.Items.Add(new ListItem(attributeValue, attributeValueID)); } }