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 employee_leaveViewModel { public int? sum_day_sick_leave { get; set; } public int? count_sick_leave { get; set; } public int? sum_day_personal_leave { get; set; } public int? count_personal_leave { get; set; } public int? sum_day_vacation_leave { get; set; } public int? count_vacation_leave { get; set; } public int? count_stop_working { get; set; } public int? count_late_tad_processing_time_results { get; set; } public int? count_absence_tad_processing_time_results { get; set; } public int? sum_day_sick_personal_leave { get; set; } public int? count_sick_personal_leave { get; set; } } 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 string halfname { 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; } } } } }