สร้างตัวเตือน เกณฑ์คะแนน

This commit is contained in:
nakorn
2021-10-19 22:37:31 +07:00
parent ee76b39491
commit 77c8e31dcd
5 changed files with 46 additions and 3 deletions

View File

@@ -149,8 +149,23 @@ namespace TodoAPI2.Models
return "";
}
private (decimal?, decimal?) GetRangePercentage(List<eva_level_score_detailEntity> level_detail, decimal? score)
{
var item = (from i in level_detail
where i.min_value <= score && i.max_value >= score
select i).FirstOrDefault();
if(item != null)
{
return (item.min_percentage, item.max_percentage);
}
return (-100, 100);
}
public List<eva_adjust_postponement_detail_normal_02ViewModel> GetListBySearch(eva_adjust_postponement_detail_normal_02SearchModel model)
{
var level_detail = (from i in _repository.Context.eva_level_score_detail
select i).ToList();
var all_emp = emp.GetListByemployee_type(null, null);
var endDate = (from m_eva_adjust_postponement_detail_normal_02 in _repository.Context.eva_adjust_postponement_detail
@@ -255,6 +270,9 @@ namespace TodoAPI2.Models
salary_max = fk_external_linkageResult2.salary_max,
themax = fk_external_linkageResult2.themax,
min_percentage = GetRangePercentage(level_detail, m_eva_adjust_postponement_detail_normal_02.migration_total_score.HasValue ? m_eva_adjust_postponement_detail_normal_02.migration_total_score : m_eva_adjust_postponement_detail_normal_02.score_final).Item1,
max_percentage = GetRangePercentage(level_detail, m_eva_adjust_postponement_detail_normal_02.migration_total_score.HasValue ? m_eva_adjust_postponement_detail_normal_02.migration_total_score : m_eva_adjust_postponement_detail_normal_02.score_final).Item2,
isActive = m_eva_adjust_postponement_detail_normal_02.isActive,
Created = m_eva_adjust_postponement_detail_normal_02.created,
Updated = m_eva_adjust_postponement_detail_normal_02.updated

View File

@@ -67,5 +67,9 @@ namespace TodoAPI2.Models
public decimal? reward_old { get; set; }
public decimal? reward_new { get; set; }
public decimal? min_percentage { get; set; }
public decimal? max_percentage { get; set; }
}
}

View File

@@ -110,7 +110,7 @@ namespace TodoAPI2.Models
&& (m_eva_level_score_detail.level_score_id == model.level_score_id)
orderby m_eva_level_score_detail.created descending
orderby m_eva_level_score_detail.min_value descending
select new eva_level_score_detailViewModel()
{
id = m_eva_level_score_detail.id,