68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using TTSW.EF;
|
|
using TTSW.Utils;
|
|
using TTSW.Constant;
|
|
using TTSW.Common;
|
|
|
|
namespace TodoAPI2.Models
|
|
{
|
|
public class external_employeeViewModel
|
|
{
|
|
public int id { get; set; }
|
|
|
|
public string position_number { get; set; }
|
|
|
|
public string position_name { get; set; }
|
|
|
|
public string fullname { get; set; }
|
|
|
|
public int? employee_type_id { get; set; }
|
|
|
|
public int? position_id { get; set; }
|
|
|
|
public int? position_type_id { get; set; }
|
|
public string position_type_name { get; set; }
|
|
|
|
public string user_email { get; set; }
|
|
|
|
public int? user_id { get; set; }
|
|
|
|
public int? department_id { get; set; }
|
|
public string department_name { get; set; }
|
|
public string department_code { get; set; }
|
|
public decimal? salary { get; set; }
|
|
public string employee_type_name { get; set; }
|
|
public string employee_no { get; set; }
|
|
|
|
public int? position_level_id { get; set; }
|
|
public string position_level_text { get; set; }
|
|
|
|
public DateTime? packing_date { get; set; }
|
|
|
|
public int? worked_month // ทำงานมาแล้วกี่เดือน
|
|
{
|
|
get
|
|
{
|
|
if (packing_date.HasValue)
|
|
{
|
|
DateTime startDate = packing_date.Value;
|
|
DateTime endDate = DateTime.Now;
|
|
int monthsApart = 12 * (startDate.Year - endDate.Year) + startDate.Month - endDate.Month;
|
|
return Math.Abs(monthsApart);
|
|
}
|
|
else
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|