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 EmployeeDegreeModel
    {
        #region Properties

        /// <summary>
        /// Degree Id
        /// </summary>
        [Display(Name = "ID")]
        public int Id { get; set; }

        /// <summary>
        /// Degree name
        /// </summary>
        [Display(Name = "Name")]
        public string Name { get; set; }

        /// <summary>
        /// Degree value
        /// </summary>
        [Display(Name = "Stundenwert (in Euro)")]
        public decimal Value { get; set; }

        /// <summary>
        /// Degree order
        /// </summary>
        [Display(Name = "Stufe")]
        public int Order { get; set; }

        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the EmployeeDegreeModel class
        /// </summary>
        public EmployeeDegreeModel() {  }

        /// <summary>
        /// Initializes a new instance of the EmployeeDegreeModel class
        /// </summary>
        /// <param name="employeeDegree">The base employee degree.</param>
        public EmployeeDegreeModel(EmployeeDegree employeeDegree)
        {
            if (employeeDegree == null) return;

            Id = employeeDegree.Id;
            Name = employeeDegree.Name;
            Value = employeeDegree.Value;
            Order = employeeDegree.Order;
        }

        #endregion

        #region Overrides

        /// <summary>
        /// Returns a string that represents the current object with its' name
        /// </summary>
        public override string ToString()
        {
            return Name;
        }

        #endregion
    }
}
