| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using GreenTree.Strohrmann.ERP.Core.Domain.Business;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.Linq;
- using System.Threading.Tasks;
- namespace GreenTree.Strohrmann.ERP.Web.Models.Business
- {
- public class CraftModel
- {
- #region Properties
- /// <summary>
- /// Craft id
- /// </summary>
- [Display(Name = "ID")]
- public int Id { get; set; }
- /// <summary>
- /// Craft name
- /// </summary>
- [Display(Name = "Name")]
- public string Name { get; set; }
- /// <summary>
- /// Craft creation date
- /// </summary>
- [Display(Name = "Gestartet am")]
- public DateTime CreationDate { get; set; }
- /// <summary>
- /// Craft customer
- /// </summary>
- [Display(Name = "Kunde")]
- public CustomerModel Customer { get; set; }
- /// <summary>
- /// Craft employees
- /// </summary>
- [Display(Name = "Stunden")]
- public List<CraftEmployeeModel> CraftEmployees { get; set; }
- /// <summary>
- /// Craft materials
- /// </summary>
- [Display(Name = "Material")]
- public List<CraftMaterialModel> CraftMaterials { get; set; }
- #endregion
- #region Ctor
- /// <summary>
- /// Initializes a new instance of the CraftModel class
- /// </summary>
- public CraftModel() { }
- /// <summary>
- /// Initializes a new instance of the CraftModel class
- /// </summary>
- /// <param name="craft">The base craft.</param>
- public CraftModel(Craft craft)
- {
- if (craft == null) return;
- Id = craft.Id;
- Name = craft.Name;
- CreationDate = craft.CreationDate;
- Customer = new CustomerModel(craft.Customer);
- CraftEmployees = craft.CraftEmployees
- .Select(ce => new CraftEmployeeModel(ce))
- .ToList();
- CraftMaterials = craft.CraftMaterials
- .Select(cm => new CraftMaterialModel(cm))
- .ToList();
- }
- #endregion
- }
- }
|