43 lines
984 B
C#
43 lines
984 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace samusev_42
|
|
{
|
|
public partial class CardForm : UserControl
|
|
{
|
|
public CardForm(Product product)
|
|
{
|
|
InitializeComponent();
|
|
|
|
labelName.Text = product.IdProductNameNavigation?.ProductName1 ?? "Название отсутствует";
|
|
|
|
labelPrice.Text = $"{product.Price:C2}";
|
|
|
|
labelDescription.Text = product.Description;
|
|
|
|
if (!string.IsNullOrEmpty(product.Photo))
|
|
{
|
|
try
|
|
{
|
|
pictureBoxProduct.ImageLocation = product.Photo;
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
private void CardForm_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|