-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduto.cs
52 lines (45 loc) · 1.04 KB
/
Produto.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
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AtividadeAvaliativa
{
internal class Produto
{
public Int64 Codigo { get; set; }
private String _nome;
public String Nome
{
get
{
return _nome;
}
set
{
if (value.Length > 32)
{
_nome = value.Substring(0, 32);
}
else
{
_nome = value;
}
}
}
public Decimal Preco { get; set; }
public Produto()
{
}
public Produto(long codigo, string nome, decimal preco)
{
Codigo = codigo;
Nome = nome;
Preco = preco;
}
public override string ToString()
{
return $"{Nome} [R${Preco}]";
}
}
}