using GreenTree.Strohrmann.ERP.Core.Domain.Business; using GreenTree.Strohrmann.ERP.Web.Models.Shared; 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 CraftEmployeeModel { #region Properties /// /// Craft employee model index /// public int Index { get; set; } /// /// Craft id /// [Display(Name = "ID")] public int CraftId { get; set; } /// /// Craft /// [Display(Name = "Gewerk")] public virtual CraftModel Craft { get; set; } /// /// Employee id /// [Display(Name = "Mitarbeiter")] public int EmployeeId { get; set; } /// /// Employee /// [Display(Name = "Mitarbeiter")] public virtual EmployeeModel Employee { get; set; } /// /// The amount of employee working hours /// [Display(Name = "Menge / Dauer")] public decimal Amount { get; set; } /// /// The value of the employee working hours /// [Display(Name = "Wert")] public float Value { get; set; } #endregion #region Ctor /// /// Initializes a new instance of the CraftEmployeeModel class /// public CraftEmployeeModel() { } /// /// Initializes a new instance of the CraftEmployeeModel class /// /// The base craft employee. public CraftEmployeeModel(CraftEmployee craftEmployee) { if (craftEmployee == null) return; CraftId = craftEmployee.CraftId; EmployeeId = craftEmployee.EmployeeId; Amount = craftEmployee.Amount; Value = Convert.ToSingle(craftEmployee.Value); } #endregion } }