50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
using Microsoft.VisualBasic;
|
|
using ProjectLibrary.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ProjectLibrary.Entites
|
|
{
|
|
public class Orders
|
|
{
|
|
public int Id { get; private set; }
|
|
public DateTime OrderDate { get; private set; }
|
|
public DateTime ReturnDate { get; private set; }
|
|
public int ReaderID { get; private set; }
|
|
public IEnumerable<Book_Orders> BookOrders
|
|
{
|
|
get;
|
|
private set;
|
|
} = [];
|
|
|
|
|
|
public static Orders CreateEntity(int id, DateTime returnDate, int readerID, IEnumerable<Book_Orders> bookOrders)
|
|
{
|
|
return new Orders
|
|
{
|
|
Id = id,
|
|
OrderDate = DateTime.Now,
|
|
ReturnDate = returnDate,
|
|
ReaderID = readerID,
|
|
BookOrders = bookOrders
|
|
};
|
|
}
|
|
|
|
public static Orders CreateEntity(TempBookOrders tempBookOrders, IEnumerable<Book_Orders> bookOrders)
|
|
{
|
|
return new Orders
|
|
{
|
|
Id = tempBookOrders.Id,
|
|
OrderDate = tempBookOrders.OrderDate,
|
|
ReturnDate = tempBookOrders.ReturnDate,
|
|
ReaderID = tempBookOrders.ReaderID,
|
|
BookOrders = bookOrders
|
|
};
|
|
}
|
|
}
|
|
}
|