-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct.cs
40 lines (37 loc) · 1007 Bytes
/
Product.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace KisokDemo1
{
public class Product
{
public int id { get; set; }
public string name { get; set; }
public decimal price { get; set; }
public Image image { get; set; }
public Product()
{
}
//Constructor used to initialise the Product object
public Product(int _id, string _name, decimal _price)
{
id = _id;
name = _name;
price = _price;
}
public Product(int _id, string _name, decimal _price, string imagePath)
{
id = _id;
name = _name;
price = _price;
image = Image.FromFile(imagePath);
}
public override string ToString()
{
return $"{name}: {price.ToString()}";
}
}
}