PIbd-24 Antonova A.A. LabWork_1 #1
@ -0,0 +1,30 @@
|
||||
using ProjectCompanyFurniture.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities;
|
||||
|
||||
public class Client
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public ClientType ClientType { get; private set; }
|
||||
|
||||
public bool Optovik { get; private set; }
|
||||
|
||||
public static Client CreateClient(int id, string name, ClientType clientType, bool optovik)
|
||||
{
|
||||
return new Client
|
||||
{
|
||||
ID = id,
|
||||
Name = name,
|
||||
ClientType = clientType,
|
||||
Optovik = optovik
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum ClientType
|
||||
{
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// частное лицо
|
||||
/// </summary>
|
||||
PrivatePerson = 1,
|
||||
/// <summary>
|
||||
/// предприниматель
|
||||
/// </summary>
|
||||
Entrepreneur = 2,
|
||||
/// <summary>
|
||||
/// организация
|
||||
/// </summary>
|
||||
Organization = 4
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities.Enums;
|
||||
|
||||
public enum Movement
|
||||
{
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// проступление
|
||||
/// </summary>
|
||||
Reseipt = 1,
|
||||
/// <summary>
|
||||
/// продажа
|
||||
/// </summary>
|
||||
Sale = 2,
|
||||
/// <summary>
|
||||
/// перемещение на склад
|
||||
/// </summary>
|
||||
MovingToWarehouse = 3,
|
||||
|
||||
/// <summary>
|
||||
/// подготовка к отправке
|
||||
/// </summary>
|
||||
PreparationForShipment = 4,
|
||||
/// <summary>
|
||||
/// перемещение в магазин
|
||||
/// </summary>
|
||||
MovingToStore = 5,
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities;
|
||||
|
||||
public class Invoice
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
|
||||
public int ClientID { get; set; }
|
||||
|
||||
public int AvailabilityOfPromotionalCode { get; set; }
|
||||
|
||||
public int DiscountPercentage { get; set; }
|
||||
|
||||
public int SellingPrice { get; set; }
|
||||
|
||||
DateTime Data { get; set; }
|
||||
|
||||
public static Invoice CreateInvoice(int id, int clientId, int availabilityOfPromotionalCode, int discountPercentage,
|
||||
int sellingPrice, DateTime data)
|
||||
{
|
||||
return new Invoice
|
||||
{
|
||||
ID = id,
|
||||
ClientID = clientId,
|
||||
AvailabilityOfPromotionalCode = availabilityOfPromotionalCode,
|
||||
DiscountPercentage = discountPercentage,
|
||||
SellingPrice = sellingPrice,
|
||||
Data = data
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture;
|
||||
|
||||
public class InvoiceProduct
|
||||
{
|
||||
public int InvoiceID { get; private set; }
|
||||
|
||||
public int ProductID { get; private set; }
|
||||
|
||||
public int Count { get; private set; }
|
||||
|
||||
public static InvoiceProduct CreateInvoiceProduct(int invoiceId, int productID, int count)
|
||||
{
|
||||
return new InvoiceProduct
|
||||
{
|
||||
InvoiceID = invoiceId,
|
||||
ProductID = productID,
|
||||
Count = count
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities;
|
||||
|
||||
public class Manufacturer
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public static Manufacturer CreateManufacturer(int iD, string name)
|
||||
{
|
||||
return new Manufacturer
|
||||
{
|
||||
ID = iD,
|
||||
Name = name
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
using ProjectCompanyFurniture.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectCompanyFurniture.Entities;
|
||||
|
||||
public class ProductMovement
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
|
||||
public int ProductID { get; private set; }
|
||||
|
||||
public Movement MovementProduct { get; private set; }
|
||||
|
||||
public ProductMovement CreateProductMovement (int it, int productId, Movement movement)
|
||||
{
|
||||
return new ProductMovement
|
||||
{
|
||||
ID = it,
|
||||
ProductID = productId,
|
||||
MovementProduct = movement
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user