TaxModel.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. namespace GreenTree.Strohrmann.ERP.Web.Models.Business
  7. {
  8. public class TaxModel
  9. {
  10. #region Properties
  11. /// <summary>
  12. /// Tax id
  13. /// </summary>
  14. [Display(Name = "ID")]
  15. public int Id { get; set; }
  16. /// <summary>
  17. /// Tax name
  18. /// </summary>
  19. [Display(Name = "Name")]
  20. public string Name { get; set; }
  21. /// <summary>
  22. /// Tax short name
  23. /// </summary>
  24. [Display(Name = "Kurzname")]
  25. public string ShortName { get; set; }
  26. /// <summary>
  27. /// Tax percentage value
  28. /// </summary>
  29. [Display(Name = "Steuersatz (in %)")]
  30. public float Value { get; set; }
  31. #endregion
  32. #region Ctor
  33. /// <summary>
  34. /// Initializes a new instance of the TaxModel class
  35. /// </summary>
  36. public TaxModel() { }
  37. /// <summary>
  38. /// Initializes a new instance of the TaxModel class
  39. /// </summary>
  40. /// <param name="tax">Base tax entity.</param>
  41. public TaxModel(Core.Domain.Business.Tax tax)
  42. {
  43. if (tax == null) return;
  44. Id = tax.Id;
  45. Name = tax.Name;
  46. ShortName = tax.ShortName;
  47. Value = tax.Value;
  48. }
  49. #endregion
  50. #region Overrides
  51. /// <summary>
  52. /// Returns a string that represents the current object with its' short name
  53. /// </summary>
  54. public override string ToString()
  55. {
  56. return ShortName;
  57. }
  58. #endregion
  59. }
  60. }