CraftMaterialModel.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using GreenTree.Strohrmann.ERP.Core.Domain.Business;
  2. using GreenTree.Strohrmann.ERP.Web.Models.Shared;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Linq;
  7. using System.Threading.Tasks;
  8. namespace GreenTree.Strohrmann.ERP.Web.Models.Business
  9. {
  10. public class CraftMaterialModel
  11. {
  12. #region Properties
  13. /// <summary>
  14. /// Craft employee model index
  15. /// </summary>
  16. public int Index { get; set; }
  17. /// <summary>
  18. /// Craft id
  19. /// </summary>
  20. [Display(Name = "ID")]
  21. public int CraftId { get; set; }
  22. /// <summary>
  23. /// Craft
  24. /// </summary>
  25. [Display(Name = "Gewerk")]
  26. public virtual CraftModel Craft { get; set; }
  27. /// <summary>
  28. /// Material id
  29. /// </summary>
  30. [Display(Name = "Material ID")]
  31. public int MaterialId { get; set; }
  32. /// <summary>
  33. /// Material
  34. /// </summary>
  35. [Display(Name = "Material")]
  36. public MaterialModel Material { get; set; }
  37. /// <summary>
  38. /// The amount of the material
  39. /// </summary>
  40. [Display(Name = "Menge")]
  41. public decimal Amount { get; set; }
  42. /// <summary>
  43. /// The material calculation factor
  44. /// </summary>
  45. [Display(Name = "Kalkulationsfaktor")]
  46. public decimal CalculationFactor { get; set; }
  47. #endregion
  48. #region Ctor
  49. /// <summary>
  50. /// Initializes a new instance of the CraftMaterialModel class
  51. /// </summary>
  52. public CraftMaterialModel() { }
  53. /// <summary>
  54. /// Initializes a new instance of the CraftMaterialModel class
  55. /// </summary>
  56. /// <param name="craftMaterial">The base craft material.</param>
  57. public CraftMaterialModel(CraftMaterial craftMaterial)
  58. {
  59. if (craftMaterial == null) return;
  60. CraftId = craftMaterial.CraftId;
  61. MaterialId = craftMaterial.MaterialId;
  62. Amount = craftMaterial.Amount;
  63. CalculationFactor = craftMaterial.CalculationFactor;
  64. }
  65. #endregion
  66. }
  67. }