ПИбд-24 Ивлеев Д.А. Лабораторная работа 1 #1

Open
Pyro wants to merge 12 commits from Lab1 into main
4 changed files with 84 additions and 0 deletions
Showing only changes of commit a52f8193a0 - Show all commits

View File

@ -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,
};
}
}

View File

@ -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
};
}
}

View File

@ -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
};
}
}

View File

@ -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
};
}
}