CraftEmployeeModel.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 CraftEmployeeModel
  11. {
  12. #region Properties
  13. /// <summary>
  14. /// Craft employee model index
  15. /// </summary>
  16. public int? Index { get; set; }
  17. /// <summary>
  18. /// Craft employee Dictionary identifier
  19. /// </summary>
  20. public string DictIdentifier { get; set; }
  21. /// <summary>
  22. /// Craft employee id
  23. /// </summary>
  24. public int Id { get; set; }
  25. /// <summary>
  26. /// Craft id
  27. /// </summary>
  28. [Display(Name = "ID")]
  29. public int CraftId { get; set; }
  30. /// <summary>
  31. /// Craft
  32. /// </summary>
  33. [Display(Name = "Gewerk")]
  34. public virtual CraftModel Craft { get; set; }
  35. /// <summary>
  36. /// Employee id
  37. /// </summary>
  38. [Display(Name = "Mitarbeiter")]
  39. public int EmployeeId { get; set; }
  40. /// <summary>
  41. /// Employee
  42. /// </summary>
  43. [Display(Name = "Mitarbeiter")]
  44. public virtual EmployeeModel Employee { get; set; }
  45. /// <summary>
  46. /// The amount of employee working hours
  47. /// </summary>
  48. [Display(Name = "Menge / Dauer")]
  49. public decimal Amount { get; set; }
  50. /// <summary>
  51. /// The value of the employee working hours
  52. /// </summary>
  53. [Display(Name = "Wert")]
  54. [DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:C}")]
  55. public float Value { get; set; }
  56. /// <summary>
  57. /// Craft employee comment
  58. /// </summary>
  59. [Display(Name = "Kommentar")]
  60. public string Comment { get; set; }
  61. #endregion
  62. #region Ctor
  63. /// <summary>
  64. /// Initializes a new instance of the CraftEmployeeModel class
  65. /// </summary>
  66. public CraftEmployeeModel() { }
  67. /// <summary>
  68. /// Initializes a new instance of the CraftEmployeeModel class
  69. /// </summary>
  70. /// <param name="craftEmployee">The base craft employee.</param>
  71. public CraftEmployeeModel(CraftEmployee craftEmployee)
  72. {
  73. if (craftEmployee == null) return;
  74. Id = craftEmployee.Id;
  75. CraftId = craftEmployee.CraftId;
  76. EmployeeId = craftEmployee.EmployeeId;
  77. Amount = craftEmployee.Amount;
  78. Value = Convert.ToSingle(craftEmployee.Value);
  79. Comment = craftEmployee.Comment;
  80. }
  81. #endregion
  82. }
  83. }