รวม code จากทุกคน ที่แก้ไข op ล่าสุด

This commit is contained in:
Nakorn Rientrakrunchai
2020-04-05 22:57:02 +07:00
parent 6135a2ec09
commit 9ffe9c30d3
46 changed files with 2636 additions and 529 deletions

View File

@@ -26,6 +26,7 @@ namespace TodoAPI2.Models
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; }
@@ -40,5 +41,27 @@ namespace TodoAPI2.Models
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;
}
}
}
}
}
}