protected void Page_Load(object sender, EventArgs e) { string masp = Request.QueryString["MaSanPham"]; SanPhams sanpham = db.SanPhams.SingleOrDefault(p => p.MaSanPham.ToString() == masp); lblTenSanPham.Text = sanpham.TenSP; lblThongSoTongThe.Text = sanpham.ThongSoKyThuat; if (sanpham.SanPham_KhuyenMai.KhuyenMai.GiaCanGiam != null) { lblGiaBan.Font.Strikeout = true; lblGiaMoi.Text = "Giá bán: " + HienThiGia(Convert.ToDouble(TinhGiamGia(sanpham.SanPham_KhuyenMai.KhuyenMai.GiaCanGiam, sanpham.GiaBan).ToString())); } lblGiaBan.Text = HienThiGia(sanpham.GiaBan); lblBaoHanh.Text = sanpham.BaoHanh; lblKhuyenMai.Text = sanpham.SanPham_KhuyenMai.KhuyenMai.TenKhuyenMai; if (sanpham.SoLuong > 0) { lblKhoHang.Text = "Còn hàng"; } Image6.ImageUrl = sanpham.HinhAnh; Image6.DataBind(); var chitiet = from p in db.ChiTietThongSos where p.ThongSoKyThuat == sanpham.ThongSoKyThuat select p; if (chitiet != null) { DataList1.DataSource = chitiet; DataList1.DataBind(); } }
public void Image6_Clicked(object sender, EventArgs e) { Image6.ScaleTo(0.8); Image6.BorderWidth = 5; Image6.BorderColor = Xamarin.Forms.Color.Red; App.imsource = Image6.Source; }