รวม code แก้ OP รอบใหม่
This commit is contained in:
218
ApiControllers/eva_temp_fingerscanControllers.cs
Normal file
218
ApiControllers/eva_temp_fingerscanControllers.cs
Normal file
@@ -0,0 +1,218 @@
|
||||
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;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_temp_fingerscan")]
|
||||
public class eva_temp_fingerscanController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_temp_fingerscanController> _logger;
|
||||
private Ieva_temp_fingerscanService _repository;
|
||||
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="logger"></param>
|
||||
public eva_temp_fingerscanController(ILogger<eva_temp_fingerscanController> logger, Ieva_temp_fingerscanService repository, IConfiguration configuration)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
|
||||
/// <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_temp_fingerscanWithSelectionViewModel), 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 badgenumber
|
||||
/// </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_temp_fingerscanViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string badgenumber)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBybadgenumber(badgenumber));
|
||||
}
|
||||
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_temp_fingerscanViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_temp_fingerscanSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
|
||||
string error_detail = ex.Message + " " + ex.StackTrace;
|
||||
if(ex.InnerException != null)
|
||||
{
|
||||
error_detail += ex.InnerException.Message;
|
||||
}
|
||||
|
||||
return StatusCode(500, error_detail);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// InsertFingerScanToHR
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("InsertFingerScanToHR")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult InsertFingerScanToHR([FromBody] List<string> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
string rowCount = _repository.InsertFingerScanToHR(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "เพิ่มข้อมูลเรียบร้อย จำนวน " + rowCount + " รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"InsertFingerScanToHR.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RecieveFingerScanFromLocal
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPost("RecieveFingerScanFromLocal")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult RecieveFingerScanFromLocal([FromBody] List<fingerscanDataModel> model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
string rowCount = _repository.RecieveFingerScanFromLocal(model);
|
||||
var message = new CommonResponseMessage();
|
||||
message.code = "200";
|
||||
message.message = "เพิ่มข้อมูลเรียบร้อย จำนวน " + rowCount + " รายการ";
|
||||
message.data = null;
|
||||
return Ok(message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"RecieveFingerScanFromLocal.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace TodoAPI2.Models
|
||||
thefile = m_eva_evaluation_achievement_process2.thefile,
|
||||
thefileDisplay = m_eva_evaluation_achievement_process2.thefileDisplay,
|
||||
score = m_eva_evaluation_achievement_process2.score,
|
||||
sumary = m_eva_evaluation_achievement_process2.sumary,
|
||||
score2 = m_eva_evaluation_achievement_process2.score2,
|
||||
sumary2 = m_eva_evaluation_achievement_process2.sumary2,
|
||||
target_score1 = m_eva_evaluation_achievement_process2.target_score1,
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public decimal? score { get; set; }
|
||||
|
||||
public decimal? sumary { get; set; }
|
||||
|
||||
public decimal? score2 { get; set; }
|
||||
|
||||
public decimal? sumary2 { get; set; }
|
||||
|
||||
@@ -207,11 +207,11 @@ namespace TodoAPI2.Models
|
||||
//existingEntity.weight = i.weight;
|
||||
existingEntity.score = i.score;
|
||||
existingEntity.sumary = i.sumary;
|
||||
//existingEntity.target_score1 = i.target_score1;
|
||||
//existingEntity.target_score2 = i.target_score2;
|
||||
//existingEntity.target_score3 = i.target_score3;
|
||||
//existingEntity.target_score4 = i.target_score4;
|
||||
//existingEntity.target_score5 = i.target_score5;
|
||||
existingEntity.target_score1 = i.target_score1;
|
||||
existingEntity.target_score2 = i.target_score2;
|
||||
existingEntity.target_score3 = i.target_score3;
|
||||
existingEntity.target_score4 = i.target_score4;
|
||||
existingEntity.target_score5 = i.target_score5;
|
||||
|
||||
|
||||
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
|
||||
|
||||
22
Models/eva_temp_fingerscan/Ieva_temp_fingerscanService.cs
Normal file
22
Models/eva_temp_fingerscan/Ieva_temp_fingerscanService.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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_temp_fingerscanService
|
||||
{
|
||||
List<eva_temp_fingerscanViewModel> GetListBybadgenumber(string badgenumber);
|
||||
List<eva_temp_fingerscanViewModel> GetListBySearch(eva_temp_fingerscanSearchModel model);
|
||||
eva_temp_fingerscanWithSelectionViewModel GetBlankItem();
|
||||
string InsertFingerScanToHR(List<string> model);
|
||||
string RecieveFingerScanFromLocal(List<fingerscanDataModel> model);
|
||||
}
|
||||
}
|
||||
|
||||
32
Models/eva_temp_fingerscan/eva_temp_fingerscanEntity.cs
Normal file
32
Models/eva_temp_fingerscan/eva_temp_fingerscanEntity.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
using System.IO;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_temp_fingerscanEntity : BaseEntity2<string>
|
||||
{
|
||||
|
||||
|
||||
[MaxLength(255)]
|
||||
public string badgenumber { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string firstname { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string lastname { get; set; }
|
||||
|
||||
public DateTime? checktime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
30
Models/eva_temp_fingerscan/eva_temp_fingerscanInputModel.cs
Normal file
30
Models/eva_temp_fingerscan/eva_temp_fingerscanInputModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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_temp_fingerscanInputModel
|
||||
{
|
||||
|
||||
public Guid? id { get; set; }
|
||||
|
||||
public string badgenumber { get; set; }
|
||||
|
||||
public string firstname { get; set; }
|
||||
|
||||
public string lastname { get; set; }
|
||||
|
||||
public DateTime? checktime { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_temp_fingerscanReportRequestModel : eva_temp_fingerscanSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
29
Models/eva_temp_fingerscan/eva_temp_fingerscanSearchModel.cs
Normal file
29
Models/eva_temp_fingerscan/eva_temp_fingerscanSearchModel.cs
Normal 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_temp_fingerscanSearchModel
|
||||
{
|
||||
|
||||
public Guid id { get; set; }
|
||||
|
||||
public string badgenumber { get; set; }
|
||||
|
||||
public string firstname { get; set; }
|
||||
|
||||
public string lastname { get; set; }
|
||||
|
||||
public DateTime? checktime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
270
Models/eva_temp_fingerscan/eva_temp_fingerscanService.cs
Normal file
270
Models/eva_temp_fingerscan/eva_temp_fingerscanService.cs
Normal file
@@ -0,0 +1,270 @@
|
||||
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;
|
||||
using System.Data.Odbc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_temp_fingerscanService : Ieva_temp_fingerscanService
|
||||
{
|
||||
private IBaseRepository2<eva_temp_fingerscanEntity, string> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
public eva_temp_fingerscanService(IBaseRepository2<eva_temp_fingerscanEntity, string> repository, IMyDatabase mydb,
|
||||
Iexternal_linkageService inext, Iexternal_employeeService inemp, IConfiguration configuration)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public eva_temp_fingerscanWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_temp_fingerscanWithSelectionViewModel();
|
||||
i.checktime = DateTime.Now;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_temp_fingerscanViewModel> GetListBybadgenumber(string badgenumber)
|
||||
{
|
||||
var model = new eva_temp_fingerscanSearchModel();
|
||||
model.badgenumber = badgenumber;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
private string GetDateStringForDB(DateTime d)
|
||||
{
|
||||
string year = d.Year.ToString();
|
||||
string month = d.Month.ToString();
|
||||
if (d.Month < 10)
|
||||
{
|
||||
month = "0" + month;
|
||||
}
|
||||
string day = d.Day.ToString();
|
||||
if (d.Day < 10)
|
||||
{
|
||||
day = "0" + day;
|
||||
}
|
||||
|
||||
return year + "-" + month + "-" + day;
|
||||
}
|
||||
|
||||
private string GetTimeStringForDB(DateTime d)
|
||||
{
|
||||
string hour = d.Hour.ToString();
|
||||
if (d.Hour < 10)
|
||||
{
|
||||
hour = "0" + hour;
|
||||
}
|
||||
string minute = d.Minute.ToString();
|
||||
if (d.Minute < 10)
|
||||
{
|
||||
minute = "0" + minute;
|
||||
}
|
||||
|
||||
return hour + ":" + minute;
|
||||
}
|
||||
|
||||
public List<eva_temp_fingerscanViewModel> GetListBySearch(eva_temp_fingerscanSearchModel model)
|
||||
{
|
||||
//var all_emp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
//if (!model.checktime.HasValue) return null;
|
||||
|
||||
//string connectionString = Configuration.GetConnectionString("fingerScanConnectionString");
|
||||
//List<eva_temp_fingerscanViewModel> data = null;
|
||||
|
||||
//List<userinfo> userinfo_data = new List<userinfo>();
|
||||
//List<checkinout> checkinout_data = new List<checkinout>();
|
||||
|
||||
//using (OdbcConnection odbcConnection = new OdbcConnection(connectionString))
|
||||
//{
|
||||
// odbcConnection.Open();
|
||||
|
||||
// using (var command = odbcConnection.CreateCommand())
|
||||
// {
|
||||
// command.CommandType = System.Data.CommandType.Text;
|
||||
// command.CommandText = "select Badgenumber,userid,name,lastname from USERINFO";
|
||||
// OdbcDataReader reader = command.ExecuteReader();
|
||||
|
||||
// while (reader.Read())
|
||||
// {
|
||||
// userinfo info = new userinfo();
|
||||
// info.badgenumber = Convert.ToString(reader[0]);
|
||||
// info.userid = Convert.ToString(reader["userid"]);
|
||||
// info.name = Convert.ToString(reader["name"]);
|
||||
// info.lastname = Convert.ToString(reader["lastname"]);
|
||||
// userinfo_data.Add(info);
|
||||
// }
|
||||
// }
|
||||
|
||||
// odbcConnection.Close();
|
||||
//}
|
||||
|
||||
//using (OdbcConnection odbcConnection2 = new OdbcConnection(connectionString))
|
||||
//{
|
||||
// odbcConnection2.Open();
|
||||
|
||||
// using (var command2 = odbcConnection2.CreateCommand())
|
||||
// {
|
||||
// command2.CommandType = System.Data.CommandType.Text;
|
||||
// command2.CommandText = "select CHECKTIME,userid from checkinout";
|
||||
// OdbcDataReader reader2 = command2.ExecuteReader();
|
||||
// while (reader2.Read())
|
||||
// {
|
||||
// checkinout inout = new checkinout();
|
||||
// inout.checktime = Convert.ToDateTime(reader2["CHECKTIME"]);
|
||||
// inout.userid = Convert.ToString(reader2["userid"]);
|
||||
// checkinout_data.Add(inout);
|
||||
// }
|
||||
// }
|
||||
// odbcConnection2.Close();
|
||||
//}
|
||||
|
||||
//data = (from i in checkinout_data
|
||||
// join j in userinfo_data on i.userid equals j.userid
|
||||
// join e in all_emp on j.badgenumber equals e.position_number
|
||||
// where GetDateStringForDB(i.checktime) == GetDateStringForDB(model.checktime.Value)
|
||||
// orderby i.checktime descending
|
||||
// select new eva_temp_fingerscanViewModel()
|
||||
// {
|
||||
// badgenumber = j.badgenumber,
|
||||
// checktime = i.checktime,
|
||||
// fullname_in_finger_scan = j.name + " " + j.lastname,
|
||||
// fullname_in_system = e.fullname,
|
||||
// txt_checktime = GetDateStringForDB(i.checktime) + " " + GetTimeStringForDB(i.checktime),
|
||||
// id = e.id.ToString() + "#" + GetDateStringForDB(i.checktime) + "#" + GetTimeStringForDB(i.checktime)
|
||||
// }).ToList();
|
||||
|
||||
//return data;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private string ClearName(string fullname)
|
||||
{
|
||||
return fullname.Replace(" ", "")
|
||||
.Replace("นาย", "")
|
||||
.Replace("นางสาว", "")
|
||||
.Replace("นาง", "")
|
||||
.Replace("น.ส.", "")
|
||||
.Replace("ผศ.ดร.", "");
|
||||
}
|
||||
|
||||
public string RecieveFingerScanFromLocal(List<fingerscanDataModel> model)
|
||||
{
|
||||
var all_emp = emp.GetListByemployee_type(null, null);
|
||||
|
||||
var result = (from i in model
|
||||
join e in all_emp on ClearName(i.fullname) equals ClearName(e.halfname)
|
||||
select e.id.ToString() + "#" + GetDateStringForDB(i.checktime) + "#" + GetTimeStringForDB(i.checktime)).ToList();
|
||||
|
||||
return InsertFingerScanToHR(result);
|
||||
}
|
||||
|
||||
public string InsertFingerScanToHR(List<string> model)
|
||||
{
|
||||
int count_insert = 0;
|
||||
foreach (var i in model)
|
||||
{
|
||||
var data = i.Split('#');
|
||||
string employee_id = data[0];
|
||||
string date = data[1];
|
||||
string time = data[2];
|
||||
|
||||
string sql_checking = $"select employee_id,date,time from tad_time_attendances where employee_id={employee_id} and date='{date}' and time='{time}' ";
|
||||
|
||||
|
||||
DataTable dt = db.ExecuteDataTableNpgsql(sql_checking, null);
|
||||
if (dt.Rows.Count == 0)
|
||||
{
|
||||
string sql_insert = $"insert into tad_time_attendances(employee_id,date,time) values({employee_id},'{date}','{time}')";
|
||||
db.ExecuteNonQueryNpgsql(sql_insert, null);
|
||||
count_insert++;
|
||||
}
|
||||
}
|
||||
|
||||
return count_insert.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class userinfo
|
||||
{
|
||||
public string badgenumber { get; set; }
|
||||
public string userid { get; set; }
|
||||
public string name { get; set; }
|
||||
public string lastname { get; set; }
|
||||
}
|
||||
|
||||
public class checkinout
|
||||
{
|
||||
public DateTime checktime { get; set; }
|
||||
public string userid { get; set; }
|
||||
}
|
||||
|
||||
public class fingerscanDataModel
|
||||
{
|
||||
public string badgenumber { get; set; }
|
||||
|
||||
public DateTime checktime { get; set; }
|
||||
|
||||
public string fullname { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//using (var command = odbcConnection.CreateCommand())
|
||||
// {
|
||||
// command.CommandType = System.Data.CommandType.Text;
|
||||
// string checktime = GetDateStringForDB(model.checktime.Value);
|
||||
// command.CommandText = $@"
|
||||
//SELECT USERINFO.[name], USERINFO.[lastname], USERINFO.Badgenumber, CHECKINOUT.CHECKTIME
|
||||
//FROM CHECKINOUT INNER JOIN USERINFO ON CHECKINOUT.USERID = USERINFO.USERID
|
||||
//where CHECKTIME is not null
|
||||
//and DateValue(CHECKINOUT.CHECKTIME) = #{checktime}#
|
||||
//order by CHECKTIME desc; ";
|
||||
// OdbcDataReader reader = command.ExecuteReader();
|
||||
|
||||
// while (reader.Read())
|
||||
// {
|
||||
// var n = new eva_temp_fingerscanViewModel();
|
||||
// //n.id = Convert.ToDateTime(reader["CHECKTIME"]);
|
||||
// if(reader["checktime"] != DBNull.Value)
|
||||
// {
|
||||
// n.badgenumber = Convert.ToString(reader["Badgenumber"]);
|
||||
// n.checktime = Convert.ToDateTime(reader["CHECKTIME"]);
|
||||
// n.txt_checktime = GetDateStringForDB(n.checktime.Value) + " " + GetTimeStringForDB(n.checktime.Value);
|
||||
// n.fullname_in_finger_scan = Convert.ToString(reader["name"]) + " " + Convert.ToString(reader["lastname"]);
|
||||
|
||||
// var x = (from i in all_emp
|
||||
// where i.position_number == n.badgenumber
|
||||
// select i).FirstOrDefault();
|
||||
// if (x != null)
|
||||
// {
|
||||
// n.id = x.id.ToString()+"#"+ GetDateStringForDB(n.checktime.Value)+"#"+ GetTimeStringForDB(n.checktime.Value);
|
||||
// n.fullname_in_system = x.fullname;
|
||||
// };
|
||||
// data.Add(n);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
42
Models/eva_temp_fingerscan/eva_temp_fingerscanViewModel.cs
Normal file
42
Models/eva_temp_fingerscan/eva_temp_fingerscanViewModel.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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_temp_fingerscanViewModel : BaseViewModel2<string>
|
||||
{
|
||||
|
||||
public string badgenumber { get; set; }
|
||||
|
||||
public DateTime? checktime { get; set; }
|
||||
|
||||
public string txt_checktime { get; set; }
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (this.checktime.HasValue)
|
||||
// {
|
||||
// return MyHelper.GetDateStringForReport(this.checktime) + " " + this.checktime.Value.ToShortTimeString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
public string fullname_in_system { get; set; }
|
||||
|
||||
public string fullname_in_finger_scan { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_temp_fingerscanWithSelectionViewModel: eva_temp_fingerscanViewModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,7 @@ where ha.employee_id = @emp_id and ha.workingstatus = 'สถานะปฏิ
|
||||
var sql = string.Format(@"
|
||||
select he.employee_id as id, mpn.position_number,he.employee_no,he.position_no,
|
||||
CONCAT(htm.title_name,' ',he.firstname,' ',he.lastname) as fullname,opd.position_name,
|
||||
CONCAT(he.firstname,he.lastname) as halfname,
|
||||
orgdata.id as department_id,orgdata.department_name,orgdata.department_code,he.salary,
|
||||
he.employee_type_id, het.employee_type_name,opd.position_id as position_id,
|
||||
u.email as user_email, u.id as user_id,hpl.position_level_name,he.position_level_id,
|
||||
@@ -95,6 +96,7 @@ order by he.firstname,he.lastname;
|
||||
i.position_number = dr["position_number"].ToString();
|
||||
i.position_name = dr["position_name"].ToString();
|
||||
i.fullname= dr["fullname"].ToString();
|
||||
i.halfname = dr["halfname"].ToString();
|
||||
if (dr["employee_type_id"] != DBNull.Value)
|
||||
{
|
||||
i.employee_type_id = Convert.ToInt32(dr["employee_type_id"]);
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string fullname { get; set; }
|
||||
|
||||
public string halfname { get; set; }
|
||||
|
||||
public int? employee_type_id { get; set; }
|
||||
|
||||
public int? position_id { get; set; }
|
||||
|
||||
@@ -289,6 +289,9 @@ namespace Test01
|
||||
services.AddScoped<IBaseRepository2<eva_idp_planEntity, int>, BaseRepository2<eva_idp_planEntity, int>>();
|
||||
services.AddScoped<Ieva_idp_planService, eva_idp_planService>();
|
||||
|
||||
services.AddScoped<IBaseRepository2<eva_temp_fingerscanEntity, string>, BaseRepository2<eva_temp_fingerscanEntity, string>>();
|
||||
services.AddScoped<Ieva_temp_fingerscanService, eva_temp_fingerscanService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
|
||||
@@ -48,17 +48,17 @@
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_fullname" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position" for="eva_create_evaluation_detail_process_employee_position">ตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position_type" for="eva_create_evaluation_detail_process_employee_position_type">ประเภทตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position_type" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position" for="eva_create_evaluation_detail_process_employee_position">ตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position_level" for="eva_create_evaluation_detail_process_employee_position_level">ระดับตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position_level" />
|
||||
@@ -99,7 +99,23 @@
|
||||
<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-3">
|
||||
ข้อมูลการลา ณ วันที่
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
ถึง
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline" onclick="javascript:alert('กำลังจัดทำ')" style="background-color: #fff;">ค้นหา</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="display table table-bordered table-striped">
|
||||
|
||||
@@ -99,16 +99,17 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position" for="eva_create_evaluation_detail_process_employee_position">ตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position" />
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position_type" for="eva_create_evaluation_detail_process_employee_position_type">ประเภทตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position_type" />
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position_type" for="eva_create_evaluation_detail_process_employee_position_type">ประเภทตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position_type" />
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position" for="eva_create_evaluation_detail_process_employee_position">ตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_create_evaluation_detail_process_employee_position_level" for="eva_create_evaluation_detail_process_employee_position_level">ระดับตำแหน่ง</label>
|
||||
<p class="form-control" id="eva_create_evaluation_detail_process_employee_position_level" />
|
||||
@@ -149,9 +150,27 @@
|
||||
<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-3">
|
||||
ข้อมูลการลา ณ วันที่
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
ถึง
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline" onclick="javascript:alert('กำลังจัดทำ')" style="background-color: #fff;">ค้นหา</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<table class="display table table-bordered table-striped">
|
||||
<tr>
|
||||
<td colspan="2">ลาป่วย</td>
|
||||
@@ -213,6 +232,7 @@
|
||||
<th><label>5</label></th>
|
||||
|
||||
<th width="10%"><label>คะแนน</label></th>
|
||||
<th width="10%"><label>รวมคะแนน</label></th>
|
||||
<th width="10%"><label>คะแนน</label></th>
|
||||
<th width="10%"><label>รวมคะแนน</label></th>
|
||||
|
||||
@@ -232,6 +252,7 @@
|
||||
<th><label id='h_eva_evaluation_achievement_process2_target_score5'></label></th>
|
||||
|
||||
<th width="10%"><label id='h_eva_evaluation_achievement_process2_score'></label></th>
|
||||
<th width="10%"><label id='x1'></label></th>
|
||||
<th width="15%"><label id='h_eva_evaluation_achievement_process2_score2'></label></th>
|
||||
<th width="10%"><p id="eva_create_evaluation_detail_summary2_total_summary_supervisor" /></th>
|
||||
|
||||
@@ -437,7 +458,7 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_create_evaluation_detail_review02_supervisor2_result" for="eva_create_evaluation_detail_review02_supervisor2_result">ผลการประเมิน</label>
|
||||
<select class="form-control" id="eva_create_evaluation_detail_review02_supervisor2_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review02"></select>
|
||||
<select onchange="Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(this)" class="form-control" id="eva_create_evaluation_detail_review02_supervisor2_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review02"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@@ -448,7 +469,7 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_create_evaluation_detail_review02_supervisor2_remark" for="eva_create_evaluation_detail_review02_supervisor2_remark">ความเห็นผู้ประเมินสูงสุด</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review02_supervisor2_remark" iLabel="ความเห็นผู้ประเมินสูงสุด" iRequire="true" iGroup="eva_create_evaluation_detail_review02"></textarea>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review02_supervisor2_remark" iLabel="ความเห็นผู้ประเมินสูงสุด" iRequire="false" iGroup="eva_create_evaluation_detail_review02"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -492,11 +513,10 @@
|
||||
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_review03_create_evaluation_id" />
|
||||
<input class="form-control" type="hidden" id="eva_create_evaluation_detail_review03_id" />
|
||||
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_create_evaluation_detail_review03_supervisor1A_result" for="eva_create_evaluation_detail_review03_supervisor1A_result">ผลการประเมิน</label>
|
||||
<select class="form-control" id="eva_create_evaluation_detail_review03_supervisor1A_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review03"></select>
|
||||
<select onchange="Oneva_create_evaluation_detail_review03_supervisor1A_resultChanged(this)" class="form-control" id="eva_create_evaluation_detail_review03_supervisor1A_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review03"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@@ -507,7 +527,7 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_create_evaluation_detail_review03_supervisor1A_remark" for="eva_create_evaluation_detail_review03_supervisor1A_remark">ความเห็นผู้ประเมิน</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review03_supervisor1A_remark" iLabel="ความเห็นผู้ประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review03"></textarea>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review03_supervisor1A_remark" iLabel="ความเห็นผู้ประเมิน" iRequire="false" iGroup="eva_create_evaluation_detail_review03"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -544,7 +564,7 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-6">
|
||||
<label id="lab_eva_create_evaluation_detail_review04_supervisor2A_result" for="eva_create_evaluation_detail_review04_supervisor2A_result">ผลการประเมิน</label>
|
||||
<select class="form-control" id="eva_create_evaluation_detail_review04_supervisor2A_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review04"></select>
|
||||
<select onchange="Oneva_create_evaluation_detail_review04_supervisor2A_resultChanged(this)" class="form-control" id="eva_create_evaluation_detail_review04_supervisor2A_result" iLabel="ผลการประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review04"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@@ -555,7 +575,7 @@
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_create_evaluation_detail_review04_supervisor2A_remark" for="eva_create_evaluation_detail_review04_supervisor2A_remark">ความเห็นผู้ประเมินสูงสุด</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review04_supervisor2A_remark" iLabel="ความเห็นผู้ประเมินสูงสุด" iRequire="true" iGroup="eva_create_evaluation_detail_review04"></textarea>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review04_supervisor2A_remark" iLabel="ความเห็นผู้ประเมินสูงสุด" iRequire="false" iGroup="eva_create_evaluation_detail_review04"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -619,6 +639,37 @@
|
||||
SetupValidationRemark("eva_create_evaluation_detail_review04");
|
||||
SetupValidationRemark("eva_idp_plan");
|
||||
});
|
||||
|
||||
function Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(a){
|
||||
console.log($(a).val());
|
||||
if($(a).val() == "Y"){
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","false");
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").css('border-color', '');
|
||||
}else{
|
||||
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","true");
|
||||
}
|
||||
}
|
||||
|
||||
function Oneva_create_evaluation_detail_review03_supervisor1A_resultChanged(a){
|
||||
console.log($(a).val());
|
||||
if($(a).val() == "Y"){
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","false");
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").css('border-color', '');
|
||||
}else{
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","true");
|
||||
}
|
||||
}
|
||||
|
||||
function Oneva_create_evaluation_detail_review04_supervisor2A_resultChanged(a){
|
||||
console.log($(a).val());
|
||||
if($(a).val() == "Y"){
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","false");
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").css('border-color', '');
|
||||
}else{
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","true");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>รายงานบัญชีรายละเอียดขั้นเงินเดือนและเงินเพิ่มการครองชีพชั่วคราวของพนักงาน</div>
|
||||
<div class="title"><div class="line"></div>รายงานบัญชีรายละเอียดขั้นเงินเดือนและเงินเพิ่มการครองชีพชั่วคราวของพนักงาน เนติบัณฑิตยสภา</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>รายงานประวัติการเลื่อนขั้นเงินเดือนของพนักงาน</div>
|
||||
<div class="title"><div class="line"></div>รายงานประวัติการเลื่อนขั้นเงินเดือนของพนักงาน เนติบัณฑิตยสภา</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>รายงานโครงสร้างของขั้นเงินเดือน</div>
|
||||
<div class="title"><div class="line"></div>รายงานโครงสร้างของขั้นเงินเดือน เนติบัณฑิตยสภา</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
62
tb320eva.xml
62
tb320eva.xml
@@ -3372,6 +3372,68 @@
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_temp_fingerscanController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_temp_fingerscanController},TodoAPI2.Models.Ieva_temp_fingerscanService,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_temp_fingerscanController.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_temp_fingerscanController.GetList(System.String)">
|
||||
<summary>
|
||||
Get list items by badgenumber
|
||||
</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_temp_fingerscanController.GetListBySearch(TodoAPI2.Models.eva_temp_fingerscanSearchModel)">
|
||||
<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_temp_fingerscanController.InsertFingerScanToHR(System.Collections.Generic.List{System.String})">
|
||||
<summary>
|
||||
InsertFingerScanToHR
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_temp_fingerscanController.RecieveFingerScanFromLocal(System.Collections.Generic.List{TodoAPI2.Models.fingerscanDataModel})">
|
||||
<summary>
|
||||
RecieveFingerScanFromLocal
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.external_employeeController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.external_employeeController},TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
@@ -7,7 +7,7 @@ function eva_create_evaluation_detail_review03_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_review03_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_review03_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A").val(data.supervisor1A);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review03_supervisor1A_result"), data, "id", "external_name", "item_supervisor1A_result", data.supervisor1A_result);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review03_supervisor1A_result"), data, "external_code", "external_name", "item_supervisor1A_result", data.supervisor1A_result);
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").val(data.supervisor1A_remark);
|
||||
$("#eva_create_evaluation_detail_review03_supervisor1A_date").val(formatDate(data.supervisor1A_date));
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ function eva_create_evaluation_detail_review04_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_review04_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_review04_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A").val(data.supervisor2A);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review04_supervisor2A_result"), data, "id", "external_name", "item_supervisor2A_result", data.supervisor2A_result);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review04_supervisor2A_result"), data, "external_code", "external_name", "item_supervisor2A_result", data.supervisor2A_result);
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").val(data.supervisor2A_remark);
|
||||
$("#eva_create_evaluation_detail_review04_supervisor2A_date").val(formatDate(data.supervisor2A_date));
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ console.log(w1);
|
||||
|
||||
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text((total_achievement * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text((total_achievement * 20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text((total_achievement_score * w1/10).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(((total_achievement * 20) * w1/100).toFixed(2));
|
||||
|
||||
calculationAllItem();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ $("#eva_evaluation_achievement_process2_achievement_" + i).text(data.achievement
|
||||
$("#eva_evaluation_achievement_process2_weight_" + i).text(data.weight);
|
||||
|
||||
$("#eva_evaluation_achievement_process2_score_" + i).text(data.score);
|
||||
$("#eva_evaluation_achievement_process2_sumary_" + i).text(data.sumary);
|
||||
$("#eva_evaluation_achievement_process2_score2_" + i).val(data.score2);
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(data.sumary2);
|
||||
$("#eva_evaluation_achievement_process2_target_score1_" + i).text(data.target_score1);
|
||||
@@ -77,7 +78,7 @@ function eva_evaluation_achievement_process2_Get(a, blankItem) {
|
||||
$('#eva_evaluation_achievement_process2Body').empty();
|
||||
|
||||
var successFunc = function (response) {
|
||||
//console.log(response);
|
||||
console.log(response);
|
||||
$.each(response, function (i, data) {
|
||||
var tag = '<tr>';
|
||||
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_achievement_process2" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process2_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process2_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
|
||||
@@ -89,6 +90,7 @@ function eva_evaluation_achievement_process2_Get(a, blankItem) {
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_target_score4_' + (i + 1)+'">ร้อยละ<br/> 81-90</p></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_target_score5_' + (i + 1)+'">ร้อยละ<br/> 91-100</p></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_sumary_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><input class="form-control" type="number" min="0" max="5" step=".01" onchange="javascript:Oneva_evaluation_achievement_process2_scoreChange();" id="eva_evaluation_achievement_process2_score2_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_achievement_process2_sumary2_' + (i + 1)+'" /></td>';
|
||||
tag += '</tr>';
|
||||
@@ -121,6 +123,7 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
var total_achievement_weight = 0;
|
||||
var total_achievement_score = 0;
|
||||
var total_achievement_score_old = 0;
|
||||
var total_achievement_old = 0;
|
||||
$('#eva_evaluation_achievement_process2Body tr').each(function () {
|
||||
var i = $(this).find("#rowCount").text();
|
||||
var score_old = $("#eva_evaluation_achievement_process2_score_" + i).text();
|
||||
@@ -128,10 +131,13 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
var weight = $("#eva_evaluation_achievement_process2_weight_" + i).text();
|
||||
var total = (score * weight / 100).toFixed(2);
|
||||
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(total);
|
||||
var total_old = (score_old * weight / 100).toFixed(2);
|
||||
$("#eva_evaluation_achievement_process2_sumary_" + i).text(total_old);
|
||||
total_achievement += parseFloat(total);
|
||||
total_achievement_weight += parseFloat(weight);
|
||||
total_achievement_score += parseFloat(score);
|
||||
total_achievement_score_old += parseFloat(score_old);
|
||||
total_achievement_old += parseFloat(total_old);
|
||||
//console.log(score_old);
|
||||
});
|
||||
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(2));
|
||||
@@ -140,6 +146,7 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
|
||||
|
||||
var w1 = parseFloat($("#w1").text());
|
||||
|
||||
$("#x1").text((total_achievement_old*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text((total_achievement*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text((total_achievement*20).toFixed(2));
|
||||
$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(((total_achievement*20)*w1/100).toFixed(2));
|
||||
|
||||
@@ -6,11 +6,11 @@ $("#eva_evaluation_behavior_process_behavior_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score1_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score2_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score3_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score4_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score5_" + i).text("");
|
||||
$("#eva_evaluation_behavior_process_target_score1_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_target_score2_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_target_score3_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_target_score4_" + i).val("");
|
||||
$("#eva_evaluation_behavior_process_target_score5_" + i).val("");
|
||||
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ $("#eva_evaluation_behavior_process_behavior_" + i).text(data.behavior);
|
||||
$("#eva_evaluation_behavior_process_weight_" + i).text(data.weight);
|
||||
$("#eva_evaluation_behavior_process_score_" + i).val(data.score);
|
||||
$("#eva_evaluation_behavior_process_sumary_" + i).text(data.sumary);
|
||||
$("#eva_evaluation_behavior_process_target_score1_" + i).text(data.target_score1);
|
||||
$("#eva_evaluation_behavior_process_target_score2_" + i).text(data.target_score2);
|
||||
$("#eva_evaluation_behavior_process_target_score3_" + i).text(data.target_score3);
|
||||
$("#eva_evaluation_behavior_process_target_score4_" + i).text(data.target_score4);
|
||||
$("#eva_evaluation_behavior_process_target_score5_" + i).text(data.target_score5);
|
||||
$("#eva_evaluation_behavior_process_target_score1_" + i).val(data.target_score1);
|
||||
$("#eva_evaluation_behavior_process_target_score2_" + i).val(data.target_score2);
|
||||
$("#eva_evaluation_behavior_process_target_score3_" + i).val(data.target_score3);
|
||||
$("#eva_evaluation_behavior_process_target_score4_" + i).val(data.target_score4);
|
||||
$("#eva_evaluation_behavior_process_target_score5_" + i).val(data.target_score5);
|
||||
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@ eva_evaluation_behavior_processObject.behavior = obj.find("#eva_evaluation_behav
|
||||
eva_evaluation_behavior_processObject.weight = obj.find("#eva_evaluation_behavior_process_weight_" + i).text();
|
||||
eva_evaluation_behavior_processObject.score = obj.find("#eva_evaluation_behavior_process_score_" + i).val();
|
||||
eva_evaluation_behavior_processObject.sumary = obj.find("#eva_evaluation_behavior_process_sumary_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score1 = obj.find("#eva_evaluation_behavior_process_target_score1_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score2 = obj.find("#eva_evaluation_behavior_process_target_score2_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score3 = obj.find("#eva_evaluation_behavior_process_target_score3_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score4 = obj.find("#eva_evaluation_behavior_process_target_score4_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score5 = obj.find("#eva_evaluation_behavior_process_target_score5_" + i).text();
|
||||
eva_evaluation_behavior_processObject.target_score1 = obj.find("#eva_evaluation_behavior_process_target_score1_" + i).val();
|
||||
eva_evaluation_behavior_processObject.target_score2 = obj.find("#eva_evaluation_behavior_process_target_score2_" + i).val();
|
||||
eva_evaluation_behavior_processObject.target_score3 = obj.find("#eva_evaluation_behavior_process_target_score3_" + i).val();
|
||||
eva_evaluation_behavior_processObject.target_score4 = obj.find("#eva_evaluation_behavior_process_target_score4_" + i).val();
|
||||
eva_evaluation_behavior_processObject.target_score5 = obj.find("#eva_evaluation_behavior_process_target_score5_" + i).val();
|
||||
|
||||
eva_evaluation_behavior_processObject.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior_process").val();
|
||||
return eva_evaluation_behavior_processObject;
|
||||
@@ -76,11 +76,11 @@ function eva_evaluation_behavior_process_Get(a, blankItem) {
|
||||
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_behavior_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_weight_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_target_score1_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_target_score2_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_target_score3_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_target_score4_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_target_score5_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score1_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score2_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score3_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score4_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input class="form-control" type="text" id="eva_evaluation_behavior_process_target_score5_' + (i + 1)+'"></p></td>';
|
||||
tag += '<td><input min="0" max="5" step=".01" onchange="Oneva_evaluation_behavior_process_scoreChange()" class="form-control" type="number" id="eva_evaluation_behavior_process_score_' + (i + 1)+'" /></td>';
|
||||
tag += '<td><p id="eva_evaluation_behavior_process_sumary_' + (i + 1)+'" /></td>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user