แยกเมนู แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2 ออกมา

This commit is contained in:
Nakorn Rientrakrunchai
2021-02-10 15:54:45 +07:00
parent fe4e051f62
commit 682dc2e5ae
21 changed files with 1639 additions and 194 deletions

View File

@@ -0,0 +1,188 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Logging;
using TTSW.Controllers;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
using System.Data;
using Microsoft.Extensions.Configuration;
using System.IO;
using System.Net;
namespace TodoAPI2.Controllers
{
//[Authorize]
[Produces("application/json")]
[Route("api/eva_create_evaluation_detail_firstdoc")]
public class eva_create_evaluation_detail_firstdocController : BaseController
{
#region Private Variables
private ILogger<eva_create_evaluation_detail_firstdocController> _logger;
private Ieva_create_evaluation_detail_firstdocService _repository;
private Iexternal_employeeService emp;
private IConfiguration Configuration { get; set; }
#endregion
#region Properties
#endregion
/// <summary>
/// Default constructure for dependency injection
/// </summary>
/// <param name="repository"></param>
/// <param name="configuration"></param>
/// <param name="inemp"></param>
/// <param name="logger"></param>
public eva_create_evaluation_detail_firstdocController(ILogger<eva_create_evaluation_detail_firstdocController> logger,
Ieva_create_evaluation_detail_firstdocService repository, IConfiguration configuration,
Iexternal_employeeService inemp)
{
_logger = logger;
_repository = repository;
Configuration = configuration;
emp = inemp;
}
/// <summary>
/// Get specific item by id
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return Get specific item by id</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("{id}")]
[ProducesResponseType(typeof(eva_create_evaluation_detail_firstdocWithSelectionViewModel), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult Get(int id)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.GetWithSelection(id);
return Ok(result);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult Get.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get Blank Item
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return a blank item</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("GetBlankItem")]
[ProducesResponseType(typeof(eva_create_evaluation_detail_firstdocWithSelectionViewModel), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetBlankItem()
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.GetBlankItem();
return Ok(result);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get list items by create_evaluation_id
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("")]
[ProducesResponseType(typeof(List<eva_create_evaluation_detail_firstdocViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetList(int? create_evaluation_id)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
{
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
return Ok(_repository.GetListBycreate_evaluation_id(create_evaluation_id, e.id));
}
else
{
return Unauthorized();
}
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get list items by search
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("GetListBySearch")]
[ProducesResponseType(typeof(List<eva_create_evaluation_detail_firstdocViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
{
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
var e = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
return Ok(_repository.GetListBySearch(model, e.id));
}
else
{
return Unauthorized();
}
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
}
}

22
EF/_IBaseService2.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TTSW.EF
{
public interface IBaseService2<Key, InputModel, ViewModel>
{
#region Query Functions
ViewModel Get(Key id);
#endregion
#region Manipulation Functions
ViewModel Insert(InputModel model, bool is_force_save);
ViewModel Update(Key id, InputModel model, bool is_force_save);
ViewModel SetAsActive(Key id);
ViewModel SetAsInactive(Key id);
void Delete(Key id);
#endregion
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
namespace TodoAPI2.Models
{
public interface Ieva_create_evaluation_detail_firstdocService
{
List<eva_create_evaluation_detail_firstdocViewModel> GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id);
List<eva_create_evaluation_detail_firstdocViewModel> GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model, int? emp_id);
eva_create_evaluation_detail_firstdocWithSelectionViewModel GetWithSelection(int id);
eva_create_evaluation_detail_firstdocWithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,48 @@
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 eva_create_evaluation_detail_firstdocInputModel
{
public int? id { get; set; }
public string evaluation_round { get; set; }
public string employee_code { get; set; }
public string employee_fullname { get; set; }
public string employee_position { get; set; }
public string employee_position_type { get; set; }
public string employee_position_level { get; set; }
public string employee_org { get; set; }
public string chief_fullname { get; set; }
public string chief_position { get; set; }
public int? create_evaluation_id { get; set; }
public int? org_id { get; set; }
public string search_employee_code { get; set; }
public string search_employee_fullname { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
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 eva_create_evaluation_detail_firstdocReportRequestModel : eva_create_evaluation_detail_firstdocSearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,29 @@
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 eva_create_evaluation_detail_firstdocSearchModel
{
public int id { get; set; }
public int? create_evaluation_id { get; set; }
public int? org_id { get; set; }
public string search_employee_code { get; set; }
public string search_employee_fullname { get; set; }
}
}

View File

@@ -0,0 +1,264 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
using System.IO;
using System.Web;
using System.Net;
using TTSW.Configure;
using Microsoft.Extensions.Options;
using System.Data;
namespace TodoAPI2.Models
{
public class eva_create_evaluation_detail_firstdocService : Ieva_create_evaluation_detail_firstdocService
{
private IBaseRepository2<eva_create_evaluation_detailEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
public eva_create_evaluation_detail_firstdocService(IBaseRepository2<eva_create_evaluation_detailEntity, int> repository, IMyDatabase mydb,
Iexternal_linkageService inext, Iexternal_employeeService inemp)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
}
#region Private Functions
private eva_create_evaluation_detailEntity GetEntity(eva_create_evaluation_detail_firstdocInputModel model)
{
return Mapper.Map<eva_create_evaluation_detailEntity>(model);
}
private List<eva_create_evaluation_detailEntity> GetEntityList(List<eva_create_evaluation_detail_firstdocInputModel> models)
{
return Mapper.Map<List<eva_create_evaluation_detailEntity>>(models);
}
private eva_create_evaluation_detail_firstdocViewModel GetDto(eva_create_evaluation_detailEntity entity)
{
return Mapper.Map<eva_create_evaluation_detail_firstdocViewModel>(entity);
}
private List<eva_create_evaluation_detail_firstdocViewModel> GetDtoList(List<eva_create_evaluation_detailEntity> entities)
{
return Mapper.Map<List<eva_create_evaluation_detail_firstdocViewModel>>(entities);
}
#endregion
#region Public Functions
#region Query Functions
public string GetWorkTimeText(DateTime? startDate, DateTime? endDate)
{
if (!endDate.HasValue || !startDate.HasValue)
return "";
int monthsApart = 12 * (startDate.Value.Year - endDate.Value.Year) + startDate.Value.Month - endDate.Value.Month;
if (Math.Abs(monthsApart) < 4)
{
return "ปฏิบัติงานไม่ครบ 4 เดือน";
}
return "";
}
public eva_create_evaluation_detail_firstdocViewModel Get(int id)
{
var allemp = emp.GetListByemployee_type(null, null);
var endDate = (from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail
join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id
into eva_create_evaluationResult10
from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty()
join i in _repository.Context.eva_performance_plan_detail
on fk_eva_create_evaluationResult10.performance_plan_id equals i.performance_plan_id
where m_eva_create_evaluation_detail_agreement.id == id
select i.end_date).Max();
var data = (
from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail
join fk_external_employee in allemp on m_eva_create_evaluation_detail_agreement.employee_id equals fk_external_employee.id
into external_employeeResult
from fk_external_employee in external_employeeResult.DefaultIfEmpty()
join fk_external_chief in allemp on m_eva_create_evaluation_detail_agreement.chief equals fk_external_chief.id
into external_chiefResult
from fk_external_chief in external_chiefResult.DefaultIfEmpty()
join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id
into eva_create_evaluationResult10
from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty()
where m_eva_create_evaluation_detail_agreement.id == id
orderby m_eva_create_evaluation_detail_agreement.created descending
select new eva_create_evaluation_detail_firstdocWithSelectionViewModel()
{
id = m_eva_create_evaluation_detail_agreement.id,
evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.display_text,
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,
employee_position_type = fk_external_employee.position_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
chief_fullname = fk_external_chief.fullname,
chief_position = fk_external_chief.position_name,
create_evaluation_id = m_eva_create_evaluation_detail_agreement.create_evaluation_id,
org_id = fk_external_employee.department_id,
search_employee_code = fk_external_employee.employee_no,
search_employee_fullname = fk_external_employee.fullname,
status_self = m_eva_create_evaluation_detail_agreement.status_self,
status_chief = m_eva_create_evaluation_detail_agreement.status_chief,
status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor,
org_id_external_linkage_external_name = fk_external_employee.department_name,
remark_hrm_work_record = fk_external_employee.remark_hrm_work_record
+ GetWorkTimeText(fk_external_employee.packing_date, endDate),
score1 = fk_eva_create_evaluationResult10.score1,
score2 = fk_eva_create_evaluationResult10.score2,
isActive = m_eva_create_evaluation_detail_agreement.isActive,
Created = m_eva_create_evaluation_detail_agreement.created,
Updated = m_eva_create_evaluation_detail_agreement.updated
}
).ToList();
return data[0];
}
public eva_create_evaluation_detailEntity GetEntity(int id)
{
var entity = _repository.Get(id);
return entity;
}
public DataContext GetContext()
{
return _repository.Context;
}
public eva_create_evaluation_detail_firstdocWithSelectionViewModel GetWithSelection(int id)
{
var entity = Get(id);
var i = Mapper.Map<eva_create_evaluation_detail_firstdocWithSelectionViewModel>(entity);
i.item_org_id = ext.GetDepartmentData();
return i;
}
public eva_create_evaluation_detail_firstdocWithSelectionViewModel GetBlankItem()
{
var i = new eva_create_evaluation_detail_firstdocWithSelectionViewModel();
i.item_org_id = ext.GetDepartmentData();
return i;
}
public List<eva_create_evaluation_detail_firstdocViewModel> GetListBycreate_evaluation_id(int? create_evaluation_id, int? emp_id)
{
var model = new eva_create_evaluation_detail_firstdocSearchModel();
model.create_evaluation_id = create_evaluation_id;
return GetListBySearch(model, emp_id);
}
public List<eva_create_evaluation_detail_firstdocViewModel> GetListBySearch(eva_create_evaluation_detail_firstdocSearchModel model, int? emp_id)
{
var allemp = emp.GetListByemployee_type(null, null);
var data = (
from m_eva_create_evaluation_detail_agreement in _repository.Context.eva_create_evaluation_detail
join fk_external_employee in allemp on m_eva_create_evaluation_detail_agreement.employee_id equals fk_external_employee.id
into external_employeeResult
from fk_external_employee in external_employeeResult.DefaultIfEmpty()
join fk_external_chief in allemp on m_eva_create_evaluation_detail_agreement.chief equals fk_external_chief.id
into external_chiefResult
from fk_external_chief in external_chiefResult.DefaultIfEmpty()
join fk_eva_create_evaluation10 in _repository.Context.eva_create_evaluation on m_eva_create_evaluation_detail_agreement.create_evaluation_id equals fk_eva_create_evaluation10.id
into eva_create_evaluationResult10
from fk_eva_create_evaluationResult10 in eva_create_evaluationResult10.DefaultIfEmpty()
join fk_plan in _repository.Context.eva_performance_plan on fk_eva_create_evaluationResult10.performance_plan_id equals fk_plan.id
into planResult
from fk_planResult in planResult.DefaultIfEmpty()
where 1 == 1
&& (m_eva_create_evaluation_detail_agreement.create_evaluation_id == model.create_evaluation_id || !model.create_evaluation_id.HasValue)
&& (fk_external_employee.department_id == model.org_id || !model.org_id.HasValue)
&& (fk_external_employee.employee_no == model.search_employee_code || string.IsNullOrEmpty(model.search_employee_code))
&& (fk_external_employee.fullname.Contains(model.search_employee_fullname) || string.IsNullOrEmpty(model.search_employee_fullname))
&& m_eva_create_evaluation_detail_agreement.employee_id == emp_id
orderby m_eva_create_evaluation_detail_agreement.created descending
select new eva_create_evaluation_detail_firstdocViewModel()
{
id = m_eva_create_evaluation_detail_agreement.id,
evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.theTime.ToString(),
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,
employee_position_type = fk_external_employee.employee_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
chief_fullname = fk_external_chief.fullname,
chief_position = fk_external_chief.position_name,
create_evaluation_id = m_eva_create_evaluation_detail_agreement.create_evaluation_id,
org_id = fk_external_employee.department_id,
search_employee_code = fk_external_employee.employee_no,
search_employee_fullname = fk_external_employee.fullname,
status_self = m_eva_create_evaluation_detail_agreement.status_self,
status_chief = m_eva_create_evaluation_detail_agreement.status_chief,
status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor,
org_id_external_linkage_external_name = fk_external_employee.department_name,
status_self_click_date = m_eva_create_evaluation_detail_agreement.status_self_click_date,
status_chief_click_date = m_eva_create_evaluation_detail_agreement.status_chief_click_date,
status_supervisor_click_date = m_eva_create_evaluation_detail_agreement.status_supervisor_click_date,
plan_round_year = checkNull(fk_planResult.theTime) + "/" + checkNull(fk_planResult.fiscal_year),
isActive = m_eva_create_evaluation_detail_agreement.isActive,
Created = m_eva_create_evaluation_detail_agreement.created,
Updated = m_eva_create_evaluation_detail_agreement.updated
}
).ToList();
return data;
}
private string checkNull(object i)
{
if (i != null)
{
return i.ToString();
}
return "";
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,85 @@
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 eva_create_evaluation_detail_firstdocViewModel : BaseViewModel2<int>
{
public string evaluation_round { get; set; }
public string employee_code { get; set; }
public string employee_fullname { get; set; }
public string employee_position { get; set; }
public string employee_position_type { get; set; }
public string employee_position_level { get; set; }
public string employee_org { get; set; }
public string chief_fullname { get; set; }
public string chief_position { get; set; }
public int? create_evaluation_id { get; set; }
public int? org_id { get; set; }
public string search_employee_code { get; set; }
public string search_employee_fullname { get; set; }
public string org_id_external_linkage_external_name { get; set; }
public string status_self { get; set; }
public string status_chief { get; set; }
public string status_supervisor { get; set; }
public string remark_hrm_work_record { get; set; }
public string plan_round_year { get; set; }
public DateTime? status_self_click_date { get; set; }
public DateTime? status_chief_click_date { get; set; }
public DateTime? status_supervisor_click_date { get; set; }
public decimal? score1 { get; set; }
public decimal? score2 { get; set; }
public string txt_status_self { get { return getStatusText(status_self) + MyHelper.GetDateStringForReport(status_self_click_date); } }
public string txt_status_chief { get { return getStatusText(status_chief) + MyHelper.GetDateStringForReport(status_chief_click_date); } }
public string txt_status_supervisor { get { return getStatusText(status_supervisor) + MyHelper.GetDateStringForReport(status_supervisor_click_date); } }
private string getStatusText(string s)
{
if (!string.IsNullOrEmpty(s))
{
if (s == "Y")
{
return "ส่งแบบประเมินแล้ว <br/>";
}
else if (s == "N")
{
return "ตีกลับ <br/>";
}
}
return " ";
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class eva_create_evaluation_detail_firstdocWithSelectionViewModel: eva_create_evaluation_detail_firstdocViewModel
{
public List<external_linkageViewModel> item_org_id { get; set; }
}
}

View File

@@ -308,6 +308,8 @@ namespace Test01
services.AddScoped<IBaseRepository2<eva_evaluation_operating_agreementEntity, int>, BaseRepository2<eva_evaluation_operating_agreementEntity, int>>();
services.AddScoped<Ieva_evaluation_operating_agreementService, eva_evaluation_operating_agreementService>();
services.AddScoped<Ieva_create_evaluation_detail_firstdocService, eva_create_evaluation_detail_firstdocService>();
#endregion
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
@@ -559,6 +561,10 @@ namespace Test01
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementViewModel>();
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementWithSelectionViewModel>();
cfg.CreateMap<eva_create_evaluation_detail_firstdocInputModel, eva_create_evaluation_detailEntity>();
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_firstdocViewModel>();
cfg.CreateMap<eva_create_evaluation_detailEntity, eva_create_evaluation_detail_firstdocWithSelectionViewModel>();
});
#endregion

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using TodoAPI2.Models;
using STAFF_API.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;
using TodoAPI2.Controllers;
namespace TodoAPI2.Controllers
{
public class eva_create_evaluation_detail_firstdocViewController : Controller
{
private ILogger<eva_create_evaluation_detail_firstdocController> _logger;
private Ieva_create_evaluation_detail_firstdocService _repository;
private IConfiguration Configuration { get; set; }
/// <summary>
/// Default constructure for dependency injection
/// </summary>
/// <param name="repository"></param>
/// <param name="configuration"></param>
/// <param name="logger"></param>
public eva_create_evaluation_detail_firstdocViewController(ILogger<eva_create_evaluation_detail_firstdocController> logger, Ieva_create_evaluation_detail_firstdocService repository, IConfiguration configuration)
{
_logger = logger;
_repository = repository;
Configuration = configuration;
}
public IActionResult eva_create_evaluation_detail_firstdoc()
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
return View();
}
public IActionResult eva_create_evaluation_detail_firstdoc_d()
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}

View File

@@ -5,6 +5,7 @@
Layout = "_LayoutDirect";
}
<div class="modal fade" id="eva_evaluation_behaviorModel" style="z-index:1500" role="dialog" aria-labelledby="eva_evaluation_behaviorModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
@@ -209,83 +210,8 @@
</div>
</div>
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="report_xModelLabel">พิมพ์แบบข้อตกลงการประเมิน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="eva_evaluation_operating_agreementModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_evaluation_operating_agreementModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eva_evaluation_operating_agreementModelLabel">บันทึกข้อมูล ข้อตกลงการปฏิบัติงาน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_id" />
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_create_evaluation_detail_id" />
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_evaluation_operating_agreement_mission_no" for="eva_evaluation_operating_agreement_mission_no">ภารกิจที่</label>
<input class="form-control" type="number" id="eva_evaluation_operating_agreement_mission_no" iLabel="ภารกิจที่" iRequire="true" iGroup="eva_evaluation_operating_agreement" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_mission_detail" for="eva_evaluation_operating_agreement_mission_detail">รายละเอียดภารกิจ</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_mission_detail" iLabel="รายละเอียดภารกิจ" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_target" for="eva_evaluation_operating_agreement_target">เป้าหมาย</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_target" iLabel="เป้าหมาย" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_indicators" for="eva_evaluation_operating_agreement_indicators">ตัวชี้วัด</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_indicators" iLabel="ตัวชี้วัด" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_operating_agreement_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>การประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</div>
@@ -345,38 +271,6 @@
<br />
<section class="wrapper">
<div class="title"><div class="line"></div>ข้อตกลงการปฏิบัติงาน</div>
<div class="tools">
<div class="row">
<input class="form-control" type="hidden" id="s_eva_evaluation_operating_agreement_create_evaluation_detail_id" />
<div class="col-md-6">
<button class="btn btn-info" onclick="javascript:eva_evaluation_operating_agreement_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
<button class="btn btn-info" onclick="javascript:rep_eva_p01_DoSearch('pdf');">พิมพ์แบบข้อตกลง</button>
</div>
</div>
</div>
<table id="eva_evaluation_operating_agreementTable" class="display table table-bordered table-striped">
<thead>
<tr>
<!--<th>เลือก</th>-->
<th width="5%">เครื่องมือ</th>
<th width="5%"><label id='h_eva_evaluation_operating_agreement_mission_no'>ภารกิจที่</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_mission_detail'>รายละเอียดภารกิจ</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_target'>เป้าหมาย</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_indicators'>ตัวชี้วัด</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
<br />
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>ผลสัมฤทธิ์ของงาน (น้ำหนัก <span id="eva_create_evaluation_detail_agreement_score1"></span>%)</div>
<div class="tools">
@@ -484,7 +378,7 @@
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('next0')">ส่งข้อตกลงการประเมิน</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:alert('บันทึกเรียบร้อย')">บันทึก</button>
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
@@ -499,8 +393,6 @@
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_idp_plan_owner/eva_idp_plan_owner.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/rep_eva_x/rep_eva_p01_report.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js?version=@MyHelper.GetDummyText()"></script>
<script>
var status_self = "";
@@ -517,9 +409,7 @@
eva_idp_plan_owner_InitiateDataTable(id);
eva_idp_plan_owner_InitialForm();
eva_evaluation_operating_agreement_InitiateDataTable();
eva_evaluation_operating_agreement_InitialForm();
} else {
eva_create_evaluation_detail_agreement_SetCreateForm();
@@ -528,7 +418,6 @@
SetupValidationRemark("eva_evaluation_achievement");
SetupValidationRemark("eva_evaluation_behavior");
SetupValidationRemark("eva_idp_plan_owner");
SetupValidationRemark("eva_evaluation_operating_agreement");
setTimeout(CheckPermission, 1000);
});

View File

@@ -0,0 +1,87 @@
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@{
ViewData["Title"] = "eva_create_evaluation_detail_firstdoc";
}
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@Environment.GetEnvironmentVariable("SiteInformation_modulename")
</div>
</div>
<div class="col-md-7">
<ol class="breadcrumb" style="">
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")">หน้าแรก</a></li>
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")@MyHelper.GetConfig(Configuration, "SiteInformation:appsite")">@Environment.GetEnvironmentVariable("SiteInformation_modulename")</a></li>
<li class="breadcrumb-item active">
แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2
</li>
</ol>
</div>
</div>
<section class="wrapper">
<div class="title">
<div class="line"></div> แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2
</div>
<div class="tools">
<div class="row">
<input class="form-control" type="hidden" id="s_eva_create_evaluation_detail_firstdoc_create_evaluation_id" />
<div class="form-group col-md-3">
<label id='lab_s_eva_create_evaluation_detail_firstdoc_org_id' for='s_eva_create_evaluation_detail_firstdoc_org_id'>หน่วยงาน</label>
<select class="form-control" id="s_eva_create_evaluation_detail_firstdoc_org_id" iLabel="หน่วยงาน" iRequire="true" iGroup="s_eva_create_evaluation_detail_firstdoc" title='หน่วยงาน' placeholder='หน่วยงาน'></select>
</div>
<div class="form-group col-md-3">
<label id='lab_s_eva_create_evaluation_detail_firstdoc_search_employee_code' for='s_eva_create_evaluation_detail_firstdoc_search_employee_code'>รหัสพนักงาน</label>
<input class="form-control" type="text" id="s_eva_create_evaluation_detail_firstdoc_search_employee_code" iLabel="รหัสพนักงาน" iRequire="true" iGroup="s_eva_create_evaluation_detail_firstdoc" title='รหัสพนักงาน' placeholder='รหัสพนักงาน' />
</div>
<div class="form-group col-md-3">
<label id='lab_s_eva_create_evaluation_detail_firstdoc_search_employee_fullname' for='s_eva_create_evaluation_detail_firstdoc_search_employee_fullname'>ชื่อ-สกุล</label>
<input class="form-control" type="text" id="s_eva_create_evaluation_detail_firstdoc_search_employee_fullname" iLabel="ชื่อ-สกุล" iRequire="true" iGroup="s_eva_create_evaluation_detail_firstdoc" title='ชื่อ-สกุล' placeholder='ชื่อ-สกุล' />
</div>
<div class="col-md-3">
<br />
<button class="btn btn-info" onclick="javascript:eva_create_evaluation_detail_firstdoc_DoSearch();"><i class="fa fa-search" style="font-size: 14px;"></i> ค้นหา</button>
</div>
</div>
</div>
<div style="overflow-x: auto;">
<table id="eva_create_evaluation_detail_firstdocTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th><label>รอบการประเมิน</label></th>
<th><label id='h_eva_create_evaluation_detail_firstdoc_employee_code'>รหัสพนักงาน</label></th>
<th><label id='h_eva_create_evaluation_detail_firstdoc_employee_fullname'>ชื่อ-สกุล</label></th>
<th><label id='h_eva_create_evaluation_detail_firstdoc_employee_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_create_evaluation_detail_firstdoc_employee_position_level'>ระดับตำแหน่ง</label></th>
<th><label id='h_eva_create_evaluation_detail_firstdoc_employee_org'>หน่วยงาน</label></th>
<th><label>สถานะทำแบบประเมิน<br />(ผู้รับการประเมิน)</label></th>
<th><label>สถานะทำแบบประเมิน<br />(ผู้ประเมิน)</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js?version=@MyHelper.GetDummyText()"></script>
<script>
$(document).ready(function () {
eva_create_evaluation_detail_firstdoc_InitiateDataTable();
eva_create_evaluation_detail_firstdoc_InitialForm();
SetupValidationRemark("eva_create_evaluation_detail_firstdoc");
});
</script>
}

View File

@@ -0,0 +1,270 @@
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@{
ViewData["Title"] = "eva_create_evaluation_detail_firstdoc";
Layout = "_LayoutDirect";
}
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="report_xModelLabel">พิมพ์แบบข้อตกลงการประเมิน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="eva_evaluation_operating_agreementModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_evaluation_operating_agreementModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eva_evaluation_operating_agreementModelLabel">บันทึกข้อมูล ข้อตกลงการปฏิบัติงาน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_id" />
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_create_evaluation_detail_id" />
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_evaluation_operating_agreement_mission_no" for="eva_evaluation_operating_agreement_mission_no">ภารกิจที่</label>
<input class="form-control" type="number" id="eva_evaluation_operating_agreement_mission_no" iLabel="ภารกิจที่" iRequire="true" iGroup="eva_evaluation_operating_agreement" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_mission_detail" for="eva_evaluation_operating_agreement_mission_detail">รายละเอียดภารกิจ</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_mission_detail" iLabel="รายละเอียดภารกิจ" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_target" for="eva_evaluation_operating_agreement_target">เป้าหมาย</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_target" iLabel="เป้าหมาย" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_indicators" for="eva_evaluation_operating_agreement_indicators">ตัวชี้วัด</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_indicators" iLabel="ตัวชี้วัด" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_operating_agreement_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@Environment.GetEnvironmentVariable("SiteInformation_modulename")
</div>
</div>
<div class="col-md-7">
<ol class="breadcrumb" style="">
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")">หน้าแรก</a></li>
<li class="breadcrumb-item "><a href="@MyHelper.GetConfig(Configuration, "SiteInformation:mainsite")@MyHelper.GetConfig(Configuration, "SiteInformation:appsite")">@Environment.GetEnvironmentVariable("SiteInformation_modulename")</a></li>
<li class="breadcrumb-item active">การประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</li>
</ol>
</div>
</div>
<br />
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>การประเมินผลการปฏิบัติงานของพนักงานเนติบัณฑิตยสภา</div>
<section class="card no-border">
<div class="card-body" style="">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_firstdoc_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_firstdoc_create_evaluation_id" />
<p style="display:none;" class="form-control" id="eva_create_evaluation_detail_firstdoc_chief_fullname" />
<p style="display:none;" class="form-control" id="eva_create_evaluation_detail_firstdoc_chief_position" />
<table width="100%">
<tr>
<td style="font-weight:800;">รอบการประเมิน</td>
<td><span id="eva_create_evaluation_detail_firstdoc_evaluation_round" /></td>
<td style="font-weight:800;">รหัสพนักงาน</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_code" /></td>
</tr>
<tr>
<td style="font-weight:800;">ชื่อ-ชื่อสกุล</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_fullname" /></td>
<td style="font-weight:800;">ประเภทตำแหน่ง</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_position_type" /></td>
</tr>
<tr>
<td style="font-weight:800;">ตำแหน่ง</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_position" /></td>
<td style="font-weight:800;">ระดับตำแหน่ง</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_position_level" /></td>
</tr>
<tr>
<td style="font-weight:800;">หน่วยงาน</td>
<td><span id="eva_create_evaluation_detail_firstdoc_employee_org" /></td>
<td style="font-weight:800;">หมายเหตุ</td>
<td><span id="remark_hrm_work_record" /></td>
</tr>
</table>
</div>
</div>
</div>
</section>
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
</div>
</div>
</section>
<br />
<section class="wrapper">
<div class="title"><div class="line"></div>ข้อตกลงการปฏิบัติงาน</div>
<div class="tools">
<div class="row">
<input class="form-control" type="hidden" id="s_eva_evaluation_operating_agreement_create_evaluation_detail_id" />
<div class="col-md-6">
<button class="btn btn-info" onclick="javascript:eva_evaluation_operating_agreement_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
<button class="btn btn-info" onclick="javascript:rep_eva_p01_DoSearch('pdf');">พิมพ์แบบข้อตกลง</button>
</div>
</div>
</div>
<table id="eva_evaluation_operating_agreementTable" class="display table table-bordered table-striped">
<thead>
<tr>
<!--<th>เลือก</th>-->
<th width="5%">เครื่องมือ</th>
<th width="5%"><label id='h_eva_evaluation_operating_agreement_mission_no'>ภารกิจที่</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_mission_detail'>รายละเอียดภารกิจ</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_target'>เป้าหมาย</label></th>
<th width="30%"><label id='h_eva_evaluation_operating_agreement_indicators'>ตัวชี้วัด</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
<br />
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>ส่งข้อตกลงการประเมิน <span id="status" style="color:red;"></span></div>
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_status_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_status_create_evaluation_id" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_status_status_self" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_status_status_chief" />
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_status_status_supervisor" />
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('next0')">ส่งข้อตกลงการประเมิน</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:alert('บันทึกเรียบร้อย')">บันทึก</button>
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
</div>
</div>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/rep_eva_x/rep_eva_p01_report.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js?version=@MyHelper.GetDummyText()"></script>
<script>
var status_self = "";
$(document).ready(function () {
var id = getUrlParameter("id");
if (id) {
eva_create_evaluation_detail_firstdoc_SetEditForm(id);
eva_create_evaluation_detail_status_SetEditForm(id);
eva_evaluation_operating_agreement_InitiateDataTable();
eva_evaluation_operating_agreement_InitialForm();
} else {
eva_create_evaluation_detail_firstdoc_SetCreateForm();
}
SetupValidationRemark("eva_create_evaluation_detail_firstdoc");
SetupValidationRemark("eva_evaluation_operating_agreement");
setTimeout(CheckPermission, 1000);
});
function CheckPermission() {
if (status_self === "Y") {
$(".status_self").hide();
$("#status").text("คุณส่งแบบประเมินไปแล้ว");
}
}
function OnWeightChanged(c) {
if ($(c).val() < 0) {
$(c).val(0)
}
if ($(c).val() > 100) {
$(c).val(100)
}
}
function CheckWeightBeforeSubmitStatus() {
if (parseInt($("#sum_a").text()) !== 100) {
return false;
} else {
return true;
}
}
</script>
}

View File

@@ -45,6 +45,14 @@
<ul>
<li><a href="~/eva_salary_cylinderView/eva_salary_cylinder"><div style="display: flex;align-items: center;"><span class="menu-dot">&middot;</span>บัญชีเงินเดือนขั้นต่ำขั้นสูงของพนักงานเนติบัณฑิตยสภา</div></a>
</ul>
<ul>
<li>
<a href="~/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc">
<div style="display: flex;align-items: center;">
<span class="menu-dot">&middot;</span> แบบข้อตกลงการปฏิบัติงานเพื่อประกอบการพิจารณาประเมินผลสัมฤทธิ์ของงาน งด.2/2
</div>
</a>
</ul>
<ul>
<li>
<a href="~/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement">

View File

@@ -68,10 +68,14 @@
<None Remove="Files\**" />
<None Remove="Uploads\**" />
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc.cshtml" />
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc_d.cshtml" />
<None Include="Views\eva_evaluation_operating_agreementView\eva_evaluation_operating_agreement.cshtml" />
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration.js" />
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration_d.js" />
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc.js" />
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc_d.js" />
<None Include="wwwroot\js\eva_evaluation_operating_agreement\eva_evaluation_operating_agreement.js" />
<None Include="wwwroot\js\eva_self_review\eva_self_review.js" />
<None Include="wwwroot\js\rep_eva_self_review\rep_eva_self_review_report.js" />

View File

@@ -1142,6 +1142,55 @@
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController},TodoAPI2.Models.Ieva_create_evaluation_detail_firstdocService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
<summary>
Default constructure for dependency injection
</summary>
<param name="repository"></param>
<param name="configuration"></param>
<param name="inemp"></param>
<param name="logger"></param>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController.Get(System.Int32)">
<summary>
Get specific item by id
</summary>
<remarks>
</remarks>
<returns>Return Get specific item by id</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController.GetBlankItem">
<summary>
Get Blank Item
</summary>
<remarks>
</remarks>
<returns>Return a blank item</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController.GetList(System.Nullable{System.Int32})">
<summary>
Get list items by create_evaluation_id
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController.GetListBySearch(TodoAPI2.Models.eva_create_evaluation_detail_firstdocSearchModel)">
<summary>
Get list items by search
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_processController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluation_detail_processController},TodoAPI2.Models.Iexternal_employeeService,TodoAPI2.Models.Ieva_create_evaluation_detail_processService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection
@@ -4294,6 +4343,14 @@
<param name="logger"></param>
<param name="inemp"></param>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluation_detail_firstdocController},TodoAPI2.Models.Ieva_create_evaluation_detail_firstdocService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection
</summary>
<param name="repository"></param>
<param name="configuration"></param>
<param name="logger"></param>
</member>
<member name="M:TodoAPI2.Controllers.eva_create_evaluation_detail_processViewController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluation_detail_processController},TodoAPI2.Models.Iexternal_employeeService,TodoAPI2.Models.Ieva_create_evaluation_detail_processService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection

View File

@@ -5,58 +5,58 @@ var eva_create_evaluation_detail_agreement_API = "/api/eva_create_evaluation_det
function eva_create_evaluation_detail_agreement_GetSearchParameter() {
var eva_create_evaluation_detail_agreementSearchObject = new Object();
eva_create_evaluation_detail_agreementSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementSearchObject.org_id = $("#s_eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val();
eva_create_evaluation_detail_agreementSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementSearchObject.org_id = $("#s_eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val();
return eva_create_evaluation_detail_agreementSearchObject;
}
function eva_create_evaluation_detail_agreement_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
$("#s_eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_agreement_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_agreement_id").val(data.id);
$("#eva_create_evaluation_detail_agreement_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_agreement_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_agreement_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_agreement_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_agreement_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_agreement_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_agreement_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
$("#eva_create_evaluation_detail_agreement_id").val(data.id);
$("#eva_create_evaluation_detail_agreement_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_agreement_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_agreement_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_agreement_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_agreement_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_agreement_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_agreement_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_agreement_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_agreement_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_agreement_search_employee_fullname").val(data.search_employee_fullname);
}
function eva_create_evaluation_detail_agreement_GetFromForm() {
var eva_create_evaluation_detail_agreementObject = new Object();
eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val();
eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text();
eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text();
eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text();
eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text();
eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text();
eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text();
eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text();
eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text();
eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text();
eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val();
eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val();
eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text();
eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text();
eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text();
eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text();
eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text();
eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text();
eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text();
eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text();
eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text();
eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val();
return eva_create_evaluation_detail_agreementObject;
@@ -65,14 +65,14 @@ eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_
function eva_create_evaluation_detail_agreement_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
eva_create_evaluation_detail_agreement_FeedDataToSearchForm(result);
eva_create_evaluation_detail_agreement_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_agreementModel").modal("show");
}
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger);
}
@@ -103,15 +103,15 @@ function eva_create_evaluation_detail_agreement_SetEditForm(a) {
eva_create_evaluation_detail_agreement_editMode = "UPDATE";
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
$("#eva_create_evaluation_detail_agreementModel").modal("show");
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_agreement_SetCreateForm(s) {
eva_create_evaluation_detail_agreement_editMode = "CREATE";
eva_create_evaluation_detail_agreement_InitialForm(s);
eva_create_evaluation_detail_agreement_InitialForm(s);
}
function eva_create_evaluation_detail_agreement_RefreshTable() {
@@ -129,8 +129,7 @@ var eva_create_evaluation_detail_agreement_customValidation = function (group) {
};
function eva_create_evaluation_detail_agreement_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation))
{
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation)) {
return;
}
@@ -142,9 +141,9 @@ function eva_create_evaluation_detail_agreement_PutUpdate() {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
@@ -153,9 +152,9 @@ function eva_create_evaluation_detail_agreement_PutUpdate() {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger);
}
}
@@ -166,9 +165,9 @@ function eva_create_evaluation_detail_agreement_GoDelete(a) {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
endLoad();
};
startLoad();
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger);
}
}
@@ -178,28 +177,28 @@ function eva_create_evaluation_detail_agreement_GoDelete(a) {
var eva_create_evaluation_detail_agreementTableV;
var eva_create_evaluation_detail_agreement_setupTable = function (result) {
console.log(result);
console.log(result);
tmp = '"';
tmp = '"';
eva_create_evaluation_detail_agreementTableV = $('#eva_create_evaluation_detail_agreementTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "id" },
{ "data": "plan_round_year" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "txt_status_self" },
{ "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" },
{ "data": "id" }
{ "data": "plan_round_year" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "txt_status_self" },
{ "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" },
{ "data": "id" }
],
"columnDefs": [
{
@@ -213,28 +212,28 @@ console.log(result);
"targets": -1,
"data": "id",
"render": function (data, type, row, meta) {
if(row.status_chief === "Y"){
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_agreement_GoSelfReview(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
}else{
return "";
}
if (row.status_chief === "Y") {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_agreement_GoSelfReview(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
} else {
return "";
}
}
}
],
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
"searching": false
});
endLoad();
endLoad();
};
function eva_create_evaluation_detail_agreement_InitiateDataTable() {
startLoad();
var p = $.param(eva_create_evaluation_detail_agreement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?"+p, eva_create_evaluation_detail_agreement_setupTable, AlertDanger);
startLoad();
var p = $.param(eva_create_evaluation_detail_agreement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?" + p, eva_create_evaluation_detail_agreement_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_agreement_DoSearch() {
@@ -242,10 +241,10 @@ function eva_create_evaluation_detail_agreement_DoSearch() {
var eva_create_evaluation_detail_agreement_reload = function (result) {
eva_create_evaluation_detail_agreementTableV.destroy();
eva_create_evaluation_detail_agreement_setupTable(result);
endLoad();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?"+p, eva_create_evaluation_detail_agreement_reload, AlertDanger);
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_agreement/GetListBySearch?" + p, eva_create_evaluation_detail_agreement_reload, AlertDanger);
}
function eva_create_evaluation_detail_agreement_GetSelect(f) {

View File

@@ -0,0 +1,251 @@
var eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
var eva_create_evaluation_detail_firstdoc_API = "/api/eva_create_evaluation_detail_firstdoc/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_detail_firstdoc_GetSearchParameter() {
var eva_create_evaluation_detail_firstdocSearchObject = new Object();
eva_create_evaluation_detail_firstdocSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
eva_create_evaluation_detail_firstdocSearchObject.org_id = $("#s_eva_create_evaluation_detail_firstdoc_org_id").val();
eva_create_evaluation_detail_firstdocSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val();
eva_create_evaluation_detail_firstdocSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
return eva_create_evaluation_detail_firstdocSearchObject;
}
function eva_create_evaluation_detail_firstdoc_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_firstdoc_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_firstdoc_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(data.search_employee_fullname);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_firstdoc_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_firstdoc_id").val(data.id);
$("#eva_create_evaluation_detail_firstdoc_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_firstdoc_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_firstdoc_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_firstdoc_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_firstdoc_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_firstdoc_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_firstdoc_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_firstdoc_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_firstdoc_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_firstdoc_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_firstdoc_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val(data.search_employee_fullname);
}
function eva_create_evaluation_detail_firstdoc_GetFromForm() {
var eva_create_evaluation_detail_firstdocObject = new Object();
eva_create_evaluation_detail_firstdocObject.id = $("#eva_create_evaluation_detail_firstdoc_id").val();
eva_create_evaluation_detail_firstdocObject.evaluation_round = $("#eva_create_evaluation_detail_firstdoc_evaluation_round").text();
eva_create_evaluation_detail_firstdocObject.employee_code = $("#eva_create_evaluation_detail_firstdoc_employee_code").text();
eva_create_evaluation_detail_firstdocObject.employee_fullname = $("#eva_create_evaluation_detail_firstdoc_employee_fullname").text();
eva_create_evaluation_detail_firstdocObject.employee_position = $("#eva_create_evaluation_detail_firstdoc_employee_position").text();
eva_create_evaluation_detail_firstdocObject.employee_position_type = $("#eva_create_evaluation_detail_firstdoc_employee_position_type").text();
eva_create_evaluation_detail_firstdocObject.employee_position_level = $("#eva_create_evaluation_detail_firstdoc_employee_position_level").text();
eva_create_evaluation_detail_firstdocObject.employee_org = $("#eva_create_evaluation_detail_firstdoc_employee_org").text();
eva_create_evaluation_detail_firstdocObject.chief_fullname = $("#eva_create_evaluation_detail_firstdoc_chief_fullname").text();
eva_create_evaluation_detail_firstdocObject.chief_position = $("#eva_create_evaluation_detail_firstdoc_chief_position").text();
eva_create_evaluation_detail_firstdocObject.create_evaluation_id = $("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
eva_create_evaluation_detail_firstdocObject.org_id = $("#eva_create_evaluation_detail_firstdoc_org_id").val();
eva_create_evaluation_detail_firstdocObject.search_employee_code = $("#eva_create_evaluation_detail_firstdoc_search_employee_code").val();
eva_create_evaluation_detail_firstdocObject.search_employee_fullname = $("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
return eva_create_evaluation_detail_firstdocObject;
}
function eva_create_evaluation_detail_firstdoc_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
eva_create_evaluation_detail_firstdoc_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_firstdocModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_firstdoc_GoCreate() {
// Incase model popup
eva_create_evaluation_detail_firstdoc_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d");
}
function eva_create_evaluation_detail_firstdoc_GoEdit(a) {
// Incase model popup
//eva_create_evaluation_detail_firstdoc_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + a);
}
function eva_create_evaluation_detail_firstdoc_GoSelfReview(a) {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a);
}
function eva_create_evaluation_detail_firstdoc_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_firstdoc_editMode = "UPDATE";
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
$("#eva_create_evaluation_detail_firstdocModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_firstdoc_SetCreateForm(s) {
eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
eva_create_evaluation_detail_firstdoc_InitialForm(s);
}
function eva_create_evaluation_detail_firstdoc_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_firstdoc_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_firstdoc_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_firstdoc_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_firstdoc_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_firstdoc', eva_create_evaluation_detail_firstdoc_customValidation)) {
return;
}
var data = eva_create_evaluation_detail_firstdoc_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_firstdoc_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_firstdoc_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_firstdoc_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_firstdoc_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_firstdoc_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_firstdoc_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detail_firstdocModel").modal("hide");
AlertSuccess(result.message);
eva_create_evaluation_detail_firstdoc_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detail_firstdocTableV;
var eva_create_evaluation_detail_firstdoc_setupTable = function (result) {
console.log(result);
tmp = '"';
eva_create_evaluation_detail_firstdocTableV = $('#eva_create_evaluation_detail_firstdocTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "plan_round_year" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "txt_status_self" },
{ "data": "txt_status_chief" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_firstdoc_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
}
}
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_detail_firstdoc_InitiateDataTable() {
startLoad();
var p = $.param(eva_create_evaluation_detail_firstdoc_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_firstdoc/GetListBySearch?" + p, eva_create_evaluation_detail_firstdoc_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_firstdoc_DoSearch() {
var p = $.param(eva_create_evaluation_detail_firstdoc_GetSearchParameter());
var eva_create_evaluation_detail_firstdoc_reload = function (result) {
eva_create_evaluation_detail_firstdocTableV.destroy();
eva_create_evaluation_detail_firstdoc_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_firstdoc/GetListBySearch?" + p, eva_create_evaluation_detail_firstdoc_reload, AlertDanger);
}
function eva_create_evaluation_detail_firstdoc_GetSelect(f) {
var eva_create_evaluation_detail_firstdoc_selectitem = [];
$.each(eva_create_evaluation_detail_firstdocTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_firstdoc_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_firstdoc_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,127 @@
var eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
var eva_create_evaluation_detail_firstdoc_API = "/api/eva_create_evaluation_detail_firstdoc/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_firstdoc_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_firstdoc_id").val(data.id);
$("#eva_create_evaluation_detail_firstdoc_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_firstdoc_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_firstdoc_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_firstdoc_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_firstdoc_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_firstdoc_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_firstdoc_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_firstdoc_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_firstdoc_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_firstdoc_score1").text(data.score1);
$("#eva_create_evaluation_detail_firstdoc_score2").text(data.score2);
$("#remark_hrm_work_record").text(data.remark_hrm_work_record);
status_self = data.status_self;
CheckPermission();
console.log(data);
}
function eva_create_evaluation_detail_firstdoc_GetFromForm() {
var eva_create_evaluation_detail_firstdocObject = new Object();
eva_create_evaluation_detail_firstdocObject.id = $("#eva_create_evaluation_detail_firstdoc_id").val();
eva_create_evaluation_detail_firstdocObject.evaluation_round = $("#eva_create_evaluation_detail_firstdoc_evaluation_round").text();
eva_create_evaluation_detail_firstdocObject.employee_code = $("#eva_create_evaluation_detail_firstdoc_employee_code").text();
eva_create_evaluation_detail_firstdocObject.employee_fullname = $("#eva_create_evaluation_detail_firstdoc_employee_fullname").text();
eva_create_evaluation_detail_firstdocObject.employee_position = $("#eva_create_evaluation_detail_firstdoc_employee_position").text();
eva_create_evaluation_detail_firstdocObject.employee_position_type = $("#eva_create_evaluation_detail_firstdoc_employee_position_type").text();
eva_create_evaluation_detail_firstdocObject.employee_position_level = $("#eva_create_evaluation_detail_firstdoc_employee_position_level").text();
eva_create_evaluation_detail_firstdocObject.employee_org = $("#eva_create_evaluation_detail_firstdoc_employee_org").text();
eva_create_evaluation_detail_firstdocObject.chief_fullname = $("#eva_create_evaluation_detail_firstdoc_chief_fullname").text();
eva_create_evaluation_detail_firstdocObject.chief_position = $("#eva_create_evaluation_detail_firstdoc_chief_position").text();
eva_create_evaluation_detail_firstdocObject.create_evaluation_id = $("#eva_create_evaluation_detail_firstdoc_create_evaluation_id").val();
eva_create_evaluation_detail_firstdocObject.org_id = $("#eva_create_evaluation_detail_firstdoc_org_id").val();
eva_create_evaluation_detail_firstdocObject.search_employee_code = $("#eva_create_evaluation_detail_firstdoc_search_employee_code").val();
eva_create_evaluation_detail_firstdocObject.search_employee_fullname = $("#eva_create_evaluation_detail_firstdoc_search_employee_fullname").val();
return eva_create_evaluation_detail_firstdocObject;
}
function eva_create_evaluation_detail_firstdoc_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_firstdoc_SetEditForm(a) {
var successFunc = function (result) {
console.log(result)
eva_create_evaluation_detail_firstdoc_editMode = "UPDATE";
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_firstdoc_SetCreateForm() {
eva_create_evaluation_detail_firstdoc_editMode = "CREATE";
eva_create_evaluation_detail_firstdoc_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_firstdoc_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_firstdoc_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_firstdoc', eva_create_evaluation_detail_firstdoc_customValidation)) {
return;
}
var data = eva_create_evaluation_detail_firstdoc_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_firstdoc_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_firstdoc_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_firstdoc_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_firstdoc_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.message);
eva_create_evaluation_detail_firstdoc_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================