ПИбд-24 Ивлеев Д.А. Лабораторная работа 1 #1
@ -0,0 +1,22 @@
|
||||
namespace ProjectConfectionaryFactory.Entities;
|
||||
|
||||
public class Client
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public string Surname { get; private set; } = string.Empty;
|
||||
public double Phone { get; private set; }
|
||||
public string Address { get; private set; } = string.Empty;
|
||||
|
||||
public static Client CreateEntity(int id, string name, string surname, double phone, string address)
|
||||
{
|
||||
return new Client
|
||||
{
|
||||
Id = id,
|
||||
Name = name ?? string.Empty,
|
||||
Surname = surname ?? string.Empty,
|
||||
Phone = phone,
|
||||
Address = address ?? string.Empty,
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
namespace ProjectConfectionaryFactory.Entities;
|
||||
|
||||
public class Component
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public double Price { get; private set; }
|
||||
public double Weight { get; private set; }
|
||||
|
||||
public static Component CreateEntity(int id, string name, double price, double weight)
|
||||
{
|
||||
return new Component
|
||||
{
|
||||
Id = id,
|
||||
Name = name ?? string.Empty,
|
||||
Price = price,
|
||||
Weight = weight
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectConfectionaryFactory.Entities.Enums;
|
||||
|
||||
namespace ProjectConfectionaryFactory.Entities;
|
||||
|
||||
public class Product
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public ConfectionaryType ConfectionaryType { get; private set; }
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public double Price { get; private set; }
|
||||
|
||||
public static Product CreateEntity(int id, ConfectionaryType сonfectionaryType, string name, double price)
|
||||
{
|
||||
return new Product
|
||||
{
|
||||
Id = id,
|
||||
ConfectionaryType = сonfectionaryType,
|
||||
Name = name ?? string.Empty,
|
||||
Price = price
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
namespace ProjectConfectionaryFactory.Entities;
|
||||
|
||||
public class Supplier
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public double Phone { get; private set; }
|
||||
public string Address { get; private set; } = string.Empty;
|
||||
|
||||
public static Supplier CreateEntity(int id, string name, double phone, string address)
|
||||
{
|
||||
return new Supplier
|
||||
{
|
||||
Id = id,
|
||||
Name = name ?? string.Empty,
|
||||
Phone = phone,
|
||||
Address = address ?? string.Empty
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user