First Initial

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-20 15:02:39 +07:00
commit 8b98125e49
3048 changed files with 760804 additions and 0 deletions

516
wwwroot/js/coregen.js Normal file
View File

@@ -0,0 +1,516 @@

function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') {
c = c.substring(1);
}
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function AjaxGetRequest(path, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: GetUnix(path),
type: 'GET',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: GetUnix(path),
type: 'GET',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: successFunc,
error: failFunc
});
}
}
function AjaxGetRequestWithData(path, jData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: GetUnix(path),
type: 'GET',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: GetUnix(path),
type: 'GET',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
}
}
function AjaxPostRequest(path, jData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: path,
type: 'POST',
//headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: path,
type: 'POST',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
}
}
function AjaxPutRequest(path, jData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: path,
type: 'PUT',
//headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: path,
type: 'PUT',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
}
}
function AjaxPutRequestFile(path, jData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: path,
type: 'PUT',
//headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'binary',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: path,
type: 'PUT',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'binary',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
}
}
function AjaxDeleteRequest(path, jData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: path,
type: 'DELETE',
//headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: path,
type: 'DELETE',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
contentType: 'application/json',
dataType: 'json',
data: JSON.stringify(jData),
success: successFunc,
error: failFunc
});
}
}
function AjaxUploadRequest(path, formData, successFunc, failFunc) {
if (getCookie("access_token") === null || getCookie("access_token") === "") {
$.ajax({
url: path,
type: 'POST',
processData: false, // important
contentType: false, // important
dataType: 'json',
data: formData,
success: successFunc,
error: failFunc
});
} else {
$.ajax({
url: path,
type: 'POST',
headers: { 'Authorization': "Bearer " + Cookies.get('access_token') },
processData: false, // important
contentType: false, // important
dataType: 'json',
data: formData,
success: successFunc,
error: failFunc
});
}
}
function DropDownClearFormAndFeedWithData(d, result, x, y, z, i) {
$(d).html('');
$(d).append($("<option></option>")
.attr("value", "")
.text("กรุณาเลือก"));
if (z !== "") {
$.each(result[z], function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
} else {
$.each(result, function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
}
$(d).val(i);
}
function DropDownInitialFormWithData(d, result, x, y, z) {
$(d).html('');
$(d).append($("<option></option>")
.attr("value", "")
.text("กรุณาเลือก"));
if (z !== "") {
$.each(result[z], function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
} else {
$.each(result, function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
}
}
////////////////////////// Alert Functions //////////////////////////////////
function AlertSuccess(msg) {
alert(msg);
}
function AlertDanger(xhr, status, error) {
var errorMessage = xhr.status + ': ' + xhr.statusText +': '+xhr.responseText;
endLoad();
alert('มีข้อผิดพลาดเกิดขึ้น ดังนี้ : ' + errorMessage);
}
function GetUnix(path) {
if (path !== "") {
if (path.indexOf("?") > -1)
path += "&";
else
path += "?";
path += "_=" + moment().unix();
}
return path;
}
function startLoad() {
$.LoadingOverlay("show");
}
function endLoad() {
$.LoadingOverlay("hide");
}
////////////////////////// Service Frame //////////////////////////////////
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
function window_open_from_root(frameSrc) {
if (inIframe()) {
window.parent.window_open_from_root(frameSrc);
} else {
window.location = frameSrc;
}
}
function window_open(frameSrc) {
$(this).parents('body').addClass('overflow-fix');
$('#myframe').addClass('iframe-visible');
$('#myframe').attr('src', frameSrc);
//return false;
}
function window_close() {
$(window.frameElement).removeClass('iframe-visible');
$(window.frameElement).parents('body').removeClass('overflow-fix');
$(window.frameElement).attr('src', '');
endLoad();
//return false;
}
function refresh_frame() {
//&#xf021;
console.log("refresh_btn");
var ref = $('#refresh_icon');
//if (window.parent == window.top) {
ref.addClass("fa fa-refresh fa-spin");
ref.html("");
window.location.reload(true);
//}
}
////////////////////////// Control Service //////////////////////////////////
function CheckBoxGetFromForm(d) {
if ($(d).is(':checked')) {
return true;
} else {
return false;
}
}
function CheckBoxFeedDataToForm(d, v) {
if (v === true) {
$(d).prop('checked', true);
} else {
$(d).prop('checked', false);
}
}
function formatDate(date) {
let value = '';
if (date === null) {
value = '';
} else {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + (d.getDate()),
year = ''+(d.getFullYear()+543);
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
value = [day, month, year].join('/');
}
return value;
}
function getDate(dateText) {
//console.log(dateText);
if (dateText !== "") {
var parts = dateText.split('/');
var day = parseInt(parts[0]); // + 1;
var month = parseInt(parts[1]) - 1;
var year = parseInt(parts[2]) - 543;
//console.log(parts);
//console.log(year);
//console.log(month);
//console.log(day);
//var d = new Date(year, month, day);
var d = new Date(Date.UTC(year, month, day));
return d;
} else {
return null;
}
}
function formatDateForGetParameter(date) {
let value = '';
if (date === null) {
value = '';
} else {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
//day = '' + (d.getDate() - 1),
day = '' + (d.getDate()),
year = '' + (d.getFullYear());
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
value = [year, month, day].join('-');
}
return value;
}
// ================= File Upload ========================
function UploadImage(file, code) {
var file_data = file.prop("files")[0];
var myFormData = new FormData();
myFormData.append('files', file_data);
var successFunc = function (response) {
$("#" + code + "_linkurl").text("ดูหรือดาวโหลดไฟล์ของคุณ");
$("#" + code + "_linkurl").attr('href', apisite + "/" + response.filesUploaded[0]);
$("#" + code + "_linkurl").attr('target', '_blank');
$("#" + code + "_remove").show();
$("#" + code + "_hidURL").val(response.filesUploaded[0]);
endLoad();
};
startLoad();
AjaxUploadRequest(apisite + "/api/Attachment/UploadMultipleFiles", myFormData, successFunc, AlertDanger);
}
function feedFileToControl(thefile, thefileDisplay, code, mode) {
if (!thefile) {
$("#" + code + "_linkurl").text("ยังไม่มีการแนบไฟล์");
$("#" + code + "_linkurl").attr('href', '#');
$("#" + code + "_linkurl").attr('target', '');
$("#" + code + "_remove").hide();
$("#" + code + "_hidURL").val("");
$("#" + code + "_file").val("");
} else {
$("#" + code + "_linkurl").text("ดูหรือดาวโหลดไฟล์ของคุณ");
if (mode === "file") {
$("#" + code + "_linkurl").attr('href', appsite + "/" + thefileDisplay);
} else if(mode === "db") {
$("#" + code + "_linkurl").attr('href', thefileDisplay);
}
$("#" + code + "_linkurl").attr('target', '_blank');
$("#" + code + "_remove").show();
$("#" + code + "_hidURL").val(thefile);
$("#" + code + "_file").val("");
}
}
function removeFile(code) {
if (confirm('คุณต้องการลบไฟล์ ใช่หรือไม่?')) {
$("#" + code + "_linkurl").text("ยังไม่มีการแนบไฟล์");
$("#" + code + "_linkurl").attr('href', '#');
$("#" + code + "_linkurl").attr('target', '');
$("#" + code + "_remove").hide();
$("#" + code + "_hidURL").val("");
$("#" + code + "_file").val("");
}
}
function setupUploadEvent() {
}
function hasExtension(inputID, exts) {
var fileName = document.getElementById(inputID).value;
return (new RegExp('(' + exts.join('|').replace(/\./g, '\\.') + ')$')).test(fileName);
}
// ================= Validation ========================
function SetupValidationRemark(group) {
$("[iGroup='" + group + "'][iRequire='true']").each(function (index) {
var k = "lab_" + $(this).attr("id");
$("<font color='red'> *</font>").insertAfter("#" + k);
});
// in case of file upload
$("input[iGroup='" + group + "'][iRequire='true'][type='hidden']").each(function (index) {
var k = "lab_" + $(this).attr("id");
$("<font color='red'> *</font>").insertAfter("#" + k.replace('_hidURL', ''));
});
}
function ValidateForm(group, customValidate) {
//console.log("ValidateForm "+group);
var result = "";
var obj = null;
$("input[iRequire='true'][iGroup='" + group + "']").each(function (index) {
if ($(this).val() === "" || $(this).val() === null) {
result += "- กรุณาระบุ " + $(this).attr("iLabel") + "\n";
$(this).css('border-color', 'red');
if (obj === null) obj = $(this);
} else {
$(this).css('border-color', '');
}
});
$("textarea[iRequire='true'][iGroup='" + group + "']").each(function (index) {
if ($(this).val() === "" || $(this).val() === null) {
result += "- กรุณาระบุ " + $(this).attr("iLabel") + "\n";
$(this).css('border-color', 'red');
if (obj === null) obj = $(this);
} else {
$(this).css('border-color', '');
}
});
$("select[iRequire='true'][iGroup='" + group + "']").each(function (index) {
if ($(this).val() === "" || $(this).val() === null) {
result += "- กรุณาระบุ " + $(this).attr("iLabel") + "\n";
$(this).css('border-color', 'red');
if (obj === null) obj = $(this);
} else {
$(this).css('border-color', '');
}
});
result += customValidate(group);
if (result !== "") {
obj.focus();
alert(result);
return false;
} else {
return true;
}
}

View File

@@ -0,0 +1,250 @@
var eva_adjust_postponement_detail_normal_editMode = "CREATE";
var eva_adjust_postponement_detail_normal_API = "/api/eva_adjust_postponement_detail_normal/";
//================= Search Customizaiton =========================================
function eva_adjust_postponement_detail_normal_GetSearchParameter() {
var eva_adjust_postponement_detail_normalSearchObject = new Object();
eva_adjust_postponement_detail_normalSearchObject.adjust_postponement_id = getUrlParameter("id");
return eva_adjust_postponement_detail_normalSearchObject;
}
function eva_adjust_postponement_detail_normal_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_detail_normal_adjust_postponement_id").val(data.adjust_postponement_id);
}
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_detail_normal_FeedDataToForm(data) {
$("#eva_adjust_postponement_detail_normal_id").val(data.id);
$("#eva_adjust_postponement_detail_normal_adjust_postponement_id").val(data.adjust_postponement_id);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_detail_normal_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
$("#eva_adjust_postponement_detail_normal_sarary").val(data.sarary);
$("#eva_adjust_postponement_detail_normal_cost_living").val(data.cost_living);
$("#eva_adjust_postponement_detail_normal_middle").val(data.middle);
$("#eva_adjust_postponement_detail_normal_promoted_percentage").val(data.promoted_percentage);
$("#eva_adjust_postponement_detail_normal_total_promote").val(data.total_promote);
$("#eva_adjust_postponement_detail_normal_new_sarary").val(data.new_sarary);
$("#eva_adjust_postponement_detail_normal_new_cost_living").val(data.new_cost_living);
$("#eva_adjust_postponement_detail_normal_remark").val(data.remark);
$("#eva_adjust_postponement_detail_normal_emp_code").val(data.emp_code);
$("#eva_adjust_postponement_detail_normal_emp_fullname").val(data.emp_fullname);
$("#eva_adjust_postponement_detail_normal_emp_position").val(data.emp_position);
$("#eva_adjust_postponement_detail_normal_emp_level").val(data.emp_level);
$("#eva_adjust_postponement_detail_normal_total_score").val(data.total_score);
$("#eva_adjust_postponement_detail_normal_eva_result").val(data.eva_result);
}
function eva_adjust_postponement_detail_normal_GetFromForm() {
var eva_adjust_postponement_detail_normalObject = new Object();
eva_adjust_postponement_detail_normalObject.id = $("#eva_adjust_postponement_detail_normal_id").val();
eva_adjust_postponement_detail_normalObject.adjust_postponement_id = $("#eva_adjust_postponement_detail_normal_adjust_postponement_id").val();
eva_adjust_postponement_detail_normalObject.employee_id = $("#eva_adjust_postponement_detail_normal_employee_id").val();
eva_adjust_postponement_detail_normalObject.sarary = $("#eva_adjust_postponement_detail_normal_sarary").val();
eva_adjust_postponement_detail_normalObject.cost_living = $("#eva_adjust_postponement_detail_normal_cost_living").val();
eva_adjust_postponement_detail_normalObject.middle = $("#eva_adjust_postponement_detail_normal_middle").val();
eva_adjust_postponement_detail_normalObject.promoted_percentage = $("#eva_adjust_postponement_detail_normal_promoted_percentage").val();
eva_adjust_postponement_detail_normalObject.total_promote = $("#eva_adjust_postponement_detail_normal_total_promote").val();
eva_adjust_postponement_detail_normalObject.new_sarary = $("#eva_adjust_postponement_detail_normal_new_sarary").val();
eva_adjust_postponement_detail_normalObject.new_cost_living = $("#eva_adjust_postponement_detail_normal_new_cost_living").val();
eva_adjust_postponement_detail_normalObject.remark = $("#eva_adjust_postponement_detail_normal_remark").val();
eva_adjust_postponement_detail_normalObject.emp_code = $("#eva_adjust_postponement_detail_normal_emp_code").val();
eva_adjust_postponement_detail_normalObject.emp_fullname = $("#eva_adjust_postponement_detail_normal_emp_fullname").val();
eva_adjust_postponement_detail_normalObject.emp_position = $("#eva_adjust_postponement_detail_normal_emp_position").val();
eva_adjust_postponement_detail_normalObject.emp_level = $("#eva_adjust_postponement_detail_normal_emp_level").val();
eva_adjust_postponement_detail_normalObject.total_score = $("#eva_adjust_postponement_detail_normal_total_score").val();
eva_adjust_postponement_detail_normalObject.eva_result = $("#eva_adjust_postponement_detail_normal_eva_result").val();
return eva_adjust_postponement_detail_normalObject;
}
function eva_adjust_postponement_detail_normal_InitialForm(s) {
var successFunc = function (result) {
eva_adjust_postponement_detail_normal_FeedDataToForm(result);
eva_adjust_postponement_detail_normal_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_adjust_postponement_detail_normalModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_detail_normal_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_detail_normal_GoCreate() {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_detail_normal_API + '/ReCreatePostponementDetailNormal?adjust_postponement_id='+getUrlParameter("id"), null, successFunc1, AlertDanger);
}
function eva_adjust_postponement_detail_normal_GoEdit(a) {
// Incase model popup
eva_adjust_postponement_detail_normal_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_adjust_postponement_detail_normalView/eva_adjust_postponement_detail_normal_d?id=" + a);
}
function eva_adjust_postponement_detail_normal_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_detail_normal_editMode = "UPDATE";
eva_adjust_postponement_detail_normal_FeedDataToForm(result);
$("#eva_adjust_postponement_detail_normalModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_detail_normal_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_normal_SetCreateForm(s) {
eva_adjust_postponement_detail_normal_editMode = "CREATE";
eva_adjust_postponement_detail_normal_InitialForm(s);
}
function eva_adjust_postponement_detail_normal_RefreshTable() {
// Incase model popup
eva_adjust_postponement_detail_normal_DoSearch();
// Incase open new page
//window.parent.eva_adjust_postponement_detail_normal_DoSearch();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_detail_normal_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_detail_normal_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_detail_normal', eva_adjust_postponement_detail_normal_customValidation))
{
return;
}
var data = eva_adjust_postponement_detail_normal_GetFromForm();
//Update Mode
if (eva_adjust_postponement_detail_normal_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_adjust_postponement_detail_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_detail_normal_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_adjust_postponement_detail_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_detail_normal_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_detail_normal_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_adjust_postponement_detail_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_detail_normal_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_adjust_postponement_detail_normalTableV;
var eva_adjust_postponement_detail_normal_setupTable = function (result) {
tmp = '"';
eva_adjust_postponement_detail_normalTableV = $('#eva_adjust_postponement_detail_normalTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "emp_code" },
{ "data": "emp_fullname" },
{ "data": "emp_position" },
{ "data": "emp_level" },
{ "data": "total_score" },
{ "data": "eva_result" },
{ "data": "sarary" },
{ "data": "cost_living" },
{ "data": "middle" },
{ "data": "promoted_percentage" },
{ "data": "total_promote" },
{ "data": "new_sarary" },
{ "data": "new_cost_living" },
{ "data": "remark" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_detail_normal_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_detail_normal_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_adjust_postponement_detail_normal_InitiateDataTable() {
startLoad();
var p = $.param(eva_adjust_postponement_detail_normal_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal/GetListBySearch?"+p, eva_adjust_postponement_detail_normal_setupTable, AlertDanger);
}
function eva_adjust_postponement_detail_normal_DoSearch() {
var p = $.param(eva_adjust_postponement_detail_normal_GetSearchParameter());
var eva_adjust_postponement_detail_normal_reload = function (result) {
eva_adjust_postponement_detail_normalTableV.destroy();
eva_adjust_postponement_detail_normal_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal/GetListBySearch?"+p, eva_adjust_postponement_detail_normal_reload, AlertDanger);
}
function eva_adjust_postponement_detail_normal_GetSelect(f) {
var eva_adjust_postponement_detail_normal_selectitem = [];
$.each(eva_adjust_postponement_detail_normalTableV.rows('.selected').data(), function (key, value) {
eva_adjust_postponement_detail_normal_selectitem.push(value[f]);
});
alert(eva_adjust_postponement_detail_normal_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,255 @@
var eva_adjust_postponement_detail_quota_editMode = "CREATE";
var eva_adjust_postponement_detail_quota_API = "/api/eva_adjust_postponement_detail_quota/";
//================= Search Customizaiton =========================================
function eva_adjust_postponement_detail_quota_GetSearchParameter() {
var eva_adjust_postponement_detail_quotaSearchObject = new Object();
eva_adjust_postponement_detail_quotaSearchObject.adjust_postponement_quota_id = getUrlParameter("id");
return eva_adjust_postponement_detail_quotaSearchObject;
}
function eva_adjust_postponement_detail_quota_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_detail_quota_adjust_postponement_quota_id").val(data.adjust_postponement_quota_id);
}
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_detail_quota_FeedDataToForm(data) {
$("#eva_adjust_postponement_detail_quota_id").val(data.id);
$("#eva_adjust_postponement_detail_quota_adjust_postponement_quota_id").val(data.adjust_postponement_quota_id);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_detail_quota_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
$("#eva_adjust_postponement_detail_quota_sarary").val(data.sarary);
$("#eva_adjust_postponement_detail_quota_cost_living").val(data.cost_living);
$("#eva_adjust_postponement_detail_quota_middle").val(data.middle);
$("#eva_adjust_postponement_detail_quota_promoted_percentage").val(data.promoted_percentage);
$("#eva_adjust_postponement_detail_quota_total_promote").val(data.total_promote);
$("#eva_adjust_postponement_detail_quota_new_sarary").val(data.new_sarary);
$("#eva_adjust_postponement_detail_quota_new_cost_living").val(data.new_cost_living);
$("#eva_adjust_postponement_detail_quota_remark").val(data.remark);
$("#eva_adjust_postponement_detail_quota_receive_quota").val(data.receive_quota);
$("#eva_adjust_postponement_detail_quota_new_sarary_with_quota").val(data.new_sarary_with_quota);
}
function eva_adjust_postponement_detail_quota_GetFromForm() {
var eva_adjust_postponement_detail_quotaObject = new Object();
eva_adjust_postponement_detail_quotaObject.id = $("#eva_adjust_postponement_detail_quota_id").val();
eva_adjust_postponement_detail_quotaObject.adjust_postponement_quota_id = $("#eva_adjust_postponement_detail_quota_adjust_postponement_quota_id").val();
eva_adjust_postponement_detail_quotaObject.employee_id = $("#eva_adjust_postponement_detail_quota_employee_id").val();
eva_adjust_postponement_detail_quotaObject.sarary = $("#eva_adjust_postponement_detail_quota_sarary").val();
eva_adjust_postponement_detail_quotaObject.cost_living = $("#eva_adjust_postponement_detail_quota_cost_living").val();
eva_adjust_postponement_detail_quotaObject.middle = $("#eva_adjust_postponement_detail_quota_middle").val();
eva_adjust_postponement_detail_quotaObject.promoted_percentage = $("#eva_adjust_postponement_detail_quota_promoted_percentage").val();
eva_adjust_postponement_detail_quotaObject.total_promote = $("#eva_adjust_postponement_detail_quota_total_promote").val();
eva_adjust_postponement_detail_quotaObject.new_sarary = $("#eva_adjust_postponement_detail_quota_new_sarary").val();
eva_adjust_postponement_detail_quotaObject.new_cost_living = $("#eva_adjust_postponement_detail_quota_new_cost_living").val();
eva_adjust_postponement_detail_quotaObject.remark = $("#eva_adjust_postponement_detail_quota_remark").val();
eva_adjust_postponement_detail_quotaObject.receive_quota = $("#eva_adjust_postponement_detail_quota_receive_quota").val();
eva_adjust_postponement_detail_quotaObject.new_sarary_with_quota = $("#eva_adjust_postponement_detail_quota_new_sarary_with_quota").val();
return eva_adjust_postponement_detail_quotaObject;
}
function eva_adjust_postponement_detail_quota_InitialForm(s) {
var successFunc = function (result) {
eva_adjust_postponement_detail_quota_FeedDataToForm(result);
eva_adjust_postponement_detail_quota_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_adjust_postponement_detail_quotaModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_detail_quota_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_detail_quota_GoCreate() {
window_open(appsite + "/external_employeeview/external_employee");
}
function eva_adjust_postponement_detail_quota_GoEdit(a) {
// Incase model popup
eva_adjust_postponement_detail_quota_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_adjust_postponement_detail_quotaView/eva_adjust_postponement_detail_quota_d?id=" + a);
}
function eva_adjust_postponement_detail_quota_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_detail_quota_editMode = "UPDATE";
eva_adjust_postponement_detail_quota_FeedDataToForm(result);
$("#eva_adjust_postponement_detail_quotaModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_detail_quota_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_quota_SetCreateForm(s) {
eva_adjust_postponement_detail_quota_editMode = "CREATE";
eva_adjust_postponement_detail_quota_InitialForm(s);
}
function eva_adjust_postponement_detail_quota_RefreshTable() {
// Incase model popup
eva_adjust_postponement_detail_quota_DoSearch();
// Incase open new page
//window.parent.eva_adjust_postponement_detail_quota_DoSearch();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_detail_quota_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_detail_quota_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_detail_quota', eva_adjust_postponement_detail_quota_customValidation))
{
return;
}
var data = eva_adjust_postponement_detail_quota_GetFromForm();
//Update Mode
if (eva_adjust_postponement_detail_quota_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_adjust_postponement_detail_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_detail_quota_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_adjust_postponement_detail_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_detail_quota_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_detail_quota_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_adjust_postponement_detail_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_detail_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_detail_quota_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_adjust_postponement_detail_quotaTableV;
var eva_adjust_postponement_detail_quota_setupTable = function (result) {
tmp = '"';
eva_adjust_postponement_detail_quotaTableV = $('#eva_adjust_postponement_detail_quotaTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "emp_code" },
{ "data": "emp_fullname" },
{ "data": "emp_position" },
{ "data": "emp_level" },
{ "data": "total_score" },
{ "data": "eva_result" },
{ "data": "sarary" },
{ "data": "cost_living" },
{ "data": "middle" },
{ "data": "promoted_percentage" },
{ "data": "total_promote" },
{ "data": "new_sarary" },
{ "data": "new_cost_living" },
{ "data": "remark" },
{ "data": "receive_quota" },
{ "data": "new_sarary_with_quota" }
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_detail_quota_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_detail_quota_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_adjust_postponement_detail_quota_InitiateDataTable() {
startLoad();
var p = $.param(eva_adjust_postponement_detail_quota_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_quota/GetListBySearch?"+p, eva_adjust_postponement_detail_quota_setupTable, AlertDanger);
}
function eva_adjust_postponement_detail_quota_DoSearch() {
var p = $.param(eva_adjust_postponement_detail_quota_GetSearchParameter());
var eva_adjust_postponement_detail_quota_reload = function (result) {
eva_adjust_postponement_detail_quotaTableV.destroy();
eva_adjust_postponement_detail_quota_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_quota/GetListBySearch?"+p, eva_adjust_postponement_detail_quota_reload, AlertDanger);
}
function eva_adjust_postponement_detail_quota_GetSelect(f) {
var eva_adjust_postponement_detail_quota_selectitem = [];
$.each(eva_adjust_postponement_detail_quotaTableV.rows('.selected').data(), function (key, value) {
eva_adjust_postponement_detail_quota_selectitem.push(value[f]);
});
alert(eva_adjust_postponement_detail_quota_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================
function AddMultiple(data) {
var successFunc1 = function (result) {
AlertSuccess(result.code + " " + result.message);
eva_adjust_postponement_detail_quota_RefreshTable();
endLoad();
};
startLoad();
var zz = new Object();
zz.adjust_postponement_quota_id = getUrlParameter("id");
zz.fiscal_year = $("#eva_adjust_postponement_quota_fiscal_year").val();
zz.theRound = $("#eva_adjust_postponement_quota_theRound").val();
var p = $.param(zz);
AjaxPostRequest(apisite + eva_adjust_postponement_detail_quota_API + "AddMultiple?" + p, data, successFunc1, AlertDanger);
}

View File

@@ -0,0 +1,234 @@
var eva_adjust_postponement_normal_editMode = "CREATE";
var eva_adjust_postponement_normal_API = "/api/eva_adjust_postponement_normal/";
//================= Search Customizaiton =========================================
function eva_adjust_postponement_normal_GetSearchParameter() {
var eva_adjust_postponement_normalSearchObject = new Object();
eva_adjust_postponement_normalSearchObject.fiscal_year = $("#s_eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalSearchObject.theRound = $("#s_eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalSearchObject.org_id = $("#s_eva_adjust_postponement_normal_org_id").val();
return eva_adjust_postponement_normalSearchObject;
}
function eva_adjust_postponement_normal_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_normal_fiscal_year").val(data.fiscal_year);
$("#s_eva_adjust_postponement_normal_theRound").val(data.theRound);
DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_normal_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
}
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_normal_FeedDataToForm(data) {
console.log(data);
$("#eva_adjust_postponement_normal_id").val(data.id);
$("#eva_adjust_postponement_normal_fiscal_year").val(data.fiscal_year);
$("#eva_adjust_postponement_normal_theDate").val(formatDate(data.theDate));
$("#eva_adjust_postponement_normal_theRound").val(data.theRound);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_create_evaluation_id"), data, "id", "description", "item_create_evaluation_id", data.create_evaluation_id);
$("#eva_adjust_postponement_normal_limit").val(data.limit);
$("#eva_adjust_postponement_normal_limit_frame").val(data.limit_frame);
$("#eva_adjust_postponement_normal_limit_quota").val(data.limit_quota);
$("#eva_adjust_postponement_normal_percentage").val(data.percentage);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by"), data, "id", "fullname", "item_managed_by", data.managed_by);
//DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
}
function eva_adjust_postponement_normal_GetFromForm() {
var eva_adjust_postponement_normalObject = new Object();
eva_adjust_postponement_normalObject.id = $("#eva_adjust_postponement_normal_id").val();
eva_adjust_postponement_normalObject.fiscal_year = $("#eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalObject.theDate = getDate($("#eva_adjust_postponement_normal_theDate").val());
eva_adjust_postponement_normalObject.theRound = $("#eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalObject.create_evaluation_id = $("#eva_adjust_postponement_normal_create_evaluation_id").val();
eva_adjust_postponement_normalObject.limit = $("#eva_adjust_postponement_normal_limit").val();
eva_adjust_postponement_normalObject.limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
eva_adjust_postponement_normalObject.limit_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
eva_adjust_postponement_normalObject.percentage = $("#eva_adjust_postponement_normal_percentage").val();
eva_adjust_postponement_normalObject.managed_by = $("#eva_adjust_postponement_normal_managed_by").val();
//eva_adjust_postponement_normalObject.org_id = $("#eva_adjust_postponement_normal_org_id").val();
return eva_adjust_postponement_normalObject;
}
function eva_adjust_postponement_normal_InitialForm(s) {
var successFunc = function (result) {
eva_adjust_postponement_normal_FeedDataToForm(result);
eva_adjust_postponement_normal_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_adjust_postponement_normalModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_normal_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_normal_GoCreate() {
// Incase model popup
eva_adjust_postponement_normal_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_adjust_postponement_normalView/eva_adjust_postponement_normal_d");
}
function eva_adjust_postponement_normal_GoEdit(a) {
// Incase model popup
//eva_adjust_postponement_normal_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_adjust_postponement_normalView/eva_adjust_postponement_normal_d?id=" + a);
}
function eva_adjust_postponement_normal_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_normal_editMode = "UPDATE";
eva_adjust_postponement_normal_FeedDataToForm(result);
$("#eva_adjust_postponement_normalModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_normal_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_normal_SetCreateForm(s) {
eva_adjust_postponement_normal_editMode = "CREATE";
eva_adjust_postponement_normal_InitialForm(s);
}
function eva_adjust_postponement_normal_RefreshTable() {
// Incase model popup
eva_adjust_postponement_normal_DoSearch();
// Incase open new page
//window.parent.eva_adjust_postponement_normal_DoSearch();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_normal_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_normal_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_normal', eva_adjust_postponement_normal_customValidation))
{
return;
}
var data = eva_adjust_postponement_normal_GetFromForm();
//Update Mode
if (eva_adjust_postponement_normal_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_adjust_postponement_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_normal_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_adjust_postponement_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_normal_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_normal_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_adjust_postponement_normalModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_normal_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_adjust_postponement_normalTableV;
var eva_adjust_postponement_normal_setupTable = function (result) {
tmp = '"';
eva_adjust_postponement_normalTableV = $('#eva_adjust_postponement_normalTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "fiscal_year" },
{ "data": "txt_theDate" },
{ "data": "theRound" },
{ "data": "create_evaluation_id_description" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_normal_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_normal_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_adjust_postponement_normal_InitiateDataTable() {
startLoad();
var p = $.param(eva_adjust_postponement_normal_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_normal/GetListBySearch?"+p, eva_adjust_postponement_normal_setupTable, AlertDanger);
}
function eva_adjust_postponement_normal_DoSearch() {
var p = $.param(eva_adjust_postponement_normal_GetSearchParameter());
var eva_adjust_postponement_normal_reload = function (result) {
eva_adjust_postponement_normalTableV.destroy();
eva_adjust_postponement_normal_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_normal/GetListBySearch?"+p, eva_adjust_postponement_normal_reload, AlertDanger);
}
function eva_adjust_postponement_normal_GetSelect(f) {
var eva_adjust_postponement_normal_selectitem = [];
$.each(eva_adjust_postponement_normalTableV.rows('.selected').data(), function (key, value) {
eva_adjust_postponement_normal_selectitem.push(value[f]);
});
alert(eva_adjust_postponement_normal_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,116 @@
var eva_adjust_postponement_normal_editMode = "CREATE";
var eva_adjust_postponement_normal_API = "/api/eva_adjust_postponement_normal/";
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_normal_FeedDataToForm(data) {
$("#eva_adjust_postponement_normal_id").val(data.id);
$("#eva_adjust_postponement_normal_fiscal_year").val(data.fiscal_year);
$("#eva_adjust_postponement_normal_theDate").val(formatDate(data.theDate));
$("#eva_adjust_postponement_normal_theRound").val(data.theRound);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_create_evaluation_id"), data, "id", "description", "item_create_evaluation_id", data.create_evaluation_id);
$("#eva_adjust_postponement_normal_limit").val(data.limit);
$("#eva_adjust_postponement_normal_limit_frame").val(data.limit_frame);
$("#eva_adjust_postponement_normal_limit_quota").val(data.limit_quota);
$("#eva_adjust_postponement_normal_percentage").val(data.percentage);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by"), data, "id", "fullname", "item_managed_by", data.managed_by);
//DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
}
function eva_adjust_postponement_normal_GetFromForm() {
var eva_adjust_postponement_normalObject = new Object();
eva_adjust_postponement_normalObject.id = $("#eva_adjust_postponement_normal_id").val();
eva_adjust_postponement_normalObject.fiscal_year = $("#eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalObject.theDate = getDate($("#eva_adjust_postponement_normal_theDate").val());
eva_adjust_postponement_normalObject.theRound = $("#eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalObject.create_evaluation_id = $("#eva_adjust_postponement_normal_create_evaluation_id").val();
eva_adjust_postponement_normalObject.limit = $("#eva_adjust_postponement_normal_limit").val();
eva_adjust_postponement_normalObject.limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
eva_adjust_postponement_normalObject.limit_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
eva_adjust_postponement_normalObject.percentage = $("#eva_adjust_postponement_normal_percentage").val();
eva_adjust_postponement_normalObject.managed_by = $("#eva_adjust_postponement_normal_managed_by").val();
//eva_adjust_postponement_normalObject.org_id = $("#eva_adjust_postponement_normal_org_id").val();
return eva_adjust_postponement_normalObject;
}
function eva_adjust_postponement_normal_InitialForm() {
var successFunc = function (result) {
eva_adjust_postponement_normal_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_normal_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_normal_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_normal_editMode = "UPDATE";
eva_adjust_postponement_normal_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_normal_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_normal_SetCreateForm() {
eva_adjust_postponement_normal_editMode = "CREATE";
eva_adjust_postponement_normal_InitialForm();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_normal_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_normal_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_normal', eva_adjust_postponement_normal_customValidation))
{
return;
}
var data = eva_adjust_postponement_normal_GetFromForm();
//Update Mode
if (eva_adjust_postponement_normal_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_normal_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_normal_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_normal_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_normal_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_normal_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,171 @@
function eva_adjust_postponement_normal_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_adjust_postponement_normal_id_" + i).val("");
$("#eva_adjust_postponement_normal_fiscal_year_" + i).val("");
$("#eva_adjust_postponement_normal_theDate_" + i).val("");
$("#eva_adjust_postponement_normal_theRound_" + i).val("");
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_create_evaluation_id_" + i), blankItem, "id", "performance_plan_id", "item_create_evaluation_id", data.create_evaluation_id);
$("#eva_adjust_postponement_normal_limit_" + i).val("");
$("#eva_adjust_postponement_normal_limit_frame_" + i).val("");
$("#eva_adjust_postponement_normal_limit_quota_" + i).val("");
$("#eva_adjust_postponement_normal_percentage_" + i).val("");
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by_" + i), blankItem, "id", "external_name", "item_managed_by", data.managed_by);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id);
}
function eva_adjust_postponement_normal_FeedDataToForm(data, i, blankItem) {
$("#eva_adjust_postponement_normal_id_" + i).val(data.id);
$("#eva_adjust_postponement_normal_fiscal_year_" + i).val(data.fiscal_year);
$("#eva_adjust_postponement_normal_theDate_" + i).val(formatDate(data.theDate));
$("#eva_adjust_postponement_normal_theRound_" + i).val(data.theRound);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_create_evaluation_id_" + i), blankItem, "id", "performance_plan_id", "item_create_evaluation_id", data.create_evaluation_id);
$("#eva_adjust_postponement_normal_limit_" + i).val(data.limit);
$("#eva_adjust_postponement_normal_limit_frame_" + i).val(data.limit_frame);
$("#eva_adjust_postponement_normal_limit_quota_" + i).val(data.limit_quota);
$("#eva_adjust_postponement_normal_percentage_" + i).val(data.percentage);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by_" + i), blankItem, "id", "external_name", "item_managed_by", data.managed_by);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_org_id_" + i), blankItem, "id", "external_name", "item_org_id", data.org_id);
}
function eva_adjust_postponement_normal_GetFromForm(obj, i) {
var eva_adjust_postponement_normalObject = new Object();
eva_adjust_postponement_normalObject.id = obj.find("#eva_adjust_postponement_normal_id_" + i).val();
eva_adjust_postponement_normalObject.fiscal_year = obj.find("#eva_adjust_postponement_normal_fiscal_year_" + i).val();
eva_adjust_postponement_normalObject.theDate = getDate(obj.find("#eva_adjust_postponement_normal_theDate_" + i).val());
eva_adjust_postponement_normalObject.theRound = obj.find("#eva_adjust_postponement_normal_theRound_" + i).val();
eva_adjust_postponement_normalObject.create_evaluation_id = obj.find("#eva_adjust_postponement_normal_create_evaluation_id_" + i).val();
eva_adjust_postponement_normalObject.limit = obj.find("#eva_adjust_postponement_normal_limit_" + i).val();
eva_adjust_postponement_normalObject.limit_frame = obj.find("#eva_adjust_postponement_normal_limit_frame_" + i).val();
eva_adjust_postponement_normalObject.limit_quota = obj.find("#eva_adjust_postponement_normal_limit_quota_" + i).val();
eva_adjust_postponement_normalObject.percentage = obj.find("#eva_adjust_postponement_normal_percentage_" + i).val();
eva_adjust_postponement_normalObject.managed_by = obj.find("#eva_adjust_postponement_normal_managed_by_" + i).val();
eva_adjust_postponement_normalObject.org_id = obj.find("#eva_adjust_postponement_normal_org_id_" + i).val();
eva_adjust_postponement_normalObject.active_mode = obj.find("#isActive_" + i + "_eva_adjust_postponement_normal").val();
return eva_adjust_postponement_normalObject;
}
function eva_adjust_postponement_normal_Save(id) {
//Insert eva_adjust_postponement_normal List
var eva_adjust_postponement_normal = [];
$('#eva_adjust_postponement_normalBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_adjust_postponement_normal = eva_adjust_postponement_normal_GetFromForm($(this), i);
eva_adjust_postponement_normal.push(eacheva_adjust_postponement_normal);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_adjust_postponement_normal/UpdateMultiple', eva_adjust_postponement_normal, successFunc, AlertDanger);
}
function eva_adjust_postponement_normal_Get(a, blankItem) {
$('#eva_adjust_postponement_normalBody').empty();
var successFunc = function (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_adjust_postponement_normal" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_normal_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_fiscal_year_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_normal_theDate_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_theRound_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_create_evaluation_id_' + (i + 1) +'"></select></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_frame_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_percentage_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_managed_by_' + (i + 1) +'"></select></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_org_id_' + (i + 1) +'"></select></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_normal_Removeeva_adjust_postponement_normal(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_adjust_postponement_normal_Restoreeva_adjust_postponement_normal(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_adjust_postponement_normalBody').append($(tag));
eva_adjust_postponement_normal_FeedDataToForm(data, (i + 1), blankItem);
});
eva_adjust_postponement_normal_Summary();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_normal", successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_adjust_postponement_normal/GetListBycreate_evaluation_id/' + a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_adjust_postponement_normal/GetListBymanaged_by/' + a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_adjust_postponement_normal/GetListByorg_id/' + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_normal_Add() {
var successFunc = function (result) {
var i = $("#eva_adjust_postponement_normalBody tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_normal" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_normal_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_fiscal_year_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_normal_theDate_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_theRound_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_create_evaluation_id_' + (i + 1) +'"></select></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_frame_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_limit_quota_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_normal_percentage_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_managed_by_' + (i + 1) +'"></select></td>';
tag += '<td><select class="form-control" id="eva_adjust_postponement_normal_org_id_' + (i + 1) +'"></select></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_normal_Removeeva_adjust_postponement_normal(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:eva_adjust_postponement_normal_Restoreeva_adjust_postponement_normal(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_adjust_postponement_normalBody').append($(tag));
eva_adjust_postponement_normal_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_normal/" + "GetBlankItem", successFunc, AlertDanger);
}
function eva_adjust_postponement_normal_Removeeva_adjust_postponement_normal(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_normal_Summary();
}
}
function eva_adjust_postponement_normal_Restoreeva_adjust_postponement_normal(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
eva_adjust_postponement_normal_Summary();
}
}
function eva_adjust_postponement_normal_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_adjust_postponement_normal_InitialForm(id) {
var successFunc = function (result) {
eva_adjust_postponement_normal_Get('', result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_normal/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,62 @@
var eva_adjust_postponement_normal_API = "/api/eva_adjust_postponement_normal/";
//================= Search Customizaiton =========================================
function eva_adjust_postponement_normal_GetSearchParameter(fileType) {
var eva_adjust_postponement_normalSearchObject = new Object();
eva_adjust_postponement_normalSearchObject.fiscal_year = $("#s_eva_adjust_postponement_normal_fiscal_year").val();
eva_adjust_postponement_normalSearchObject.theRound = $("#s_eva_adjust_postponement_normal_theRound").val();
eva_adjust_postponement_normalSearchObject.org_id = $("#s_eva_adjust_postponement_normal_org_id").val();
eva_adjust_postponement_normalSearchObject.fileType = fileType;
console.log(eva_adjust_postponement_normalSearchObject);
return eva_adjust_postponement_normalSearchObject;
}
function eva_adjust_postponement_normal_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_normal_fiscal_year").val(data.fiscal_year);
$("#s_eva_adjust_postponement_normal_theRound").val(data.theRound);
DropDownClearFormAndFeedWithData($("#s_eva_adjust_postponement_normal_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
}
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_normal_InitialForm(s) {
var successFunc = function (result) {
eva_adjust_postponement_normal_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_normal_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_eva_adjust_postponement_normal_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_normal_DoSearch(fileType) {
if (!ValidateForm('s_eva_adjust_postponement_normal', s_eva_adjust_postponement_normal_customValidation)) {
return;
}
var p = $.param(eva_adjust_postponement_normal_GetSearchParameter(fileType));
var report_url = apisite + "/api/eva_adjust_postponement_normal/eva_adjust_postponement_normal_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,223 @@
var eva_adjust_postponement_quota_editMode = "CREATE";
var eva_adjust_postponement_quota_API = "/api/eva_adjust_postponement_quota/";
//================= Search Customizaiton =========================================
function eva_adjust_postponement_quota_GetSearchParameter() {
var eva_adjust_postponement_quotaSearchObject = new Object();
eva_adjust_postponement_quotaSearchObject.fiscal_year = $("#s_eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaSearchObject.theRound = $("#s_eva_adjust_postponement_quota_theRound").val();
return eva_adjust_postponement_quotaSearchObject;
}
function eva_adjust_postponement_quota_FeedDataToSearchForm(data) {
$("#s_eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
$("#s_eva_adjust_postponement_quota_theRound").val(data.theRound);
}
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_quota_FeedDataToForm(data) {
$("#eva_adjust_postponement_quota_id").val(data.id);
$("#eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
$("#eva_adjust_postponement_quota_theDate").val(formatDate(data.theDate));
$("#eva_adjust_postponement_quota_theRound").val(data.theRound);
$("#eva_adjust_postponement_quota_limit_quota").val(data.limit_quota);
$("#eva_adjust_postponement_quota_limit_frame_quota").val(data.limit_frame_quota);
$("#eva_adjust_postponement_quota_command_no").val(data.command_no);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_quota_managed_by"), data, "id", "fullname", "item_managed_by", data.managed_by);
}
function eva_adjust_postponement_quota_GetFromForm() {
var eva_adjust_postponement_quotaObject = new Object();
eva_adjust_postponement_quotaObject.id = $("#eva_adjust_postponement_quota_id").val();
eva_adjust_postponement_quotaObject.fiscal_year = $("#eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaObject.theDate = getDate($("#eva_adjust_postponement_quota_theDate").val());
eva_adjust_postponement_quotaObject.theRound = $("#eva_adjust_postponement_quota_theRound").val();
eva_adjust_postponement_quotaObject.limit_quota = $("#eva_adjust_postponement_quota_limit_quota").val();
eva_adjust_postponement_quotaObject.limit_frame_quota = $("#eva_adjust_postponement_quota_limit_frame_quota").val();
eva_adjust_postponement_quotaObject.command_no = $("#eva_adjust_postponement_quota_command_no").val();
eva_adjust_postponement_quotaObject.managed_by = $("#eva_adjust_postponement_quota_managed_by").val();
return eva_adjust_postponement_quotaObject;
}
function eva_adjust_postponement_quota_InitialForm(s) {
var successFunc = function (result) {
eva_adjust_postponement_quota_FeedDataToForm(result);
eva_adjust_postponement_quota_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_adjust_postponement_quotaModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_quota_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_quota_GoCreate() {
// Incase model popup
eva_adjust_postponement_quota_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d");
}
function eva_adjust_postponement_quota_GoEdit(a) {
// Incase model popup
//eva_adjust_postponement_quota_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d?id=" + a);
}
function eva_adjust_postponement_quota_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_quota_editMode = "UPDATE";
eva_adjust_postponement_quota_FeedDataToForm(result);
$("#eva_adjust_postponement_quotaModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_quota_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_quota_SetCreateForm(s) {
eva_adjust_postponement_quota_editMode = "CREATE";
eva_adjust_postponement_quota_InitialForm(s);
}
function eva_adjust_postponement_quota_RefreshTable() {
// Incase model popup
eva_adjust_postponement_quota_DoSearch();
// Incase open new page
//window.parent.eva_adjust_postponement_quota_DoSearch();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_quota_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_quota_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_quota', eva_adjust_postponement_quota_customValidation))
{
return;
}
var data = eva_adjust_postponement_quota_GetFromForm();
//Update Mode
if (eva_adjust_postponement_quota_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_adjust_postponement_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_quota_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_adjust_postponement_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_quota_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_quota_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_adjust_postponement_quotaModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_quota_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_adjust_postponement_quotaTableV;
var eva_adjust_postponement_quota_setupTable = function (result) {
tmp = '"';
eva_adjust_postponement_quotaTableV = $('#eva_adjust_postponement_quotaTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "fiscal_year" },
{ "data": "txt_theDate" },
{ "data": "theRound" },
{ "data": "command_no" }
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_quota_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_quota_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_adjust_postponement_quota_InitiateDataTable() {
startLoad();
var p = $.param(eva_adjust_postponement_quota_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_quota/GetListBySearch?"+p, eva_adjust_postponement_quota_setupTable, AlertDanger);
}
function eva_adjust_postponement_quota_DoSearch() {
var p = $.param(eva_adjust_postponement_quota_GetSearchParameter());
var eva_adjust_postponement_quota_reload = function (result) {
eva_adjust_postponement_quotaTableV.destroy();
eva_adjust_postponement_quota_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_quota/GetListBySearch?"+p, eva_adjust_postponement_quota_reload, AlertDanger);
}
function eva_adjust_postponement_quota_GetSelect(f) {
var eva_adjust_postponement_quota_selectitem = [];
$.each(eva_adjust_postponement_quotaTableV.rows('.selected').data(), function (key, value) {
eva_adjust_postponement_quota_selectitem.push(value[f]);
});
alert(eva_adjust_postponement_quota_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,110 @@
var eva_adjust_postponement_quota_editMode = "CREATE";
var eva_adjust_postponement_quota_API = "/api/eva_adjust_postponement_quota/";
//================= Form Data Customizaiton =========================================
function eva_adjust_postponement_quota_FeedDataToForm(data) {
$("#eva_adjust_postponement_quota_id").val(data.id);
$("#eva_adjust_postponement_quota_fiscal_year").val(data.fiscal_year);
$("#eva_adjust_postponement_quota_theDate").val(formatDate(data.theDate));
$("#eva_adjust_postponement_quota_theRound").val(data.theRound);
$("#eva_adjust_postponement_quota_limit_quota").val(data.limit_quota);
$("#eva_adjust_postponement_quota_limit_frame_quota").val(data.limit_frame_quota);
$("#eva_adjust_postponement_quota_command_no").val(data.command_no);
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_quota_managed_by"), data, "id", "fullname", "item_managed_by", data.managed_by);
}
function eva_adjust_postponement_quota_GetFromForm() {
var eva_adjust_postponement_quotaObject = new Object();
eva_adjust_postponement_quotaObject.id = $("#eva_adjust_postponement_quota_id").val();
eva_adjust_postponement_quotaObject.fiscal_year = $("#eva_adjust_postponement_quota_fiscal_year").val();
eva_adjust_postponement_quotaObject.theDate = getDate($("#eva_adjust_postponement_quota_theDate").val());
eva_adjust_postponement_quotaObject.theRound = $("#eva_adjust_postponement_quota_theRound").val();
eva_adjust_postponement_quotaObject.limit_quota = $("#eva_adjust_postponement_quota_limit_quota").val();
eva_adjust_postponement_quotaObject.limit_frame_quota = $("#eva_adjust_postponement_quota_limit_frame_quota").val();
eva_adjust_postponement_quotaObject.command_no = $("#eva_adjust_postponement_quota_command_no").val();
eva_adjust_postponement_quotaObject.managed_by = $("#eva_adjust_postponement_quota_managed_by").val();
return eva_adjust_postponement_quotaObject;
}
function eva_adjust_postponement_quota_InitialForm() {
var successFunc = function (result) {
eva_adjust_postponement_quota_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_quota_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_adjust_postponement_quota_SetEditForm(a) {
var successFunc = function (result) {
eva_adjust_postponement_quota_editMode = "UPDATE";
eva_adjust_postponement_quota_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_adjust_postponement_quota_API + a, successFunc, AlertDanger);
}
function eva_adjust_postponement_quota_SetCreateForm() {
eva_adjust_postponement_quota_editMode = "CREATE";
eva_adjust_postponement_quota_InitialForm();
}
//================= Update and Delete =========================================
var eva_adjust_postponement_quota_customValidation = function (group) {
return "";
};
function eva_adjust_postponement_quota_PutUpdate() {
if (!ValidateForm('eva_adjust_postponement_quota', eva_adjust_postponement_quota_customValidation))
{
return;
}
var data = eva_adjust_postponement_quota_GetFromForm();
//Update Mode
if (eva_adjust_postponement_quota_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_adjust_postponement_quota_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_adjust_postponement_quota_API, data, successFunc2, AlertDanger);
}
}
function eva_adjust_postponement_quota_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_adjust_postponement_quota_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_adjust_postponement_quota_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,220 @@
var eva_create_evaluation_editMode = "CREATE";
var eva_create_evaluation_API = "/api/eva_create_evaluation/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_GetSearchParameter() {
var eva_create_evaluationSearchObject = new Object();
eva_create_evaluationSearchObject.performance_plan_id = $("#s_eva_create_evaluation_performance_plan_id").val();
eva_create_evaluationSearchObject.evaluation_group_id = $("#s_eva_create_evaluation_evaluation_group_id").val();
return eva_create_evaluationSearchObject;
}
function eva_create_evaluation_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_FeedDataToForm(data) {
$("#eva_create_evaluation_id").val(data.id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
$("#eva_create_evaluation_score1").val(data.score1);
$("#eva_create_evaluation_score2").val(data.score2);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
}
function eva_create_evaluation_GetFromForm() {
var eva_create_evaluationObject = new Object();
eva_create_evaluationObject.id = $("#eva_create_evaluation_id").val();
eva_create_evaluationObject.performance_plan_id = $("#eva_create_evaluation_performance_plan_id").val();
eva_create_evaluationObject.employee_id = $("#eva_create_evaluation_employee_id").val();
eva_create_evaluationObject.score1 = $("#eva_create_evaluation_score1").val();
eva_create_evaluationObject.score2 = $("#eva_create_evaluation_score2").val();
eva_create_evaluationObject.evaluation_group_id = $("#eva_create_evaluation_evaluation_group_id").val();
return eva_create_evaluationObject;
}
function eva_create_evaluation_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_FeedDataToForm(result);
eva_create_evaluation_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluationModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_GoCreate() {
// Incase model popup
eva_create_evaluation_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluationView/eva_create_evaluation_d");
}
function eva_create_evaluation_GoEdit(a) {
// Incase model popup
//eva_create_evaluation_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_create_evaluationView/eva_create_evaluation_d?id=" + a);
}
function eva_create_evaluation_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_editMode = "UPDATE";
eva_create_evaluation_FeedDataToForm(result);
$("#eva_create_evaluationModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_SetCreateForm(s) {
eva_create_evaluation_editMode = "CREATE";
eva_create_evaluation_InitialForm(s);
}
function eva_create_evaluation_RefreshTable() {
// Incase model popup
eva_create_evaluation_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_customValidation = function (group) {
return "";
};
function eva_create_evaluation_PutUpdate() {
if (!ValidateForm('eva_create_evaluation', eva_create_evaluation_customValidation))
{
return;
}
var data = eva_create_evaluation_GetFromForm();
//Update Mode
if (eva_create_evaluation_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluationModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluationModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluationModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluationTableV;
var eva_create_evaluation_setupTable = function (result) {
tmp = '"';
eva_create_evaluationTableV = $('#eva_create_evaluationTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "performance_plan_id_eva_performance_plan_fiscal_year" },
{ "data": "evaluation_group_id_eva_evaluation_group_code" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "score1" },
{ "data": "score2" },
],
"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_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_create_evaluation_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation/GetListBySearch", eva_create_evaluation_setupTable, AlertDanger);
}
function eva_create_evaluation_DoSearch() {
var p = $.param(eva_create_evaluation_GetSearchParameter());
var eva_create_evaluation_reload = function (result) {
eva_create_evaluationTableV.destroy();
eva_create_evaluation_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation/GetListBySearch?"+p, eva_create_evaluation_reload, AlertDanger);
}
function eva_create_evaluation_GetSelect(f) {
var eva_create_evaluation_selectitem = [];
$.each(eva_create_evaluationTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_selectitem.push(value[f]);
});
alert(eva_create_evaluation_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,106 @@
var eva_create_evaluation_editMode = "CREATE";
var eva_create_evaluation_API = "/api/eva_create_evaluation/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_FeedDataToForm(data) {
$("#eva_create_evaluation_id").val(data.id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
$("#eva_create_evaluation_score1").val(data.score1);
$("#eva_create_evaluation_score2").val(data.score2);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id);
}
function eva_create_evaluation_GetFromForm() {
var eva_create_evaluationObject = new Object();
eva_create_evaluationObject.id = $("#eva_create_evaluation_id").val();
eva_create_evaluationObject.performance_plan_id = $("#eva_create_evaluation_performance_plan_id").val();
eva_create_evaluationObject.employee_id = $("#eva_create_evaluation_employee_id").val();
eva_create_evaluationObject.score1 = $("#eva_create_evaluation_score1").val();
eva_create_evaluationObject.score2 = $("#eva_create_evaluation_score2").val();
eva_create_evaluationObject.evaluation_group_id = $("#eva_create_evaluation_evaluation_group_id").val();
return eva_create_evaluationObject;
}
function eva_create_evaluation_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_editMode = "UPDATE";
eva_create_evaluation_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_SetCreateForm() {
eva_create_evaluation_editMode = "CREATE";
eva_create_evaluation_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_customValidation = function (group) {
return "";
};
function eva_create_evaluation_PutUpdate() {
if (!ValidateForm('eva_create_evaluation', eva_create_evaluation_customValidation))
{
return;
}
var data = eva_create_evaluation_GetFromForm();
//Update Mode
if (eva_create_evaluation_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,224 @@
var eva_create_evaluation_detail_editMode = "CREATE";
var eva_create_evaluation_detail_API = "/api/eva_create_evaluation_detail/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_detail_GetSearchParameter() {
var eva_create_evaluation_detailSearchObject = new Object();
eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val();
return eva_create_evaluation_detailSearchObject;
}
function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_id").val(data.id);
$("#eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_chief"), data, "id", "fullname", "item_chief", data.chief);
}
function eva_create_evaluation_detail_GetFromForm() {
var eva_create_evaluation_detailObject = new Object();
eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val();
eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val();
eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val();
eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val();
return eva_create_evaluation_detailObject;
}
function eva_create_evaluation_detail_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_FeedDataToForm(result);
eva_create_evaluation_detail_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detailModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_GoCreate() {
window_open(appsite + "/external_employeeview/external_employee");
// Incase model popup
//eva_create_evaluation_detail_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detailView/eva_create_evaluation_detail_d");
}
function eva_create_evaluation_detail_GoEdit(a) {
// Incase model popup
eva_create_evaluation_detail_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detailView/eva_create_evaluation_detail_d?id=" + a);
}
function eva_create_evaluation_detail_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_editMode = "UPDATE";
eva_create_evaluation_detail_FeedDataToForm(result);
$("#eva_create_evaluation_detailModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_SetCreateForm(s) {
eva_create_evaluation_detail_editMode = "CREATE";
eva_create_evaluation_detail_InitialForm(s);
}
function eva_create_evaluation_detail_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detailTableV;
var eva_create_evaluation_detail_setupTable = function (result) {
tmp = '"';
eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "chief_external_linkage_external_name" },
],
"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_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_create_evaluation_detail_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_detail_InitiateDataTable(id) {
startLoad();
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(id);
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_DoSearch() {
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
var eva_create_evaluation_detail_reload = function (result) {
eva_create_evaluation_detailTableV.destroy();
eva_create_evaluation_detail_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_reload, AlertDanger);
}
function eva_create_evaluation_detail_GetSelect(f) {
var eva_create_evaluation_detail_selectitem = [];
$.each(eva_create_evaluation_detailTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================
function AddMultiple(data) {
var successFunc1 = function (result) {
AlertSuccess(result.code + " " + result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
var id = getUrlParameter("id");
AjaxPostRequest(apisite + eva_create_evaluation_detail_API + "AddMultiple?create_evaluation_id=" + id, data, successFunc1, AlertDanger);
}

View File

@@ -0,0 +1,219 @@
var eva_create_evaluation_detail_editMode = "CREATE";
var eva_create_evaluation_detail_API = "/api/eva_create_evaluation_detail/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_detail_GetSearchParameter() {
var eva_create_evaluation_detailSearchObject = new Object();
eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val();
return eva_create_evaluation_detailSearchObject;
}
function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_id").val(data.id);
$("#eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_chief"), data, "id", "fullname", "item_chief", data.chief);
}
function eva_create_evaluation_detail_GetFromForm() {
var eva_create_evaluation_detailObject = new Object();
eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val();
eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val();
eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val();
eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val();
return eva_create_evaluation_detailObject;
}
function eva_create_evaluation_detail_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_FeedDataToForm(result);
eva_create_evaluation_detail_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detailModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_GoCreate() {
window_open(appsite + "/external_employeeview/external_employee");
// Incase model popup
//eva_create_evaluation_detail_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detailView/eva_create_evaluation_detail_d");
}
function eva_create_evaluation_detail_GoEdit(a) {
// Incase model popup
eva_create_evaluation_detail_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detailView/eva_create_evaluation_detail_d?id=" + a);
}
function eva_create_evaluation_detail_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_editMode = "UPDATE";
eva_create_evaluation_detail_FeedDataToForm(result);
$("#eva_create_evaluation_detailModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_SetCreateForm(s) {
eva_create_evaluation_detail_editMode = "CREATE";
eva_create_evaluation_detail_InitialForm(s);
}
function eva_create_evaluation_detail_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detailTableV;
var eva_create_evaluation_detail_setupTable = function (result) {
tmp = '"';
eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "chief_external_linkage_external_name" },
{ "data": "status_chief" },
{ "data": "status_supervisor" }
],
"columnDefs": [
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_detail_InitiateDataTable(id) {
startLoad();
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(id);
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_DoSearch() {
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
var eva_create_evaluation_detail_reload = function (result) {
eva_create_evaluation_detailTableV.destroy();
eva_create_evaluation_detail_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_reload, AlertDanger);
}
function eva_create_evaluation_detail_GetSelect(f) {
var eva_create_evaluation_detail_selectitem = [];
$.each(eva_create_evaluation_detailTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================
function AddMultiple(data) {
var successFunc1 = function (result) {
AlertSuccess(result.code + " " + result.message);
eva_create_evaluation_detail_RefreshTable();
endLoad();
};
startLoad();
var id = getUrlParameter("id");
AjaxPostRequest(apisite + eva_create_evaluation_detail_API + "AddMultiple?create_evaluation_id=" + id, data, successFunc1, AlertDanger);
}

View File

@@ -0,0 +1,246 @@
var eva_create_evaluation_detail_agreement_editMode = "CREATE";
var eva_create_evaluation_detail_agreement_API = "/api/eva_create_evaluation_detail_agreement/";
//================= Search Customizaiton =========================================
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();
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);
}
//================= 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);
}
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();
return eva_create_evaluation_detail_agreementObject;
}
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);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_agreementModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_agreement_GoCreate() {
// Incase model popup
eva_create_evaluation_detail_agreement_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d");
}
function eva_create_evaluation_detail_agreement_GoEdit(a) {
// Incase model popup
//eva_create_evaluation_detail_agreement_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d?id=" + a);
}
function eva_create_evaluation_detail_agreement_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_agreement_editMode = "UPDATE";
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
$("#eva_create_evaluation_detail_agreementModel").modal("show");
endLoad();
};
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);
}
function eva_create_evaluation_detail_agreement_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_agreement_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_agreement_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_agreement_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_agreement_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_agreement_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_agreement_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_agreement_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detail_agreementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detail_agreementTableV;
var eva_create_evaluation_detail_agreement_setupTable = function (result) {
console.log(result);
tmp = '"';
eva_create_evaluation_detail_agreementTableV = $('#eva_create_evaluation_detail_agreementTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "status_chief" },
{ "data": "status_supervisor" },
],
"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_agreement_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_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);
}
function eva_create_evaluation_detail_agreement_DoSearch() {
var p = $.param(eva_create_evaluation_detail_agreement_GetSearchParameter());
var eva_create_evaluation_detail_agreement_reload = function (result) {
eva_create_evaluation_detail_agreementTableV.destroy();
eva_create_evaluation_detail_agreement_setupTable(result);
endLoad();
};
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) {
var eva_create_evaluation_detail_agreement_selectitem = [];
$.each(eva_create_evaluation_detail_agreementTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_agreement_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_agreement_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,120 @@
var eva_create_evaluation_detail_agreement_editMode = "CREATE";
var eva_create_evaluation_detail_agreement_API = "/api/eva_create_evaluation_detail_agreement/";
//================= 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);
}
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();
return eva_create_evaluation_detail_agreementObject;
}
function eva_create_evaluation_detail_agreement_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_agreement_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_agreement_editMode = "UPDATE";
eva_create_evaluation_detail_agreement_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_agreement_SetCreateForm() {
eva_create_evaluation_detail_agreement_editMode = "CREATE";
eva_create_evaluation_detail_agreement_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_agreement_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_agreement_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_agreement_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_agreement_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_agreement_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,257 @@
var eva_create_evaluation_detail_process_editMode = "CREATE";
var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detail_process/";
//================= Search Customizaiton =========================================
function eva_create_evaluation_detail_process_GetSearchParameter() {
var eva_create_evaluation_detail_processSearchObject = new Object();
eva_create_evaluation_detail_processSearchObject.create_evaluation_id = $("#s_eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processSearchObject.org_id = $("#s_eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processSearchObject.search_employee_code = $("#s_eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processSearchObject.search_employee_fullname = $("#s_eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processSearchObject;
}
function eva_create_evaluation_detail_process_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#s_eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
}
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
}
function eva_create_evaluation_detail_process_GetFromForm() {
var eva_create_evaluation_detail_processObject = new Object();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processObject;
}
function eva_create_evaluation_detail_process_InitialForm(s) {
var successFunc = function (result) {
eva_create_evaluation_detail_process_FeedDataToForm(result);
eva_create_evaluation_detail_process_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_create_evaluation_detail_processModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_process_GoCreate() {
// Incase model popup
eva_create_evaluation_detail_process_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d");
}
function eva_create_evaluation_detail_process_GoEdit(a) {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + a);
}
function eva_create_evaluation_detail_process_GoEdit2(a) {
window_open(appsite + "/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2?id=" + a);
}
function eva_create_evaluation_detail_process_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_process_editMode = "UPDATE";
eva_create_evaluation_detail_process_FeedDataToForm(result);
$("#eva_create_evaluation_detail_processModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_process_SetCreateForm(s) {
eva_create_evaluation_detail_process_editMode = "CREATE";
eva_create_evaluation_detail_process_InitialForm(s);
}
function eva_create_evaluation_detail_process_RefreshTable() {
// Incase model popup
eva_create_evaluation_detail_process_DoSearch();
// Incase open new page
//window.parent.eva_create_evaluation_detail_process_DoSearch();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_process_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_process_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_process_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_process_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_process_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_create_evaluation_detail_processModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_create_evaluation_detail_processTableV;
var eva_create_evaluation_detail_process_setupTable = function (result) {
tmp = '"';
eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "employee_code" },
{ "data": "employee_fullname" },
{ "data": "employee_position" },
{ "data": "employee_position_level" },
{ "data": "org_id_external_linkage_external_name" },
{ "data": "id" },
{ "data": "id" },
],
"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_process_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> "
+"<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_create_evaluation_detail_process_GoEdit2(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> ";
}
},
{
"targets": -1,
"data": "id",
"render": function (data, type, row, meta) {
return "";
}
},
{
"targets": -2,
"data": "id",
"render": function (data, type, row, meta) {
return "";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_create_evaluation_detail_process_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch", eva_create_evaluation_detail_process_setupTable, AlertDanger);
}
function eva_create_evaluation_detail_process_DoSearch() {
var p = $.param(eva_create_evaluation_detail_process_GetSearchParameter());
var eva_create_evaluation_detail_process_reload = function (result) {
eva_create_evaluation_detail_processTableV.destroy();
eva_create_evaluation_detail_process_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail_process/GetListBySearch?"+p, eva_create_evaluation_detail_process_reload, AlertDanger);
}
function eva_create_evaluation_detail_process_GetSelect(f) {
var eva_create_evaluation_detail_process_selectitem = [];
$.each(eva_create_evaluation_detail_processTableV.rows('.selected').data(), function (key, value) {
eva_create_evaluation_detail_process_selectitem.push(value[f]);
});
alert(eva_create_evaluation_detail_process_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,152 @@
var eva_create_evaluation_detail_process_editMode = "CREATE";
var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detail_process/";
function calculationAllItem(){
var total = parseFloat($("#eva_create_evaluation_detail_summary1_achievement_chief").text())+
parseFloat($("#eva_create_evaluation_detail_summary1_competency_chief").text())
$("#eva_create_evaluation_detail_summary1_score_chief").text(total.toFixed(2));
cal_level();
}
function cal_level(){
var total = parseFloat($("#eva_create_evaluation_detail_summary1_score_chief").text());
$.each(item_level_score, function( i, val ) {
//console.log(val.min_score);
//console.log(total);
if(total >= val.min_score){
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(val.detail);
}
});
}
//================= Form Data Customizaiton =========================================
var item_level_score;
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
//console.log(data);
item_level_score = data.item_level_score;
$("#w1").text(data.create_evaluation_score1.toFixed(2)+"%");
$("#w2").text(data.create_evaluation_score2.toFixed(2)+"%");
$("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFixed(2)+"%");
}
function eva_create_evaluation_detail_process_GetFromForm() {
var eva_create_evaluation_detail_processObject = new Object();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processObject;
}
function eva_create_evaluation_detail_process_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_process_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_process_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_process_editMode = "UPDATE";
eva_create_evaluation_detail_process_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_process_SetCreateForm() {
eva_create_evaluation_detail_process_editMode = "CREATE";
eva_create_evaluation_detail_process_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_process_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_process_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_process_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_process_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_process_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,151 @@
var eva_create_evaluation_detail_process_editMode = "CREATE";
var eva_create_evaluation_detail_process_API = "/api/eva_create_evaluation_detail_process/";
function calculationAllItem(){
var total = parseFloat($("#eva_create_evaluation_detail_summary2_achievement_supervisor").text())+
parseFloat($("#eva_create_evaluation_detail_summary2_competency_supervisor").text())
$("#eva_create_evaluation_detail_summary2_score_supervisor").text(total.toFixed(2));
cal_level();
}
function cal_level(){
var total = parseFloat($("#eva_create_evaluation_detail_summary2_score_supervisor").text());
$.each(item_level_score, function( i, val ) {
//console.log(val.min_score);
//console.log(total);
if(total >= val.min_score){
$("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(val.detail);
}
});
}
//================= Form Data Customizaiton =========================================
var item_level_score;
function eva_create_evaluation_detail_process_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_process_id").val(data.id);
$("#eva_create_evaluation_detail_process_evaluation_round").text(data.evaluation_round);
$("#eva_create_evaluation_detail_process_employee_code").text(data.employee_code);
$("#eva_create_evaluation_detail_process_employee_fullname").text(data.employee_fullname);
$("#eva_create_evaluation_detail_process_employee_position").text(data.employee_position);
$("#eva_create_evaluation_detail_process_employee_position_type").text(data.employee_position_type);
$("#eva_create_evaluation_detail_process_employee_position_level").text(data.employee_position_level);
$("#eva_create_evaluation_detail_process_employee_org").text(data.employee_org);
$("#eva_create_evaluation_detail_process_chief_fullname").text(data.chief_fullname);
$("#eva_create_evaluation_detail_process_chief_position").text(data.chief_position);
$("#eva_create_evaluation_detail_process_create_evaluation_id").val(data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code);
$("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname);
item_level_score = data.item_level_score;
$("#w1").text(data.create_evaluation_score1.toFixed(2)+"%");
$("#w2").text(data.create_evaluation_score2.toFixed(2)+"%");
$("#w3").text((data.create_evaluation_score1+data.create_evaluation_score2).toFixed(2)+"%");
}
function eva_create_evaluation_detail_process_GetFromForm() {
var eva_create_evaluation_detail_processObject = new Object();
eva_create_evaluation_detail_processObject.id = $("#eva_create_evaluation_detail_process_id").val();
eva_create_evaluation_detail_processObject.evaluation_round = $("#eva_create_evaluation_detail_process_evaluation_round").text();
eva_create_evaluation_detail_processObject.employee_code = $("#eva_create_evaluation_detail_process_employee_code").text();
eva_create_evaluation_detail_processObject.employee_fullname = $("#eva_create_evaluation_detail_process_employee_fullname").text();
eva_create_evaluation_detail_processObject.employee_position = $("#eva_create_evaluation_detail_process_employee_position").text();
eva_create_evaluation_detail_processObject.employee_position_type = $("#eva_create_evaluation_detail_process_employee_position_type").text();
eva_create_evaluation_detail_processObject.employee_position_level = $("#eva_create_evaluation_detail_process_employee_position_level").text();
eva_create_evaluation_detail_processObject.employee_org = $("#eva_create_evaluation_detail_process_employee_org").text();
eva_create_evaluation_detail_processObject.chief_fullname = $("#eva_create_evaluation_detail_process_chief_fullname").text();
eva_create_evaluation_detail_processObject.chief_position = $("#eva_create_evaluation_detail_process_chief_position").text();
eva_create_evaluation_detail_processObject.create_evaluation_id = $("#eva_create_evaluation_detail_process_create_evaluation_id").val();
eva_create_evaluation_detail_processObject.org_id = $("#eva_create_evaluation_detail_process_org_id").val();
eva_create_evaluation_detail_processObject.search_employee_code = $("#eva_create_evaluation_detail_process_search_employee_code").val();
eva_create_evaluation_detail_processObject.search_employee_fullname = $("#eva_create_evaluation_detail_process_search_employee_fullname").val();
return eva_create_evaluation_detail_processObject;
}
function eva_create_evaluation_detail_process_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_process_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_process_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_process_editMode = "UPDATE";
eva_create_evaluation_detail_process_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_process_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_process_SetCreateForm() {
eva_create_evaluation_detail_process_editMode = "CREATE";
eva_create_evaluation_detail_process_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_process_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_process_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_process', eva_create_evaluation_detail_process_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_process_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_process_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_process_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_process_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_process_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_process_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_process_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,109 @@
var eva_create_evaluation_detail_review01_editMode = "CREATE";
var eva_create_evaluation_detail_review01_API = "/api/eva_create_evaluation_detail_review01/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_review01_FeedDataToForm(data) {
//console.log(data);
$("#eva_create_evaluation_detail_review01_id").val(data.id);
$("#eva_create_evaluation_detail_review01_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_review01_supervisor1").val(data.supervisor1);
//DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review01_supervisor1_result"), data, "external_id", "external_name", "item_supervisor1_result", data.supervisor1_result);
$("#eva_create_evaluation_detail_review01_supervisor1_remark").val(data.supervisor1_remark);
$("#eva_create_evaluation_detail_review01_supervisor1_date").val(formatDate(data.supervisor1_date));
}
function eva_create_evaluation_detail_review01_GetFromForm() {
var eva_create_evaluation_detail_review01Object = new Object();
eva_create_evaluation_detail_review01Object.id = $("#eva_create_evaluation_detail_review01_id").val();
eva_create_evaluation_detail_review01Object.create_evaluation_id = $("#eva_create_evaluation_detail_review01_create_evaluation_id").val();
eva_create_evaluation_detail_review01Object.supervisor1 = $("#eva_create_evaluation_detail_review01_supervisor1").val();
//eva_create_evaluation_detail_review01Object.supervisor1_result = $("#eva_create_evaluation_detail_review01_supervisor1_result").val();
eva_create_evaluation_detail_review01Object.supervisor1_remark = $("#eva_create_evaluation_detail_review01_supervisor1_remark").val();
eva_create_evaluation_detail_review01Object.supervisor1_date = getDate($("#eva_create_evaluation_detail_review01_supervisor1_date").val());
return eva_create_evaluation_detail_review01Object;
}
function eva_create_evaluation_detail_review01_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_review01_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_review01_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_review01_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_review01_editMode = "UPDATE";
eva_create_evaluation_detail_review01_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_review01_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_review01_SetCreateForm() {
eva_create_evaluation_detail_review01_editMode = "CREATE";
eva_create_evaluation_detail_review01_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_review01_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_review01_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_review01', eva_create_evaluation_detail_review01_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_review01_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_review01_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_review01_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_review01_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_review01_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_review01_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_review01_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,106 @@
var eva_create_evaluation_detail_review02_editMode = "CREATE";
var eva_create_evaluation_detail_review02_API = "/api/eva_create_evaluation_detail_review02/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_review02_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_review02_id").val(data.id);
$("#eva_create_evaluation_detail_review02_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_review02_supervisor2").val(data.supervisor2);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_review02_supervisor2_result"), data, "external_code", "external_name", "item_supervisor2_result", data.supervisor2_result);
$("#eva_create_evaluation_detail_review02_supervisor2_remark").val(data.supervisor2_remark);
$("#eva_create_evaluation_detail_review02_supervisor2_date").val(formatDate(data.supervisor2_date));
}
function eva_create_evaluation_detail_review02_GetFromForm() {
var eva_create_evaluation_detail_review02Object = new Object();
eva_create_evaluation_detail_review02Object.id = $("#eva_create_evaluation_detail_review02_id").val();
eva_create_evaluation_detail_review02Object.create_evaluation_id = $("#eva_create_evaluation_detail_review02_create_evaluation_id").val();
eva_create_evaluation_detail_review02Object.supervisor2 = $("#eva_create_evaluation_detail_review02_supervisor2").val();
eva_create_evaluation_detail_review02Object.supervisor2_result = $("#eva_create_evaluation_detail_review02_supervisor2_result").val();
eva_create_evaluation_detail_review02Object.supervisor2_remark = $("#eva_create_evaluation_detail_review02_supervisor2_remark").val();
eva_create_evaluation_detail_review02Object.supervisor2_date = getDate($("#eva_create_evaluation_detail_review02_supervisor2_date").val());
return eva_create_evaluation_detail_review02Object;
}
function eva_create_evaluation_detail_review02_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_review02_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_review02_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_review02_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_review02_editMode = "UPDATE";
eva_create_evaluation_detail_review02_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_review02_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_review02_SetCreateForm() {
eva_create_evaluation_detail_review02_editMode = "CREATE";
eva_create_evaluation_detail_review02_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_review02_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_review02_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_review02', eva_create_evaluation_detail_review02_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_review02_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_review02_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_review02_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_review02_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_review02_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_review02_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_review02_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,107 @@
var eva_create_evaluation_detail_status_editMode = "CREATE";
var eva_create_evaluation_detail_status_API = "/api/eva_create_evaluation_detail_status/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_status_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_status_id").val(data.id);
$("#eva_create_evaluation_detail_status_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_status_status_self").val(data.status_self);
$("#eva_create_evaluation_detail_status_status_chief").val(data.status_chief);
$("#eva_create_evaluation_detail_status_status_supervisor").val(data.status_supervisor);
}
function eva_create_evaluation_detail_status_GetFromForm() {
var eva_create_evaluation_detail_statusObject = new Object();
eva_create_evaluation_detail_statusObject.id = $("#eva_create_evaluation_detail_status_id").val();
eva_create_evaluation_detail_statusObject.create_evaluation_id = $("#eva_create_evaluation_detail_status_create_evaluation_id").val();
eva_create_evaluation_detail_statusObject.status_self = $("#eva_create_evaluation_detail_status_status_self").val();
eva_create_evaluation_detail_statusObject.status_chief = $("#eva_create_evaluation_detail_status_status_chief").val();
eva_create_evaluation_detail_statusObject.status_supervisor = $("#eva_create_evaluation_detail_status_status_supervisor").val();
return eva_create_evaluation_detail_statusObject;
}
function eva_create_evaluation_detail_status_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_status_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_status_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_status_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_status_editMode = "UPDATE";
eva_create_evaluation_detail_status_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_status_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_status_SetCreateForm() {
eva_create_evaluation_detail_status_editMode = "CREATE";
eva_create_evaluation_detail_status_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_status_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_status_PutUpdate(a) {
if (!ValidateForm('eva_create_evaluation_detail_status', eva_create_evaluation_detail_status_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_status_GetFromForm();
if(a == "next1"){
data.status_chief = "Y";
}
else if(a == "back1"){
data.status_chief = "N";
data.status_self = "N";
}
else if(a == "next2"){
data.status_supervisor = "Y";
}
else if(a == "back2"){
data.status_supervisor = "N";
data.status_chief = "N";
}
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_status_API + data.id, data, successFunc1, AlertDanger);
}
function eva_create_evaluation_detail_status_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_status_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_status_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,114 @@
var eva_create_evaluation_detail_summary1_editMode = "CREATE";
var eva_create_evaluation_detail_summary1_API = "/api/eva_create_evaluation_detail_summary1/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_summary1_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_summary1_id").val(data.id);
$("#eva_create_evaluation_detail_summary1_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(data.total_summary_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(data.Final_summary_chief);
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(data.total_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(data.Final_summary_competency_chief);
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(data.achievement_chief);
$("#eva_create_evaluation_detail_summary1_competency_chief").text(data.competency_chief);
$("#eva_create_evaluation_detail_summary1_score_chief").text(data.score_chief);
$("#eva_create_evaluation_detail_summary1_level_score_chief").text(data.level_score_chief);
}
function eva_create_evaluation_detail_summary1_GetFromForm() {
var eva_create_evaluation_detail_summary1Object = new Object();
eva_create_evaluation_detail_summary1Object.id = $("#eva_create_evaluation_detail_summary1_id").val();
eva_create_evaluation_detail_summary1Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary1_create_evaluation_id").val();
eva_create_evaluation_detail_summary1Object.total_summary_chief = $("#eva_create_evaluation_detail_summary1_total_summary_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_chief").text();
eva_create_evaluation_detail_summary1Object.total_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.Final_summary_competency_chief = $("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text();
eva_create_evaluation_detail_summary1Object.achievement_chief = $("#eva_create_evaluation_detail_summary1_achievement_chief").text();
eva_create_evaluation_detail_summary1Object.competency_chief = $("#eva_create_evaluation_detail_summary1_competency_chief").text();
eva_create_evaluation_detail_summary1Object.score_chief = $("#eva_create_evaluation_detail_summary1_score_chief").text();
eva_create_evaluation_detail_summary1Object.level_score_chief = $("#eva_create_evaluation_detail_summary1_level_score_chief").text();
return eva_create_evaluation_detail_summary1Object;
}
function eva_create_evaluation_detail_summary1_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_summary1_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_summary1_editMode = "UPDATE";
eva_create_evaluation_detail_summary1_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary1_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_summary1_SetCreateForm() {
eva_create_evaluation_detail_summary1_editMode = "CREATE";
eva_create_evaluation_detail_summary1_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_summary1_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_summary1_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_summary1', eva_create_evaluation_detail_summary1_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_summary1_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_summary1_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_summary1_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_summary1_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_summary1_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_summary1_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_summary1_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,114 @@
var eva_create_evaluation_detail_summary2_editMode = "CREATE";
var eva_create_evaluation_detail_summary2_API = "/api/eva_create_evaluation_detail_summary2/";
//================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_summary2_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_summary2_id").val(data.id);
$("#eva_create_evaluation_detail_summary2_create_evaluation_id").val(data.create_evaluation_id);
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(data.total_summary_supervisor);
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(data.Final_summary_supervisor);
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(data.total_summary_competency_supervisor);
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(data.Final_summary_competency_supervisor);
$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(data.achievement_supervisor);
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(data.competency_supervisor);
$("#eva_create_evaluation_detail_summary2_score_supervisor").text(data.score_supervisor);
$("#eva_create_evaluation_detail_summary2_level_score_supervisor").text(data.level_score_supervisor);
}
function eva_create_evaluation_detail_summary2_GetFromForm() {
var eva_create_evaluation_detail_summary2Object = new Object();
eva_create_evaluation_detail_summary2Object.id = $("#eva_create_evaluation_detail_summary2_id").val();
eva_create_evaluation_detail_summary2Object.create_evaluation_id = $("#eva_create_evaluation_detail_summary2_create_evaluation_id").val();
eva_create_evaluation_detail_summary2Object.total_summary_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text();
eva_create_evaluation_detail_summary2Object.Final_summary_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text();
eva_create_evaluation_detail_summary2Object.total_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text();
eva_create_evaluation_detail_summary2Object.Final_summary_competency_supervisor = $("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text();
eva_create_evaluation_detail_summary2Object.achievement_supervisor = $("#eva_create_evaluation_detail_summary2_achievement_supervisor").text();
eva_create_evaluation_detail_summary2Object.competency_supervisor = $("#eva_create_evaluation_detail_summary2_competency_supervisor").text();
eva_create_evaluation_detail_summary2Object.score_supervisor = $("#eva_create_evaluation_detail_summary2_score_supervisor").text();
eva_create_evaluation_detail_summary2Object.level_score_supervisor = $("#eva_create_evaluation_detail_summary2_level_score_supervisor").text();
return eva_create_evaluation_detail_summary2Object;
}
function eva_create_evaluation_detail_summary2_InitialForm() {
var successFunc = function (result) {
eva_create_evaluation_detail_summary2_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary2_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_create_evaluation_detail_summary2_SetEditForm(a) {
var successFunc = function (result) {
eva_create_evaluation_detail_summary2_editMode = "UPDATE";
eva_create_evaluation_detail_summary2_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_summary2_API + a, successFunc, AlertDanger);
}
function eva_create_evaluation_detail_summary2_SetCreateForm() {
eva_create_evaluation_detail_summary2_editMode = "CREATE";
eva_create_evaluation_detail_summary2_InitialForm();
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_summary2_customValidation = function (group) {
return "";
};
function eva_create_evaluation_detail_summary2_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_summary2', eva_create_evaluation_detail_summary2_customValidation))
{
return;
}
var data = eva_create_evaluation_detail_summary2_GetFromForm();
//Update Mode
if (eva_create_evaluation_detail_summary2_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_summary2_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_summary2_API, data, successFunc2, AlertDanger);
}
}
function eva_create_evaluation_detail_summary2_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_create_evaluation_detail_summary2_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_summary2_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,222 @@
var eva_evaluation_achievement_editMode = "CREATE";
var eva_evaluation_achievement_API = "/api/eva_evaluation_achievement/";
//================= Search Customizaiton =========================================
function eva_evaluation_achievement_GetSearchParameter() {
var eva_evaluation_achievementSearchObject = new Object();
eva_evaluation_achievementSearchObject.create_evaluation_detail_id = $("#s_eva_evaluation_achievement_create_evaluation_detail_id").val();
return eva_evaluation_achievementSearchObject;
}
function eva_evaluation_achievement_FeedDataToSearchForm(data) {
$("#s_eva_evaluation_achievement_create_evaluation_detail_id").val(getUrlParameter("id"));
}
//================= Form Data Customizaiton =========================================
function eva_evaluation_achievement_FeedDataToForm(data) {
$("#eva_evaluation_achievement_id").val(data.id);
$("#eva_evaluation_achievement_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
$("#eva_evaluation_achievement_achievement").val(data.achievement);
$("#eva_evaluation_achievement_weight").val(data.weight);
feedFileToControl(data.thefile, data.thefileDisplay, "eva_evaluation_achievement_thefile", "file");
}
function eva_evaluation_achievement_GetFromForm() {
var eva_evaluation_achievementObject = new Object();
eva_evaluation_achievementObject.id = $("#eva_evaluation_achievement_id").val();
eva_evaluation_achievementObject.create_evaluation_detail_id = getUrlParameter("id"); //$("#eva_evaluation_achievement_create_evaluation_detail_id").val();
eva_evaluation_achievementObject.achievement = $("#eva_evaluation_achievement_achievement").val();
eva_evaluation_achievementObject.weight = $("#eva_evaluation_achievement_weight").val();
if ($("#eva_evaluation_achievement_thefile_hidURL").val() !== null) {
eva_evaluation_achievementObject.thefile = $("#eva_evaluation_achievement_thefile_hidURL").val();
}else {
eva_evaluation_achievementObject.thefile = "";
}
return eva_evaluation_achievementObject;
}
function eva_evaluation_achievement_InitialForm(s) {
var successFunc = function (result) {
eva_evaluation_achievement_FeedDataToForm(result);
eva_evaluation_achievement_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_evaluation_achievementModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_achievement_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_achievement_GoCreate() {
// Incase model popup
eva_evaluation_achievement_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_evaluation_achievementView/eva_evaluation_achievement_d");
}
function eva_evaluation_achievement_GoEdit(a) {
// Incase model popup
eva_evaluation_achievement_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_evaluation_achievementView/eva_evaluation_achievement_d?id=" + a);
}
function eva_evaluation_achievement_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_achievement_editMode = "UPDATE";
eva_evaluation_achievement_FeedDataToForm(result);
$("#eva_evaluation_achievementModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_achievement_API + a, successFunc, AlertDanger);
}
function eva_evaluation_achievement_SetCreateForm(s) {
eva_evaluation_achievement_editMode = "CREATE";
eva_evaluation_achievement_InitialForm(s);
}
function eva_evaluation_achievement_RefreshTable() {
// Incase model popup
eva_evaluation_achievement_DoSearch();
// Incase open new page
//window.parent.eva_evaluation_achievement_DoSearch();
}
//================= Update and Delete =========================================
var eva_evaluation_achievement_customValidation = function (group) {
return "";
};
function eva_evaluation_achievement_PutUpdate() {
if (!ValidateForm('eva_evaluation_achievement', eva_evaluation_achievement_customValidation))
{
return;
}
var data = eva_evaluation_achievement_GetFromForm();
//Update Mode
if (eva_evaluation_achievement_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_evaluation_achievementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_achievement_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_achievement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_evaluation_achievementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_achievement_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_achievement_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_achievement_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_evaluation_achievementModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_achievement_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_achievement_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_evaluation_achievementTableV;
var eva_evaluation_achievement_setupTable = function (result) {
tmp = '"';
eva_evaluation_achievementTableV = $('#eva_evaluation_achievementTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "achievement" },
{ "data": "weight" },
{ "data": "txt_thefile" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_evaluation_achievement_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_evaluation_achievement_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_evaluation_achievement_InitiateDataTable(id) {
startLoad();
$("#s_eva_evaluation_achievement_create_evaluation_detail_id").val(id)
var p = $.param(eva_evaluation_achievement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement/GetListBySearch?"+p, eva_evaluation_achievement_setupTable, AlertDanger);
}
function eva_evaluation_achievement_DoSearch() {
var p = $.param(eva_evaluation_achievement_GetSearchParameter());
var eva_evaluation_achievement_reload = function (result) {
eva_evaluation_achievementTableV.destroy();
eva_evaluation_achievement_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement/GetListBySearch?"+p, eva_evaluation_achievement_reload, AlertDanger);
}
function eva_evaluation_achievement_GetSelect(f) {
var eva_evaluation_achievement_selectitem = [];
$.each(eva_evaluation_achievementTableV.rows('.selected').data(), function (key, value) {
eva_evaluation_achievement_selectitem.push(value[f]);
});
alert(eva_evaluation_achievement_selectitem);
}
//================= File Upload =========================================
$('#eva_evaluation_achievement_thefile_file').change(function () {
UploadImage($('#eva_evaluation_achievement_thefile_file'), 'eva_evaluation_achievement_thefile');
});
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,141 @@
function eva_evaluation_achievement_process_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_evaluation_achievement_process_id_" + i).val("");
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val("");
$("#eva_evaluation_achievement_process_achievement_" + i).text("");
$("#eva_evaluation_achievement_process_weight_" + i).text("");
$("#eva_evaluation_achievement_process_score_" + i).val("");
$("#eva_evaluation_achievement_process_sumary_" + i).text("");
//$("#eva_evaluation_achievement_process_target_score1_" + i).text("");
//$("#eva_evaluation_achievement_process_target_score2_" + i).text("");
//$("#eva_evaluation_achievement_process_target_score3_" + i).text("");
//$("#eva_evaluation_achievement_process_target_score4_" + i).text("");
//$("#eva_evaluation_achievement_process_target_score5_" + i).text("");
}
function eva_evaluation_achievement_process_FeedDataToForm(data, i, blankItem) {
//console.log(data);
$("#eva_evaluation_achievement_process_id_" + i).val(data.id);
$("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_achievement_process_achievement_" + i).text(data.achievement);
$("#eva_evaluation_achievement_process_weight_" + i).text(data.weight);
$("#eva_evaluation_achievement_process_score_" + i).val(data.score);
$("#eva_evaluation_achievement_process_sumary_" + i).text(data.sumary);
//$("#eva_evaluation_achievement_process_target_score1_" + i).text(data.target_score1);
//$("#eva_evaluation_achievement_process_target_score2_" + i).text(data.target_score2);
//$("#eva_evaluation_achievement_process_target_score3_" + i).text(data.target_score3);
//$("#eva_evaluation_achievement_process_target_score4_" + i).text(data.target_score4);
//$("#eva_evaluation_achievement_process_target_score5_" + i).text(data.target_score5);
}
function eva_evaluation_achievement_process_GetFromForm(obj, i) {
var eva_evaluation_achievement_processObject = new Object();
eva_evaluation_achievement_processObject.id = obj.find("#eva_evaluation_achievement_process_id_" + i).val();
eva_evaluation_achievement_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process_create_evaluation_detail_id_" + i).val();
eva_evaluation_achievement_processObject.achievement = obj.find("#eva_evaluation_achievement_process_achievement_" + i).text();
eva_evaluation_achievement_processObject.weight = obj.find("#eva_evaluation_achievement_process_weight_" + i).text();
eva_evaluation_achievement_processObject.score = obj.find("#eva_evaluation_achievement_process_score_" + i).val();
eva_evaluation_achievement_processObject.sumary = obj.find("#eva_evaluation_achievement_process_sumary_" + i).text();
eva_evaluation_achievement_processObject.target_score1 = obj.find("#eva_evaluation_achievement_process_target_score1_" + i).text();
eva_evaluation_achievement_processObject.target_score2 = obj.find("#eva_evaluation_achievement_process_target_score2_" + i).text();
eva_evaluation_achievement_processObject.target_score3 = obj.find("#eva_evaluation_achievement_process_target_score3_" + i).text();
eva_evaluation_achievement_processObject.target_score4 = obj.find("#eva_evaluation_achievement_process_target_score4_" + i).text();
eva_evaluation_achievement_processObject.target_score5 = obj.find("#eva_evaluation_achievement_process_target_score5_" + i).text();
eva_evaluation_achievement_processObject.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_achievement_process").val();
return eva_evaluation_achievement_processObject;
}
function eva_evaluation_achievement_process_Save(id) {
//Insert eva_evaluation_achievement_process List
var eva_evaluation_achievement_process = [];
$('#eva_evaluation_achievement_processBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_evaluation_achievement_process = eva_evaluation_achievement_process_GetFromForm($(this), i);
eva_evaluation_achievement_process.push(eacheva_evaluation_achievement_process);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process/UpdateMultiple', eva_evaluation_achievement_process, successFunc, AlertDanger);
}
function eva_evaluation_achievement_process_Get(a, blankItem) {
$('#eva_evaluation_achievement_processBody').empty();
var successFunc = function (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_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_achievement_process_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process_achievement_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process_weight_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process_target_score1_' + (i + 1)+'">ร้อยละ<br/> 60-69</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process_target_score2_' + (i + 1)+'">ร้อยละ<br/> 70-79</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process_target_score3_' + (i + 1)+'">ร้อยละ<br/> 80</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process_target_score4_' + (i + 1)+'">ร้อยละ<br/> 81-90</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process_target_score5_' + (i + 1)+'">ร้อยละ<br/> 91-100</p></td>';
tag += '<td><input class="form-control" type="number" min="0" max="5" step=".01" onchange="javascript:Oneva_evaluation_achievement_process_scoreChange();" id="eva_evaluation_achievement_process_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process_sumary_' + (i + 1)+'" /></td>';
tag += '</tr>';
$('#eva_evaluation_achievement_processBody').append($(tag));
eva_evaluation_achievement_process_FeedDataToForm(data, (i + 1), blankItem);
});
eva_evaluation_achievement_process_Summary();
Oneva_evaluation_achievement_process_scoreChange();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process?create_evaluation_detail_id="+a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
}
function Oneva_evaluation_achievement_process_scoreChange(){
var total_achievement = 0;
var total_achievement_weight = 0;
var total_achievement_score = 0;
$('#eva_evaluation_achievement_processBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_achievement_process_score_" + i).val();
var weight = $("#eva_evaluation_achievement_process_weight_" + i).text();
var total = (score * weight / 100).toFixed(2);
$("#eva_evaluation_achievement_process_sumary_" + i).text(total);
total_achievement += parseFloat(total);
total_achievement_weight += parseFloat(weight);
total_achievement_score += parseFloat(score);
});
$("#h_eva_evaluation_achievement_process_weight").text(total_achievement_weight.toFixed(2));
$("#h_eva_evaluation_achievement_process_score").text(total_achievement_score.toFixed(2));
$("#eva_create_evaluation_detail_summary1_total_summary_chief").text(total_achievement.toFixed(2));
$("#eva_create_evaluation_detail_summary1_Final_summary_chief").text(total_achievement_score.toFixed(2));
$("#eva_create_evaluation_detail_summary1_achievement_chief").text(total_achievement.toFixed(2));
calculationAllItem();
}
function eva_evaluation_achievement_process_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_evaluation_achievement_process_InitialForm(id) {
var successFunc = function (result) {
eva_evaluation_achievement_process_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,148 @@
function eva_evaluation_achievement_process2_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_evaluation_achievement_process2_id_" + i).val("");
$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val("");
$("#eva_evaluation_achievement_process2_achievement_" + i).text("");
$("#eva_evaluation_achievement_process2_weight_" + i).text("");
$("#eva_evaluation_achievement_process2_score_" + i).text("");
$("#eva_evaluation_achievement_process2_score2_" + i).val("");
$("#eva_evaluation_achievement_process2_sumary2_" + i).text("");
//$("#eva_evaluation_achievement_process2_target_score1_" + i).text("");
//$("#eva_evaluation_achievement_process2_target_score2_" + i).text("");
//$("#eva_evaluation_achievement_process2_target_score3_" + i).text("");
//$("#eva_evaluation_achievement_process2_target_score4_" + i).text("");
//$("#eva_evaluation_achievement_process2_target_score5_" + i).text("");
}
function eva_evaluation_achievement_process2_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_achievement_process2_id_" + i).val(data.id);
$("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#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_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);
//$("#eva_evaluation_achievement_process2_target_score2_" + i).text(data.target_score2);
//$("#eva_evaluation_achievement_process2_target_score3_" + i).text(data.target_score3);
//$("#eva_evaluation_achievement_process2_target_score4_" + i).text(data.target_score4);
//$("#eva_evaluation_achievement_process2_target_score5_" + i).text(data.target_score5);
}
function eva_evaluation_achievement_process2_GetFromForm(obj, i) {
var eva_evaluation_achievement_process2Object = new Object();
eva_evaluation_achievement_process2Object.id = obj.find("#eva_evaluation_achievement_process2_id_" + i).val();
eva_evaluation_achievement_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_achievement_process2_create_evaluation_detail_id_" + i).val();
eva_evaluation_achievement_process2Object.achievement = obj.find("#eva_evaluation_achievement_process2_achievement_" + i).text();
eva_evaluation_achievement_process2Object.weight = obj.find("#eva_evaluation_achievement_process2_weight_" + i).text();
eva_evaluation_achievement_process2Object.score = obj.find("#eva_evaluation_achievement_process2_score_" + i).text();
eva_evaluation_achievement_process2Object.score2 = obj.find("#eva_evaluation_achievement_process2_score2_" + i).val();
eva_evaluation_achievement_process2Object.sumary2 = obj.find("#eva_evaluation_achievement_process2_sumary2_" + i).text();
eva_evaluation_achievement_process2Object.target_score1 = obj.find("#eva_evaluation_achievement_process2_target_score1_" + i).text();
eva_evaluation_achievement_process2Object.target_score2 = obj.find("#eva_evaluation_achievement_process2_target_score2_" + i).text();
eva_evaluation_achievement_process2Object.target_score3 = obj.find("#eva_evaluation_achievement_process2_target_score3_" + i).text();
eva_evaluation_achievement_process2Object.target_score4 = obj.find("#eva_evaluation_achievement_process2_target_score4_" + i).text();
eva_evaluation_achievement_process2Object.target_score5 = obj.find("#eva_evaluation_achievement_process2_target_score5_" + i).text();
eva_evaluation_achievement_process2Object.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_achievement_process2").val();
return eva_evaluation_achievement_process2Object;
}
function eva_evaluation_achievement_process2_Save(id) {
//Insert eva_evaluation_achievement_process2 List
var eva_evaluation_achievement_process2 = [];
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_evaluation_achievement_process2 = eva_evaluation_achievement_process2_GetFromForm($(this), i);
eva_evaluation_achievement_process2.push(eacheva_evaluation_achievement_process2);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
console.log(eva_evaluation_achievement_process2);
AjaxPutRequest(apisite + '/api/eva_evaluation_achievement_process2/UpdateMultiple', eva_evaluation_achievement_process2, successFunc, AlertDanger);
}
function eva_evaluation_achievement_process2_Get(a, blankItem) {
$('#eva_evaluation_achievement_process2Body').empty();
var successFunc = function (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>';
tag += '<td><p id="eva_evaluation_achievement_process2_achievement_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process2_weight_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_achievement_process2_target_score1_' + (i + 1)+'">ร้อยละ<br/> 60-69</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process2_target_score2_' + (i + 1)+'">ร้อยละ<br/> 70-79</p></td>';
tag += '<td><p id="eva_evaluation_achievement_process2_target_score3_' + (i + 1)+'">ร้อยละ<br/> 80</p></td>';
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><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>';
$('#eva_evaluation_achievement_process2Body').append($(tag));
eva_evaluation_achievement_process2_FeedDataToForm(data, (i + 1), blankItem);
});
eva_evaluation_achievement_process2_Summary();
Oneva_evaluation_achievement_process2_scoreChange();
endLoad();
};
startLoad();
//console.log(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id="+a);
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process2?create_evaluation_detail_id="+a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_evaluation_achievement_process2/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
}
function Oneva_evaluation_achievement_process2_scoreChange(){
var total_achievement = 0;
var total_achievement_weight = 0;
var total_achievement_score = 0;
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_achievement_process2_score2_" + i).val();
var weight = $("#eva_evaluation_achievement_process2_weight_" + i).text();
var total = (score * weight / 100).toFixed(2);
$("#eva_evaluation_achievement_process2_sumary2_" + i).text(total);
total_achievement += parseFloat(total);
total_achievement_weight += parseFloat(weight);
total_achievement_score += parseFloat(score);
});
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(2));
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement_score.toFixed(2));
$("#eva_create_evaluation_detail_summary2_total_summary_supervisor").text(total_achievement.toFixed(2));
$("#eva_create_evaluation_detail_summary2_Final_summary_supervisor").text(total_achievement_score.toFixed(2));
$("#eva_create_evaluation_detail_summary2_achievement_supervisor").text(total_achievement.toFixed(2));
calculationAllItem();
}
function eva_evaluation_achievement_process2_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_evaluation_achievement_process2_InitialForm(id) {
var successFunc = function (result) {
eva_evaluation_achievement_process2_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_achievement_process2/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,212 @@
var eva_evaluation_behavior_editMode = "CREATE";
var eva_evaluation_behavior_API = "/api/eva_evaluation_behavior/";
//================= Search Customizaiton =========================================
function eva_evaluation_behavior_GetSearchParameter() {
var eva_evaluation_behaviorSearchObject = new Object();
eva_evaluation_behaviorSearchObject.create_evaluation_detail_id = getUrlParameter("id"); //$("#s_eva_evaluation_behavior_create_evaluation_detail_id").val();
return eva_evaluation_behaviorSearchObject;
}
function eva_evaluation_behavior_FeedDataToSearchForm(data) {
$("#s_eva_evaluation_behavior_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
}
//================= Form Data Customizaiton =========================================
function eva_evaluation_behavior_FeedDataToForm(data) {
$("#eva_evaluation_behavior_id").val(data.id);
$("#eva_evaluation_behavior_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
$("#eva_evaluation_behavior_behavior").val(data.behavior);
$("#eva_evaluation_behavior_weight").val(data.weight);
}
function eva_evaluation_behavior_GetFromForm() {
var eva_evaluation_behaviorObject = new Object();
eva_evaluation_behaviorObject.id = $("#eva_evaluation_behavior_id").val();
eva_evaluation_behaviorObject.create_evaluation_detail_id = getUrlParameter("id"); //$("#eva_evaluation_behavior_create_evaluation_detail_id").val();
eva_evaluation_behaviorObject.behavior = $("#eva_evaluation_behavior_behavior").val();
eva_evaluation_behaviorObject.weight = $("#eva_evaluation_behavior_weight").val();
return eva_evaluation_behaviorObject;
}
function eva_evaluation_behavior_InitialForm(s) {
var successFunc = function (result) {
eva_evaluation_behavior_FeedDataToForm(result);
eva_evaluation_behavior_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_evaluation_behaviorModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_behavior_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_behavior_GoCreate() {
// Incase model popup
eva_evaluation_behavior_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_evaluation_behaviorView/eva_evaluation_behavior_d");
}
function eva_evaluation_behavior_GoEdit(a) {
// Incase model popup
eva_evaluation_behavior_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_evaluation_behaviorView/eva_evaluation_behavior_d?id=" + a);
}
function eva_evaluation_behavior_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_behavior_editMode = "UPDATE";
eva_evaluation_behavior_FeedDataToForm(result);
$("#eva_evaluation_behaviorModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_behavior_API + a, successFunc, AlertDanger);
}
function eva_evaluation_behavior_SetCreateForm(s) {
eva_evaluation_behavior_editMode = "CREATE";
eva_evaluation_behavior_InitialForm(s);
}
function eva_evaluation_behavior_RefreshTable() {
// Incase model popup
eva_evaluation_behavior_DoSearch();
// Incase open new page
//window.parent.eva_evaluation_behavior_DoSearch();
}
//================= Update and Delete =========================================
var eva_evaluation_behavior_customValidation = function (group) {
return "";
};
function eva_evaluation_behavior_PutUpdate() {
if (!ValidateForm('eva_evaluation_behavior', eva_evaluation_behavior_customValidation))
{
return;
}
var data = eva_evaluation_behavior_GetFromForm();
//Update Mode
if (eva_evaluation_behavior_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_evaluation_behaviorModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_behavior_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_behavior_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_evaluation_behaviorModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_behavior_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_behavior_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_behavior_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_evaluation_behaviorModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_behavior_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_behavior_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_evaluation_behaviorTableV;
var eva_evaluation_behavior_setupTable = function (result) {
tmp = '"';
eva_evaluation_behaviorTableV = $('#eva_evaluation_behaviorTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "behavior" },
{ "data": "weight" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_evaluation_behavior_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_evaluation_behavior_InitiateDataTable() {
startLoad();
var p = $.param(eva_evaluation_behavior_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior/GetListBySearch?"+p, eva_evaluation_behavior_setupTable, AlertDanger);
}
function eva_evaluation_behavior_DoSearch() {
var p = $.param(eva_evaluation_behavior_GetSearchParameter());
var eva_evaluation_behavior_reload = function (result) {
eva_evaluation_behaviorTableV.destroy();
eva_evaluation_behavior_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior/GetListBySearch?"+p, eva_evaluation_behavior_reload, AlertDanger);
}
function eva_evaluation_behavior_GetSelect(f) {
var eva_evaluation_behavior_selectitem = [];
$.each(eva_evaluation_behaviorTableV.rows('.selected').data(), function (key, value) {
eva_evaluation_behavior_selectitem.push(value[f]);
});
alert(eva_evaluation_behavior_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,142 @@
function eva_evaluation_behavior_process_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_evaluation_behavior_process_id_" + i).val("");
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val("");
$("#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("");
}
function eva_evaluation_behavior_process_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_behavior_process_id_" + i).val(data.id);
$("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#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);
}
function eva_evaluation_behavior_process_GetFromForm(obj, i) {
var eva_evaluation_behavior_processObject = new Object();
eva_evaluation_behavior_processObject.id = obj.find("#eva_evaluation_behavior_process_id_" + i).val();
eva_evaluation_behavior_processObject.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process_create_evaluation_detail_id_" + i).val();
eva_evaluation_behavior_processObject.behavior = obj.find("#eva_evaluation_behavior_process_behavior_" + i).text();
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.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior_process").val();
return eva_evaluation_behavior_processObject;
}
function eva_evaluation_behavior_process_Save(id) {
//Insert eva_evaluation_behavior_process List
var eva_evaluation_behavior_process = [];
$('#eva_evaluation_behavior_processBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_evaluation_behavior_process = eva_evaluation_behavior_process_GetFromForm($(this), i);
eva_evaluation_behavior_process.push(eacheva_evaluation_behavior_process);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process/UpdateMultiple', eva_evaluation_behavior_process, successFunc, AlertDanger);
}
function eva_evaluation_behavior_process_Get(a, blankItem) {
$('#eva_evaluation_behavior_processBody').empty();
var successFunc = function (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_behavior_process" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
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 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>';
tag += '</tr>';
$('#eva_evaluation_behavior_processBody').append($(tag));
eva_evaluation_behavior_process_FeedDataToForm(data, (i + 1), blankItem);
});
eva_evaluation_behavior_process_Summary();
Oneva_evaluation_behavior_process_scoreChange();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process?create_evaluation_detail_id="+a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process/GetListByscore/' + a, successFunc, AlertDanger);
}
function Oneva_evaluation_behavior_process_scoreChange(){
var total_behavior = 0;
var total_behavior_weight = 0;
var total_behavior_score = 0;
$('#eva_evaluation_behavior_processBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_behavior_process_score_" + i).val();
var weight = $("#eva_evaluation_behavior_process_weight_" + i).text();
var total = (score * weight / 100).toFixed(2);
$("#eva_evaluation_behavior_process_sumary_" + i).text(total);
total_behavior += parseFloat(total);
total_behavior_weight += parseFloat(weight);
total_behavior_score += parseFloat(score);
});
$("#h_eva_evaluation_behavior_process_weight").text(total_behavior_weight.toFixed(2));
$("#h_eva_evaluation_behavior_process_score").text(total_behavior_score.toFixed(2));
$("#eva_create_evaluation_detail_summary1_total_summary_competency_chief").text(total_behavior.toFixed(2));
$("#eva_create_evaluation_detail_summary1_Final_summary_competency_chief").text(total_behavior_score.toFixed(2));
$("#eva_create_evaluation_detail_summary1_competency_chief").text(total_behavior.toFixed(2));
calculationAllItem();
}
function eva_evaluation_behavior_process_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_evaluation_behavior_process_InitialForm(id) {
var successFunc = function (result) {
eva_evaluation_behavior_process_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,144 @@
function eva_evaluation_behavior_process2_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_evaluation_behavior_process2_id_" + i).val("");
$("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val("");
$("#eva_evaluation_behavior_process2_behavior_" + i).text("");
$("#eva_evaluation_behavior_process2_weight_" + i).text("");
$("#eva_evaluation_behavior_process2_score_" + i).text("");
$("#eva_evaluation_behavior_process2_score2_" + i).val("");
$("#eva_evaluation_behavior_process2_sumary2_" + i).text("");
$("#eva_evaluation_behavior_process2_target_score1_" + i).text("");
$("#eva_evaluation_behavior_process2_target_score2_" + i).text("");
$("#eva_evaluation_behavior_process2_target_score3_" + i).text("");
$("#eva_evaluation_behavior_process2_target_score4_" + i).text("");
$("#eva_evaluation_behavior_process2_target_score5_" + i).text("");
}
function eva_evaluation_behavior_process2_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_behavior_process2_id_" + i).val(data.id);
$("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_behavior_process2_behavior_" + i).text(data.behavior);
$("#eva_evaluation_behavior_process2_weight_" + i).text(data.weight);
$("#eva_evaluation_behavior_process2_score_" + i).text(data.score);
$("#eva_evaluation_behavior_process2_score2_" + i).val(data.score2);
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(data.sumary2);
//$("#eva_evaluation_behavior_process2_target_score1_" + i).text(data.target_score1);
//$("#eva_evaluation_behavior_process2_target_score2_" + i).text(data.target_score2);
//$("#eva_evaluation_behavior_process2_target_score3_" + i).text(data.target_score3);
//$("#eva_evaluation_behavior_process2_target_score4_" + i).text(data.target_score4);
//$("#eva_evaluation_behavior_process2_target_score5_" + i).text(data.target_score5);
}
function eva_evaluation_behavior_process2_GetFromForm(obj, i) {
var eva_evaluation_behavior_process2Object = new Object();
eva_evaluation_behavior_process2Object.id = obj.find("#eva_evaluation_behavior_process2_id_" + i).val();
eva_evaluation_behavior_process2Object.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_process2_create_evaluation_detail_id_" + i).val();
eva_evaluation_behavior_process2Object.behavior = obj.find("#eva_evaluation_behavior_process2_behavior_" + i).text();
eva_evaluation_behavior_process2Object.weight = obj.find("#eva_evaluation_behavior_process2_weight_" + i).text();
eva_evaluation_behavior_process2Object.score = obj.find("#eva_evaluation_behavior_process2_score_" + i).text();
eva_evaluation_behavior_process2Object.score2 = obj.find("#eva_evaluation_behavior_process2_score2_" + i).val();
eva_evaluation_behavior_process2Object.sumary2 = obj.find("#eva_evaluation_behavior_process2_sumary2_" + i).text();
eva_evaluation_behavior_process2Object.target_score1 = obj.find("#eva_evaluation_behavior_process2_target_score1_" + i).text();
eva_evaluation_behavior_process2Object.target_score2 = obj.find("#eva_evaluation_behavior_process2_target_score2_" + i).text();
eva_evaluation_behavior_process2Object.target_score3 = obj.find("#eva_evaluation_behavior_process2_target_score3_" + i).text();
eva_evaluation_behavior_process2Object.target_score4 = obj.find("#eva_evaluation_behavior_process2_target_score4_" + i).text();
eva_evaluation_behavior_process2Object.target_score5 = obj.find("#eva_evaluation_behavior_process2_target_score5_" + i).text();
eva_evaluation_behavior_process2Object.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior_process2").val();
return eva_evaluation_behavior_process2Object;
}
function eva_evaluation_behavior_process2_Save(id) {
//Insert eva_evaluation_behavior_process2 List
var eva_evaluation_behavior_process2 = [];
$('#eva_evaluation_behavior_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_evaluation_behavior_process2 = eva_evaluation_behavior_process2_GetFromForm($(this), i);
eva_evaluation_behavior_process2.push(eacheva_evaluation_behavior_process2);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior_process2/UpdateMultiple', eva_evaluation_behavior_process2, successFunc, AlertDanger);
}
function eva_evaluation_behavior_process2_Get(a, blankItem) {
$('#eva_evaluation_behavior_process2Body').empty();
var successFunc = function (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_behavior_process2" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_id_' + (i + 1)+'" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_process2_create_evaluation_detail_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_behavior_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_weight_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_target_score1_' + (i + 1)+'">จำเป็นต้องพัฒนาอย่างยิ่ง</p></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_target_score2_' + (i + 1)+'">ต้องพัฒนา</p></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_target_score3_' + (i + 1)+'">พอใช้</p></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_target_score4_' + (i + 1)+'">ดี</p></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_target_score5_' + (i + 1)+'">ดีเยี่ยม</p></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_score_' + (i + 1)+'" /></td>';
tag += '<td><input min="0" max="5" step=".01" onchange="Oneva_evaluation_behavior_process2_scoreChange()" class="form-control" type="number" id="eva_evaluation_behavior_process2_score2_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_evaluation_behavior_process2_sumary2_' + (i + 1)+'" /></td>';
tag += '</tr>';
$('#eva_evaluation_behavior_process2Body').append($(tag));
eva_evaluation_behavior_process2_FeedDataToForm(data, (i + 1), blankItem);
});
eva_evaluation_behavior_process2_Summary();
Oneva_evaluation_behavior_process2_scoreChange();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2", successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/eva_evaluation_behavior_process2/GetListBycreate_evaluation_detail_id/' + a, successFunc, AlertDanger);
}
function Oneva_evaluation_behavior_process2_scoreChange(){
var total_behavior = 0;
var total_behavior_weight = 0;
var total_behavior_score = 0;
$('#eva_evaluation_behavior_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_behavior_process2_score2_" + i).val();
var weight = $("#eva_evaluation_behavior_process2_weight_" + i).text();
var total = (score * weight / 100).toFixed(2);
$("#eva_evaluation_behavior_process2_sumary2_" + i).text(total);
total_behavior += parseFloat(total);
total_behavior_weight += parseFloat(weight);
total_behavior_score += parseFloat(score);
});
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(2));
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior_score.toFixed(2));
$("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text(total_behavior.toFixed(2));
$("#eva_create_evaluation_detail_summary2_Final_summary_competency_supervisor").text(total_behavior_score.toFixed(2));
$("#eva_create_evaluation_detail_summary2_competency_supervisor").text(total_behavior.toFixed(2));
calculationAllItem();
}
function eva_evaluation_behavior_process2_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function eva_evaluation_behavior_process2_InitialForm(id) {
var successFunc = function (result) {
eva_evaluation_behavior_process2_Get('', result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior_process2/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,208 @@
var eva_evaluation_group_editMode = "CREATE";
var eva_evaluation_group_API = "/api/eva_evaluation_group/";
//================= Search Customizaiton =========================================
function eva_evaluation_group_GetSearchParameter() {
var eva_evaluation_groupSearchObject = new Object();
eva_evaluation_groupSearchObject.code = $("#s_eva_evaluation_group_code").val();
return eva_evaluation_groupSearchObject;
}
function eva_evaluation_group_FeedDataToSearchForm(data) {
$("#s_eva_evaluation_group_code").val(data.code);
}
//================= Form Data Customizaiton =========================================
function eva_evaluation_group_FeedDataToForm(data) {
$("#eva_evaluation_group_id").val(data.id);
$("#eva_evaluation_group_code").val(data.code);
$("#eva_evaluation_group_thegroup").val(data.thegroup);
}
function eva_evaluation_group_GetFromForm() {
var eva_evaluation_groupObject = new Object();
eva_evaluation_groupObject.id = $("#eva_evaluation_group_id").val();
eva_evaluation_groupObject.code = $("#eva_evaluation_group_code").val();
eva_evaluation_groupObject.thegroup = $("#eva_evaluation_group_thegroup").val();
return eva_evaluation_groupObject;
}
function eva_evaluation_group_InitialForm(s) {
var successFunc = function (result) {
eva_evaluation_group_FeedDataToForm(result);
eva_evaluation_group_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_evaluation_groupModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_group_GoCreate() {
// Incase model popup
eva_evaluation_group_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_evaluation_groupView/eva_evaluation_group_d");
}
function eva_evaluation_group_GoEdit(a) {
// Incase model popup
//eva_evaluation_group_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_evaluation_groupView/eva_evaluation_group_d?id=" + a);
}
function eva_evaluation_group_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_group_editMode = "UPDATE";
eva_evaluation_group_FeedDataToForm(result);
$("#eva_evaluation_groupModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_API + a, successFunc, AlertDanger);
}
function eva_evaluation_group_SetCreateForm(s) {
eva_evaluation_group_editMode = "CREATE";
eva_evaluation_group_InitialForm(s);
}
function eva_evaluation_group_RefreshTable() {
// Incase model popup
eva_evaluation_group_DoSearch();
// Incase open new page
//window.parent.eva_evaluation_group_DoSearch();
}
//================= Update and Delete =========================================
var eva_evaluation_group_customValidation = function (group) {
return "";
};
function eva_evaluation_group_PutUpdate() {
if (!ValidateForm('eva_evaluation_group', eva_evaluation_group_customValidation))
{
return;
}
var data = eva_evaluation_group_GetFromForm();
//Update Mode
if (eva_evaluation_group_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_evaluation_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_group_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_evaluation_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_group_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_group_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_evaluation_groupModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_group_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_evaluation_groupTableV;
var eva_evaluation_group_setupTable = function (result) {
tmp = '"';
eva_evaluation_groupTableV = $('#eva_evaluation_groupTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "code" },
{ "data": "thegroup" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_evaluation_group_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_evaluation_group_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_evaluation_group_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_group/GetListBySearch", eva_evaluation_group_setupTable, AlertDanger);
}
function eva_evaluation_group_DoSearch() {
var p = $.param(eva_evaluation_group_GetSearchParameter());
var eva_evaluation_group_reload = function (result) {
eva_evaluation_groupTableV.destroy();
eva_evaluation_group_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_group/GetListBySearch?"+p, eva_evaluation_group_reload, AlertDanger);
}
function eva_evaluation_group_GetSelect(f) {
var eva_evaluation_group_selectitem = [];
$.each(eva_evaluation_groupTableV.rows('.selected').data(), function (key, value) {
eva_evaluation_group_selectitem.push(value[f]);
});
alert(eva_evaluation_group_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,100 @@
var eva_evaluation_group_editMode = "CREATE";
var eva_evaluation_group_API = "/api/eva_evaluation_group/";
//================= Form Data Customizaiton =========================================
function eva_evaluation_group_FeedDataToForm(data) {
$("#eva_evaluation_group_id").val(data.id);
$("#eva_evaluation_group_code").val(data.code);
$("#eva_evaluation_group_thegroup").val(data.thegroup);
}
function eva_evaluation_group_GetFromForm() {
var eva_evaluation_groupObject = new Object();
eva_evaluation_groupObject.id = $("#eva_evaluation_group_id").val();
eva_evaluation_groupObject.code = $("#eva_evaluation_group_code").val();
eva_evaluation_groupObject.thegroup = $("#eva_evaluation_group_thegroup").val();
return eva_evaluation_groupObject;
}
function eva_evaluation_group_InitialForm() {
var successFunc = function (result) {
eva_evaluation_group_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_group_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_group_editMode = "UPDATE";
eva_evaluation_group_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_API + a, successFunc, AlertDanger);
}
function eva_evaluation_group_SetCreateForm() {
eva_evaluation_group_editMode = "CREATE";
eva_evaluation_group_InitialForm();
}
//================= Update and Delete =========================================
var eva_evaluation_group_customValidation = function (group) {
return "";
};
function eva_evaluation_group_PutUpdate() {
if (!ValidateForm('eva_evaluation_group', eva_evaluation_group_customValidation))
{
return;
}
var data = eva_evaluation_group_GetFromForm();
//Update Mode
if (eva_evaluation_group_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_group_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_group_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_group_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_group_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,227 @@
var eva_evaluation_group_detail_editMode = "CREATE";
var eva_evaluation_group_detail_API = "/api/eva_evaluation_group_detail/";
//================= Search Customizaiton =========================================
function eva_evaluation_group_detail_GetSearchParameter() {
var eva_evaluation_group_detailSearchObject = new Object();
eva_evaluation_group_detailSearchObject.evaluation_group_id = $("#s_eva_evaluation_group_detail_evaluation_group_id").val();
return eva_evaluation_group_detailSearchObject;
}
function eva_evaluation_group_detail_FeedDataToSearchForm(data) {
$("#s_eva_evaluation_group_detail_evaluation_group_id").val(data.evaluation_group_id);
}
//================= Form Data Customizaiton =========================================
function eva_evaluation_group_detail_FeedDataToForm(data) {
$("#eva_evaluation_group_detail_id").val(data.id);
$("#eva_evaluation_group_detail_evaluation_group_id").val(data.evaluation_group_id);
$("#eva_evaluation_group_detail_employee_id").val(data.employee_id);
}
function eva_evaluation_group_detail_GetFromForm() {
var eva_evaluation_group_detailObject = new Object();
eva_evaluation_group_detailObject.id = $("#eva_evaluation_group_detail_id").val();
eva_evaluation_group_detailObject.evaluation_group_id = $("#eva_evaluation_group_detail_evaluation_group_id").val();
eva_evaluation_group_detailObject.employee_id = $("#eva_evaluation_group_detail_employee_id").val();
return eva_evaluation_group_detailObject;
}
function eva_evaluation_group_detail_InitialForm(s) {
var successFunc = function (result) {
eva_evaluation_group_detail_FeedDataToForm(result);
eva_evaluation_group_detail_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_evaluation_group_detailModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_detail_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_group_detail_GoCreate() {
window_open(appsite + "/external_employeeview/external_employee");
// Incase model popup
//eva_evaluation_group_detail_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_evaluation_group_detailView/eva_evaluation_group_detail_d");
}
function eva_evaluation_group_detail_GoEdit(a) {
// Incase model popup
eva_evaluation_group_detail_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_evaluation_group_detailView/eva_evaluation_group_detail_d?id=" + a);
}
function eva_evaluation_group_detail_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_group_detail_editMode = "UPDATE";
eva_evaluation_group_detail_FeedDataToForm(result);
$("#eva_evaluation_group_detailModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_group_detail_API + a, successFunc, AlertDanger);
}
function eva_evaluation_group_detail_SetCreateForm(s) {
eva_evaluation_group_detail_editMode = "CREATE";
eva_evaluation_group_detail_InitialForm(s);
}
function eva_evaluation_group_detail_RefreshTable() {
// Incase model popup
eva_evaluation_group_detail_DoSearch();
// Incase open new page
//window.parent.eva_evaluation_group_detail_DoSearch();
}
//================= Update and Delete =========================================
var eva_evaluation_group_detail_customValidation = function (group) {
return "";
};
function eva_evaluation_group_detail_PutUpdate() {
if (!ValidateForm('eva_evaluation_group_detail', eva_evaluation_group_detail_customValidation))
{
return;
}
var data = eva_evaluation_group_detail_GetFromForm();
//Update Mode
if (eva_evaluation_group_detail_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_evaluation_group_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_group_detail_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_evaluation_group_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_group_detail_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_group_detail_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_evaluation_group_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_evaluation_group_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_group_detail_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_evaluation_group_detailTableV;
var eva_evaluation_group_detail_setupTable = function (result) {
tmp = '"';
eva_evaluation_group_detailTableV = $('#eva_evaluation_group_detailTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "position_number" },
{ "data": "position_name" },
{ "data": "fullname" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_evaluation_group_detail_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_evaluation_group_detail_InitiateDataTable(id) {
startLoad();
$("#s_eva_evaluation_group_detail_evaluation_group_id").val(id);
var p = $.param(eva_evaluation_group_detail_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_evaluation_group_detail/GetListBySearch?"+p, eva_evaluation_group_detail_setupTable, AlertDanger);
}
function eva_evaluation_group_detail_DoSearch() {
var p = $.param(eva_evaluation_group_detail_GetSearchParameter());
var eva_evaluation_group_detail_reload = function (result) {
eva_evaluation_group_detailTableV.destroy();
eva_evaluation_group_detail_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_group_detail/GetListBySearch?"+p, eva_evaluation_group_detail_reload, AlertDanger);
}
function eva_evaluation_group_detail_GetSelect(f) {
var eva_evaluation_group_detail_selectitem = [];
$.each(eva_evaluation_group_detailTableV.rows('.selected').data(), function (key, value) {
eva_evaluation_group_detail_selectitem.push(value[f]);
});
alert(eva_evaluation_group_detail_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================
function AddMultiple(data) {
var successFunc1 = function (result) {
AlertSuccess(result.code + " " + result.message);
eva_evaluation_group_detail_RefreshTable();
endLoad();
};
startLoad();
var id = getUrlParameter("id");
AjaxPostRequest(apisite + eva_evaluation_group_detail_API + "AddMultiple?evaluation_group_id=" + id, data, successFunc1, AlertDanger);
}

View File

@@ -0,0 +1,214 @@
var eva_level_score_editMode = "CREATE";
var eva_level_score_API = "/api/eva_level_score/";
//================= Search Customizaiton =========================================
function eva_level_score_GetSearchParameter() {
var eva_level_scoreSearchObject = new Object();
eva_level_scoreSearchObject.code = $("#s_eva_level_score_code").val();
return eva_level_scoreSearchObject;
}
function eva_level_score_FeedDataToSearchForm(data) {
$("#s_eva_level_score_code").val(data.code);
}
//================= Form Data Customizaiton =========================================
function eva_level_score_FeedDataToForm(data) {
$("#eva_level_score_id").val(data.id);
$("#eva_level_score_code").val(data.code);
$("#eva_level_score_detail").val(data.detail);
$("#eva_level_score_max_score").val(data.max_score);
$("#eva_level_score_min_score").val(data.min_score);
}
function eva_level_score_GetFromForm() {
var eva_level_scoreObject = new Object();
eva_level_scoreObject.id = $("#eva_level_score_id").val();
eva_level_scoreObject.code = $("#eva_level_score_code").val();
eva_level_scoreObject.detail = $("#eva_level_score_detail").val();
eva_level_scoreObject.max_score = $("#eva_level_score_max_score").val();
eva_level_scoreObject.min_score = $("#eva_level_score_min_score").val();
return eva_level_scoreObject;
}
function eva_level_score_InitialForm(s) {
var successFunc = function (result) {
eva_level_score_FeedDataToForm(result);
eva_level_score_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_level_scoreModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_level_score_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_level_score_GoCreate() {
// Incase model popup
eva_level_score_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_level_scoreView/eva_level_score_d");
}
function eva_level_score_GoEdit(a) {
// Incase model popup
//eva_level_score_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_level_scoreView/eva_level_score_d?id=" + a);
}
function eva_level_score_SetEditForm(a) {
var successFunc = function (result) {
eva_level_score_editMode = "UPDATE";
eva_level_score_FeedDataToForm(result);
$("#eva_level_scoreModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_level_score_API + a, successFunc, AlertDanger);
}
function eva_level_score_SetCreateForm(s) {
eva_level_score_editMode = "CREATE";
eva_level_score_InitialForm(s);
}
function eva_level_score_RefreshTable() {
// Incase model popup
eva_level_score_DoSearch();
// Incase open new page
//window.parent.eva_level_score_DoSearch();
}
//================= Update and Delete =========================================
var eva_level_score_customValidation = function (group) {
return "";
};
function eva_level_score_PutUpdate() {
if (!ValidateForm('eva_level_score', eva_level_score_customValidation))
{
return;
}
var data = eva_level_score_GetFromForm();
//Update Mode
if (eva_level_score_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_level_scoreModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_level_score_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_level_score_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_level_scoreModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_level_score_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_level_score_API, data, successFunc2, AlertDanger);
}
}
function eva_level_score_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_level_scoreModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_level_score_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_level_score_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_level_scoreTableV;
var eva_level_score_setupTable = function (result) {
tmp = '"';
eva_level_scoreTableV = $('#eva_level_scoreTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "code" },
{ "data": "detail" },
{ "data": "max_score" },
{ "data": "min_score" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_level_score_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_level_score_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_level_score_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_level_score/GetListBySearch", eva_level_score_setupTable, AlertDanger);
}
function eva_level_score_DoSearch() {
var p = $.param(eva_level_score_GetSearchParameter());
var eva_level_score_reload = function (result) {
eva_level_scoreTableV.destroy();
eva_level_score_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_level_score/GetListBySearch?"+p, eva_level_score_reload, AlertDanger);
}
function eva_level_score_GetSelect(f) {
var eva_level_score_selectitem = [];
$.each(eva_level_scoreTableV.rows('.selected').data(), function (key, value) {
eva_level_score_selectitem.push(value[f]);
});
alert(eva_level_score_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,104 @@
var eva_level_score_editMode = "CREATE";
var eva_level_score_API = "/api/eva_level_score/";
//================= Form Data Customizaiton =========================================
function eva_level_score_FeedDataToForm(data) {
$("#eva_level_score_id").val(data.id);
$("#eva_level_score_code").val(data.code);
$("#eva_level_score_detail").val(data.detail);
$("#eva_level_score_max_score").val(data.max_score);
$("#eva_level_score_min_score").val(data.min_score);
}
function eva_level_score_GetFromForm() {
var eva_level_scoreObject = new Object();
eva_level_scoreObject.id = $("#eva_level_score_id").val();
eva_level_scoreObject.code = $("#eva_level_score_code").val();
eva_level_scoreObject.detail = $("#eva_level_score_detail").val();
eva_level_scoreObject.max_score = $("#eva_level_score_max_score").val();
eva_level_scoreObject.min_score = $("#eva_level_score_min_score").val();
return eva_level_scoreObject;
}
function eva_level_score_InitialForm() {
var successFunc = function (result) {
eva_level_score_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_level_score_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_level_score_SetEditForm(a) {
var successFunc = function (result) {
eva_level_score_editMode = "UPDATE";
eva_level_score_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_level_score_API + a, successFunc, AlertDanger);
}
function eva_level_score_SetCreateForm() {
eva_level_score_editMode = "CREATE";
eva_level_score_InitialForm();
}
//================= Update and Delete =========================================
var eva_level_score_customValidation = function (group) {
return "";
};
function eva_level_score_PutUpdate() {
if (!ValidateForm('eva_level_score', eva_level_score_customValidation))
{
return;
}
var data = eva_level_score_GetFromForm();
//Update Mode
if (eva_level_score_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_level_score_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_level_score_API, data, successFunc2, AlertDanger);
}
}
function eva_level_score_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_level_score_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_level_score_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,210 @@
var eva_performance_plan_editMode = "CREATE";
var eva_performance_plan_API = "/api/eva_performance_plan/";
//================= Search Customizaiton =========================================
function eva_performance_plan_GetSearchParameter() {
var eva_performance_planSearchObject = new Object();
eva_performance_planSearchObject.fiscal_year = $("#s_eva_performance_plan_fiscal_year").val();
eva_performance_planSearchObject.theTime = $("#s_eva_performance_plan_theTime").val();
return eva_performance_planSearchObject;
}
function eva_performance_plan_FeedDataToSearchForm(data) {
$("#s_eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#s_eva_performance_plan_theTime").val(data.theTime);
}
//================= Form Data Customizaiton =========================================
function eva_performance_plan_FeedDataToForm(data) {
$("#eva_performance_plan_id").val(data.id);
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#eva_performance_plan_theTime").val(data.theTime);
}
function eva_performance_plan_GetFromForm() {
var eva_performance_planObject = new Object();
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
return eva_performance_planObject;
}
function eva_performance_plan_InitialForm(s) {
var successFunc = function (result) {
eva_performance_plan_FeedDataToForm(result);
eva_performance_plan_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_performance_planModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_performance_plan_GoCreate() {
// Incase model popup
eva_performance_plan_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_performance_planView/eva_performance_plan_d");
}
function eva_performance_plan_GoEdit(a) {
// Incase model popup
//eva_performance_plan_SetEditForm(a);
// Incase open new page
window_open(appsite + "/eva_performance_planView/eva_performance_plan_d?id=" + a);
}
function eva_performance_plan_SetEditForm(a) {
var successFunc = function (result) {
eva_performance_plan_editMode = "UPDATE";
eva_performance_plan_FeedDataToForm(result);
$("#eva_performance_planModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_API + a, successFunc, AlertDanger);
}
function eva_performance_plan_SetCreateForm(s) {
eva_performance_plan_editMode = "CREATE";
eva_performance_plan_InitialForm(s);
}
function eva_performance_plan_RefreshTable() {
// Incase model popup
eva_performance_plan_DoSearch();
// Incase open new page
//window.parent.eva_performance_plan_DoSearch();
}
//================= Update and Delete =========================================
var eva_performance_plan_customValidation = function (group) {
return "";
};
function eva_performance_plan_PutUpdate() {
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation))
{
return;
}
var data = eva_performance_plan_GetFromForm();
//Update Mode
if (eva_performance_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_performance_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_performance_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_performance_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_performance_plan_API, data, successFunc2, AlertDanger);
}
}
function eva_performance_plan_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_performance_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_performance_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_performance_planTableV;
var eva_performance_plan_setupTable = function (result) {
tmp = '"';
eva_performance_planTableV = $('#eva_performance_planTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "fiscal_year" },
{ "data": "theTime" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_performance_plan_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_performance_plan_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_performance_plan_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_performance_plan/GetListBySearch", eva_performance_plan_setupTable, AlertDanger);
}
function eva_performance_plan_DoSearch() {
var p = $.param(eva_performance_plan_GetSearchParameter());
var eva_performance_plan_reload = function (result) {
eva_performance_planTableV.destroy();
eva_performance_plan_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_performance_plan/GetListBySearch?"+p, eva_performance_plan_reload, AlertDanger);
}
function eva_performance_plan_GetSelect(f) {
var eva_performance_plan_selectitem = [];
$.each(eva_performance_planTableV.rows('.selected').data(), function (key, value) {
eva_performance_plan_selectitem.push(value[f]);
});
alert(eva_performance_plan_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,100 @@
var eva_performance_plan_editMode = "CREATE";
var eva_performance_plan_API = "/api/eva_performance_plan/";
//================= Form Data Customizaiton =========================================
function eva_performance_plan_FeedDataToForm(data) {
$("#eva_performance_plan_id").val(data.id);
$("#eva_performance_plan_fiscal_year").val(data.fiscal_year);
$("#eva_performance_plan_theTime").val(data.theTime);
}
function eva_performance_plan_GetFromForm() {
var eva_performance_planObject = new Object();
eva_performance_planObject.id = $("#eva_performance_plan_id").val();
eva_performance_planObject.fiscal_year = $("#eva_performance_plan_fiscal_year").val();
eva_performance_planObject.theTime = $("#eva_performance_plan_theTime").val();
return eva_performance_planObject;
}
function eva_performance_plan_InitialForm() {
var successFunc = function (result) {
eva_performance_plan_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_performance_plan_SetEditForm(a) {
var successFunc = function (result) {
eva_performance_plan_editMode = "UPDATE";
eva_performance_plan_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_API + a, successFunc, AlertDanger);
}
function eva_performance_plan_SetCreateForm() {
eva_performance_plan_editMode = "CREATE";
eva_performance_plan_InitialForm();
}
//================= Update and Delete =========================================
var eva_performance_plan_customValidation = function (group) {
return "";
};
function eva_performance_plan_PutUpdate() {
if (!ValidateForm('eva_performance_plan', eva_performance_plan_customValidation))
{
return;
}
var data = eva_performance_plan_GetFromForm();
//Update Mode
if (eva_performance_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_performance_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_performance_plan_API, data, successFunc2, AlertDanger);
}
}
function eva_performance_plan_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_performance_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,220 @@
var eva_performance_plan_detail_editMode = "CREATE";
var eva_performance_plan_detail_API = "/api/eva_performance_plan_detail/";
//================= Search Customizaiton =========================================
function eva_performance_plan_detail_GetSearchParameter() {
var eva_performance_plan_detailSearchObject = new Object();
eva_performance_plan_detailSearchObject.performance_plan_id = getUrlParameter("id"); // id of performance_plan_id
return eva_performance_plan_detailSearchObject;
}
function eva_performance_plan_detail_FeedDataToSearchForm(data) {
$("#s_eva_performance_plan_detail_performance_plan_id").val(data.performance_plan_id);
}
//================= Form Data Customizaiton =========================================
function eva_performance_plan_detail_FeedDataToForm(data) {
$("#eva_performance_plan_detail_id").val(data.id);
$("#eva_performance_plan_detail_performance_plan_id").val(data.performance_plan_id);
$("#eva_performance_plan_detail_list_no").val(data.list_no);
$("#eva_performance_plan_detail_step").val(data.step);
$("#eva_performance_plan_detail_start_date").val(formatDate(data.start_date));
$("#eva_performance_plan_detail_end_date").val(formatDate(data.end_date));
$("#eva_performance_plan_detail_remark").val(data.remark);
}
function eva_performance_plan_detail_GetFromForm() {
var eva_performance_plan_detailObject = new Object();
eva_performance_plan_detailObject.id = $("#eva_performance_plan_detail_id").val();
eva_performance_plan_detailObject.performance_plan_id = $("#eva_performance_plan_id").val(); //$("#eva_performance_plan_detail_performance_plan_id").val();
eva_performance_plan_detailObject.list_no = $("#eva_performance_plan_detail_list_no").val();
eva_performance_plan_detailObject.step = $("#eva_performance_plan_detail_step").val();
eva_performance_plan_detailObject.start_date = getDate($("#eva_performance_plan_detail_start_date").val());
eva_performance_plan_detailObject.end_date = getDate($("#eva_performance_plan_detail_end_date").val());
eva_performance_plan_detailObject.remark = $("#eva_performance_plan_detail_remark").val();
return eva_performance_plan_detailObject;
}
function eva_performance_plan_detail_InitialForm(s) {
var successFunc = function (result) {
eva_performance_plan_detail_FeedDataToForm(result);
eva_performance_plan_detail_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_performance_plan_detailModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_detail_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_performance_plan_detail_GoCreate() {
// Incase model popup
eva_performance_plan_detail_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_performance_plan_detailView/eva_performance_plan_detail_d");
}
function eva_performance_plan_detail_GoEdit(a) {
// Incase model popup
eva_performance_plan_detail_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_performance_plan_detailView/eva_performance_plan_detail_d?id=" + a);
}
function eva_performance_plan_detail_SetEditForm(a) {
var successFunc = function (result) {
eva_performance_plan_detail_editMode = "UPDATE";
eva_performance_plan_detail_FeedDataToForm(result);
$("#eva_performance_plan_detailModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_performance_plan_detail_API + a, successFunc, AlertDanger);
}
function eva_performance_plan_detail_SetCreateForm(s) {
eva_performance_plan_detail_editMode = "CREATE";
eva_performance_plan_detail_InitialForm(s);
}
function eva_performance_plan_detail_RefreshTable() {
// Incase model popup
eva_performance_plan_detail_DoSearch();
// Incase open new page
//window.parent.eva_performance_plan_detail_DoSearch();
}
//================= Update and Delete =========================================
var eva_performance_plan_detail_customValidation = function (group) {
return "";
};
function eva_performance_plan_detail_PutUpdate() {
if (!ValidateForm('eva_performance_plan_detail', eva_performance_plan_detail_customValidation))
{
return;
}
var data = eva_performance_plan_detail_GetFromForm();
//Update Mode
if (eva_performance_plan_detail_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_performance_plan_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_performance_plan_detail_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_performance_plan_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_performance_plan_detail_API, data, successFunc2, AlertDanger);
}
}
function eva_performance_plan_detail_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_performance_plan_detailModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_performance_plan_detail_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_performance_plan_detail_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_performance_plan_detailTableV;
var eva_performance_plan_detail_setupTable = function (result) {
tmp = '"';
eva_performance_plan_detailTableV = $('#eva_performance_plan_detailTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "list_no" },
{ "data": "step" },
{ "data": "txt_start_date" },
{ "data": "txt_end_date" },
{ "data": "remark" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_performance_plan_detail_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_performance_plan_detail_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_performance_plan_detail_InitiateDataTable(id) {
startLoad();
var p = $.param(eva_performance_plan_detail_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_performance_plan_detail/GetListBySearch?"+p, eva_performance_plan_detail_setupTable, AlertDanger);
}
function eva_performance_plan_detail_DoSearch() {
var p = $.param(eva_performance_plan_detail_GetSearchParameter());
var eva_performance_plan_detail_reload = function (result) {
eva_performance_plan_detailTableV.destroy();
eva_performance_plan_detail_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_performance_plan_detail/GetListBySearch?"+p, eva_performance_plan_detail_reload, AlertDanger);
}
function eva_performance_plan_detail_GetSelect(f) {
var eva_performance_plan_detail_selectitem = [];
$.each(eva_performance_plan_detailTableV.rows('.selected').data(), function (key, value) {
eva_performance_plan_detail_selectitem.push(value[f]);
});
alert(eva_performance_plan_detail_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,221 @@
var eva_promoted_percentage_editMode = "CREATE";
var eva_promoted_percentage_API = "/api/eva_promoted_percentage/";
//================= Search Customizaiton =========================================
function eva_promoted_percentage_GetSearchParameter() {
var eva_promoted_percentageSearchObject = new Object();
eva_promoted_percentageSearchObject.level_score_id = getUrlParameter("id"); //$("#s_eva_promoted_percentage_level_score_id").val();
return eva_promoted_percentageSearchObject;
}
function eva_promoted_percentage_FeedDataToSearchForm(data) {
$("#s_eva_promoted_percentage_level_score_id").val(data.level_score_id);
}
//================= Form Data Customizaiton =========================================
function eva_promoted_percentage_FeedDataToForm(data) {
$("#eva_promoted_percentage_id").val(data.id);
$("#eva_promoted_percentage_level_score_id").val(data.level_score_id);
$("#eva_promoted_percentage_code").val(data.code);
$("#eva_promoted_percentage_detail").val(data.detail);
$("#eva_promoted_percentage_promoted_percentage").val(data.promoted_percentage);
$("#eva_promoted_percentage_max_score").val(data.max_score);
$("#eva_promoted_percentage_min_score").val(data.min_score);
}
function eva_promoted_percentage_GetFromForm() {
var eva_promoted_percentageObject = new Object();
eva_promoted_percentageObject.id = $("#eva_promoted_percentage_id").val();
eva_promoted_percentageObject.level_score_id = getUrlParameter("id"); //$("#eva_promoted_percentage_level_score_id").val();
eva_promoted_percentageObject.code = $("#eva_promoted_percentage_code").val();
eva_promoted_percentageObject.detail = $("#eva_promoted_percentage_detail").val();
eva_promoted_percentageObject.promoted_percentage = $("#eva_promoted_percentage_promoted_percentage").val();
eva_promoted_percentageObject.max_score = $("#eva_promoted_percentage_max_score").val();
eva_promoted_percentageObject.min_score = $("#eva_promoted_percentage_min_score").val();
return eva_promoted_percentageObject;
}
function eva_promoted_percentage_InitialForm(s) {
var successFunc = function (result) {
eva_promoted_percentage_FeedDataToForm(result);
eva_promoted_percentage_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_promoted_percentageModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_promoted_percentage_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_promoted_percentage_GoCreate() {
// Incase model popup
eva_promoted_percentage_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_promoted_percentageView/eva_promoted_percentage_d");
}
function eva_promoted_percentage_GoEdit(a) {
// Incase model popup
eva_promoted_percentage_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_promoted_percentageView/eva_promoted_percentage_d?id=" + a);
}
function eva_promoted_percentage_SetEditForm(a) {
var successFunc = function (result) {
eva_promoted_percentage_editMode = "UPDATE";
eva_promoted_percentage_FeedDataToForm(result);
$("#eva_promoted_percentageModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_promoted_percentage_API + a, successFunc, AlertDanger);
}
function eva_promoted_percentage_SetCreateForm(s) {
eva_promoted_percentage_editMode = "CREATE";
eva_promoted_percentage_InitialForm(s);
}
function eva_promoted_percentage_RefreshTable() {
// Incase model popup
eva_promoted_percentage_DoSearch();
// Incase open new page
//window.parent.eva_promoted_percentage_DoSearch();
}
//================= Update and Delete =========================================
var eva_promoted_percentage_customValidation = function (group) {
return "";
};
function eva_promoted_percentage_PutUpdate() {
if (!ValidateForm('eva_promoted_percentage', eva_promoted_percentage_customValidation))
{
return;
}
var data = eva_promoted_percentage_GetFromForm();
//Update Mode
if (eva_promoted_percentage_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_promoted_percentageModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_promoted_percentage_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_promoted_percentage_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_promoted_percentageModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_promoted_percentage_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_promoted_percentage_API, data, successFunc2, AlertDanger);
}
}
function eva_promoted_percentage_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_promoted_percentageModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_promoted_percentage_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_promoted_percentage_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_promoted_percentageTableV;
var eva_promoted_percentage_setupTable = function (result) {
tmp = '"';
eva_promoted_percentageTableV = $('#eva_promoted_percentageTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "code" },
{ "data": "detail" },
{ "data": "promoted_percentage" },
{ "data": "max_score" },
{ "data": "min_score" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_promoted_percentage_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_promoted_percentage_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_promoted_percentage_InitiateDataTable(id) {
startLoad();
$("#eva_promoted_percentage_level_score_id").val(id);
var p = $.param(eva_promoted_percentage_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_promoted_percentage/GetListBySearch?"+p, eva_promoted_percentage_setupTable, AlertDanger);
}
function eva_promoted_percentage_DoSearch() {
var p = $.param(eva_promoted_percentage_GetSearchParameter());
var eva_promoted_percentage_reload = function (result) {
eva_promoted_percentageTableV.destroy();
eva_promoted_percentage_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_promoted_percentage/GetListBySearch?"+p, eva_promoted_percentage_reload, AlertDanger);
}
function eva_promoted_percentage_GetSelect(f) {
var eva_promoted_percentage_selectitem = [];
$.each(eva_promoted_percentageTableV.rows('.selected').data(), function (key, value) {
eva_promoted_percentage_selectitem.push(value[f]);
});
alert(eva_promoted_percentage_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,224 @@
var eva_salary_cylinder_editMode = "CREATE";
var eva_salary_cylinder_API = "/api/eva_salary_cylinder/";
//================= Search Customizaiton =========================================
function eva_salary_cylinder_GetSearchParameter() {
var eva_salary_cylinderSearchObject = new Object();
eva_salary_cylinderSearchObject.position_type = $("#s_eva_salary_cylinder_position_type").val();
return eva_salary_cylinderSearchObject;
}
function eva_salary_cylinder_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
}
//================= Form Data Customizaiton =========================================
function eva_salary_cylinder_FeedDataToForm(data) {
$("#eva_salary_cylinder_id").val(data.id);
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_type"), data, "id", "external_name", "item_position_type", data.position_type);
DropDownClearFormAndFeedWithData($("#eva_salary_cylinder_position_level"), data, "id", "external_name", "item_position_level", data.position_level);
$("#eva_salary_cylinder_temporary_min").val(data.temporary_min);
$("#eva_salary_cylinder_themin").val(data.themin);
$("#eva_salary_cylinder_themax").val(data.themax);
$("#eva_salary_cylinder_middle").val(data.middle);
$("#eva_salary_cylinder_cost_living").val(data.cost_living );
}
function eva_salary_cylinder_GetFromForm() {
var eva_salary_cylinderObject = new Object();
eva_salary_cylinderObject.id = $("#eva_salary_cylinder_id").val();
eva_salary_cylinderObject.position_type = $("#eva_salary_cylinder_position_type").val();
eva_salary_cylinderObject.position_level = $("#eva_salary_cylinder_position_level").val();
eva_salary_cylinderObject.temporary_min = $("#eva_salary_cylinder_temporary_min").val();
eva_salary_cylinderObject.themin = $("#eva_salary_cylinder_themin").val();
eva_salary_cylinderObject.themax = $("#eva_salary_cylinder_themax").val();
eva_salary_cylinderObject.middle = $("#eva_salary_cylinder_middle").val();
eva_salary_cylinderObject.cost_living = $("#eva_salary_cylinder_cost_living").val();
return eva_salary_cylinderObject;
}
function eva_salary_cylinder_InitialForm(s) {
var successFunc = function (result) {
eva_salary_cylinder_FeedDataToForm(result);
eva_salary_cylinder_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_salary_cylinderModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_salary_cylinder_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_salary_cylinder_GoCreate() {
// Incase model popup
eva_salary_cylinder_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_salary_cylinderView/eva_salary_cylinder_d");
}
function eva_salary_cylinder_GoEdit(a) {
// Incase model popup
eva_salary_cylinder_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_salary_cylinderView/eva_salary_cylinder_d?id=" + a);
}
function eva_salary_cylinder_SetEditForm(a) {
var successFunc = function (result) {
eva_salary_cylinder_editMode = "UPDATE";
eva_salary_cylinder_FeedDataToForm(result);
$("#eva_salary_cylinderModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_salary_cylinder_API + a, successFunc, AlertDanger);
}
function eva_salary_cylinder_SetCreateForm(s) {
eva_salary_cylinder_editMode = "CREATE";
eva_salary_cylinder_InitialForm(s);
}
function eva_salary_cylinder_RefreshTable() {
// Incase model popup
eva_salary_cylinder_DoSearch();
// Incase open new page
//window.parent.eva_salary_cylinder_DoSearch();
}
//================= Update and Delete =========================================
var eva_salary_cylinder_customValidation = function (group) {
return "";
};
function eva_salary_cylinder_PutUpdate() {
if (!ValidateForm('eva_salary_cylinder', eva_salary_cylinder_customValidation))
{
return;
}
var data = eva_salary_cylinder_GetFromForm();
//Update Mode
if (eva_salary_cylinder_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_salary_cylinderModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_salary_cylinder_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_salary_cylinder_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_salary_cylinderModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_salary_cylinder_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_salary_cylinder_API, data, successFunc2, AlertDanger);
}
}
function eva_salary_cylinder_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_salary_cylinderModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_salary_cylinder_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_salary_cylinder_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_salary_cylinderTableV;
var eva_salary_cylinder_setupTable = function (result) {
console.log(result);
tmp = '"';
eva_salary_cylinderTableV = $('#eva_salary_cylinderTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "position_type_external_linkage_external_name" },
{ "data": "position_level_external_linkage_external_name" },
{ "data": "temporary_min" },
{ "data": "themin" },
{ "data": "themax" },
{ "data": "middle" },
{ "data": "cost_living" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_salary_cylinder_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_salary_cylinder_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function eva_salary_cylinder_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch", eva_salary_cylinder_setupTable, AlertDanger);
}
function eva_salary_cylinder_DoSearch() {
var p = $.param(eva_salary_cylinder_GetSearchParameter());
var eva_salary_cylinder_reload = function (result) {
eva_salary_cylinderTableV.destroy();
eva_salary_cylinder_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_salary_cylinder/GetListBySearch?"+p, eva_salary_cylinder_reload, AlertDanger);
}
function eva_salary_cylinder_GetSelect(f) {
var eva_salary_cylinder_selectitem = [];
$.each(eva_salary_cylinderTableV.rows('.selected').data(), function (key, value) {
eva_salary_cylinder_selectitem.push(value[f]);
});
alert(eva_salary_cylinder_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,210 @@
var external_employee_editMode = "CREATE";
var external_employee_API = "/api/external_employee/";
//================= Form Data Customizaiton =========================================
function external_employee_FeedDataToForm(data) {
$("#external_employee_id").val(data.id);
$("#external_employee_position_number").val(data.position_number);
$("#external_employee_position_name").val(data.position_name);
$("#external_employee_fullname").val(data.fullname);
$("#external_employee_employee_type").val(data.employee_type);
$("#external_employee_position_type").val(data.position_type);
}
function external_employee_GetFromForm() {
var external_employeeObject = new Object();
external_employeeObject.id = $("#external_employee_id").val();
external_employeeObject.position_number = $("#external_employee_position_number").val();
external_employeeObject.position_name = $("#external_employee_position_name").val();
external_employeeObject.fullname = $("#external_employee_fullname").val();
external_employeeObject.employee_type = $("#external_employee_employee_type").val();
external_employeeObject.position_type = $("#external_employee_position_type").val();
return external_employeeObject;
}
function external_employee_InitialForm(s) {
var successFunc = function (result) {
external_employee_FeedDataToForm(result);
if (s) {
// Incase model popup
$("#external_employeeModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function external_employee_GoCreate() {
// Incase model popup
external_employee_SetCreateForm(true);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d");
}
function external_employee_GoEdit(a) {
// Incase model popup
external_employee_SetEditForm(a);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d?id=" + a);
}
function external_employee_SetEditForm(a) {
var successFunc = function (result) {
external_employee_editMode = "UPDATE";
external_employee_FeedDataToForm(result);
$("#external_employeeModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + a, successFunc, AlertDanger);
}
function external_employee_SetCreateForm(s) {
external_employee_editMode = "CREATE";
external_employee_InitialForm(s);
}
function external_employee_RefreshTable() {
// Incase model popup
external_employee_DoSearch();
// Incase open new page
//window.parent.external_employee_DoSearch();
}
function external_employee_AfterInsert(id) {
}
function external_employee_AfterUpdate(id) {
}
function external_employee_AfterDelete(id) {
}
//================= Update and Delete =========================================
function external_employee_PutUpdate() {
var data = external_employee_GetFromForm();
//Update Mode
if (external_employee_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
external_employee_RefreshTable();
external_employee_AfterUpdate(result.id);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + external_employee_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
external_employee_RefreshTable();
external_employee_AfterInsert(result.id);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + external_employee_API, data, successFunc2, AlertDanger);
}
}
function external_employee_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
external_employee_RefreshTable();
external_employee_AfterDelete(a);
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + external_employee_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var external_employeeTableV;
var external_employee_setupTable = function (result) {
tmp = '"';
external_employeeTableV = $('#external_employeeTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": {
"style": 'multi'
},
"columns": [
{ "data": "" },
{ "data": "position_number" },
{ "data": "position_name" },
{ "data": "fullname" }
],
"columnDefs": [
{
targets: 0,
data: "",
defaultContent: '',
orderable: false,
className: 'select-checkbox'
}],
"language": {
"url": appsite+"/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function external_employee_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/external_employee", external_employee_setupTable, AlertDanger);
}
function external_employee_DoSearch() {
var s = $("#external_employee_search_box").val();
var external_employee_reload = function (result) {
external_employeeTableV.destroy();
external_employee_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/external_employee?employee_type="+s, external_employee_reload, AlertDanger);
}
function external_employee_GetSelect(f) {
var external_employee_selectitem = [];
$.each(external_employeeTableV.rows('.selected').data(), function (key, value) {
external_employee_selectitem.push(value[f]);
});
//alert(external_employee_selectitem);
window_close();
window.parent.AddMultiple(external_employee_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,219 @@
var external_employee_editMode = "CREATE";
var external_employee_API = "/api/external_employee/";
//================= Form Data Customizaiton =========================================
function DropDownClearFormAndFeedWithDataexternal_employee(d, result, x, y, z, i) {
var employee_type_id = getUrlParameter("employee_type_id");
$(d).html('');
$(d).append($("<option></option>")
.attr("value", "")
.text("กรุณาเลือก"));
$.each(result[z], function (key, value) {
if (employee_type_id.toString() === value["employee_type_id"].toString()) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
}
});
$(d).val(i);
}
function external_employee_FeedDataToSearchForm(data) {
//console.log(data);
DropDownClearFormAndFeedWithDataexternal_employee($("#eva_performance_criteria_id"), data, "id", "document_name", "eva_performance_criteria_id", "");
}
function external_employee_FeedDataToForm(data) {
$("#external_employee_id").val(data.id);
$("#external_employee_position_number").val(data.position_number);
$("#external_employee_position_name").val(data.position_name);
$("#external_employee_fullname").val(data.fullname);
$("#external_employee_employee_type").val(data.employee_type);
$("#external_employee_position_type").val(data.position_type);
}
function external_employee_GetFromForm() {
var external_employeeObject = new Object();
external_employeeObject.id = $("#external_employee_id").val();
external_employeeObject.position_number = $("#external_employee_position_number").val();
external_employeeObject.position_name = $("#external_employee_position_name").val();
external_employeeObject.fullname = $("#external_employee_fullname").val();
external_employeeObject.employee_type = $("#external_employee_employee_type").val();
external_employeeObject.position_type = $("#external_employee_position_type").val();
return external_employeeObject;
}
function external_employee_InitialForm(s) {
var successFunc = function (result) {
external_employee_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function external_employee_GoCreate() {
// Incase model popup
external_employee_SetCreateForm(true);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d");
}
function external_employee_GoEdit(a) {
// Incase model popup
external_employee_SetEditForm(a);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d?id=" + a);
}
function external_employee_SetEditForm(a) {
var successFunc = function (result) {
external_employee_editMode = "UPDATE";
external_employee_FeedDataToForm(result);
$("#external_employeeModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + a, successFunc, AlertDanger);
}
function external_employee_SetCreateForm(s) {
external_employee_editMode = "CREATE";
external_employee_InitialForm(s);
}
function external_employee_RefreshTable() {
// Incase model popup
external_employee_DoSearch();
// Incase open new page
//window.parent.external_employee_DoSearch();
}
//================= Update and Delete =========================================
function external_employee_PutUpdate() {
var data = external_employee_GetFromForm();
//Update Mode
if (external_employee_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + external_employee_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + external_employee_API, data, successFunc2, AlertDanger);
}
}
function external_employee_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + external_employee_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var external_employeeTableV;
var external_employee_setupTable = function (result) {
tmp = '"';
external_employeeTableV = $('#external_employeeTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": {
"style": 'multi'
},
"columns": [
{ "data": "" },
{ "data": "position_number" },
{ "data": "position_name" },
{ "data": "fullname" }
],
"columnDefs": [
{
targets: 0,
data: "",
defaultContent: '',
orderable: false,
className: 'select-checkbox'
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": true
});
endLoad();
};
function external_employee_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/external_employee", external_employee_setupTable, AlertDanger);
}
function external_employee_DoSearch() {
var s = $("#external_employee_search_box").val();
var external_employee_reload = function (result) {
external_employeeTableV.destroy();
external_employee_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/external_employee?employee_type=" + s, external_employee_reload, AlertDanger);
}
function external_employee_GetSelect(f) {
if ($("#eva_performance_criteria_id").val() === "") {
alert("กรุณาเลือก เกณฑ์การประเมิน");
} else {
var external_employee_selectitem = [];
$.each(external_employeeTableV.rows('.selected').data(), function (key, value) {
external_employee_selectitem.push(value[f]);
});
window.parent.AddMultiple(external_employee_selectitem, $("#eva_performance_criteria_id").val());
window_close();
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,199 @@
var external_employee_editMode = "CREATE";
var external_employee_API = "/api/external_employee/";
//================= Form Data Customizaiton =========================================
function external_employee_FeedDataToForm(data) {
$("#external_employee_id").val(data.id);
$("#external_employee_position_number").val(data.position_number);
$("#external_employee_position_name").val(data.position_name);
$("#external_employee_fullname").val(data.fullname);
$("#external_employee_employee_type").val(data.employee_type);
$("#external_employee_position_type").val(data.position_type);
}
function external_employee_GetFromForm() {
var external_employeeObject = new Object();
external_employeeObject.id = $("#external_employee_id").val();
external_employeeObject.position_number = $("#external_employee_position_number").val();
external_employeeObject.position_name = $("#external_employee_position_name").val();
external_employeeObject.fullname = $("#external_employee_fullname").val();
external_employeeObject.employee_type = $("#external_employee_employee_type").val();
external_employeeObject.position_type = $("#external_employee_position_type").val();
return external_employeeObject;
}
function external_employee_InitialForm(s) {
var successFunc = function (result) {
external_employee_FeedDataToForm(result);
if (s) {
// Incase model popup
$("#external_employeeModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function external_employee_GoCreate() {
// Incase model popup
external_employee_SetCreateForm(true);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d");
}
function external_employee_GoEdit(a) {
// Incase model popup
//external_employee_SetEditForm(a);
// Incase open new page
//window_open(appsite+"/external_employeeView/external_employee_d?id=" + a);
window.location = "/eva/home/dotestlogin?user_id="+a;
}
function external_employee_SetEditForm(a) {
var successFunc = function (result) {
external_employee_editMode = "UPDATE";
external_employee_FeedDataToForm(result);
$("#external_employeeModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + external_employee_API + a, successFunc, AlertDanger);
}
function external_employee_SetCreateForm(s) {
external_employee_editMode = "CREATE";
external_employee_InitialForm(s);
}
function external_employee_RefreshTable() {
// Incase model popup
external_employee_DoSearch();
// Incase open new page
//window.parent.external_employee_DoSearch();
}
//================= Update and Delete =========================================
function external_employee_PutUpdate() {
var data = external_employee_GetFromForm();
//Update Mode
if (external_employee_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + external_employee_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + external_employee_API, data, successFunc2, AlertDanger);
}
}
function external_employee_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#external_employeeModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
external_employee_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + external_employee_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var external_employeeTableV;
var external_employee_setupTable = function (result) {
console.log(result);
tmp = '"';
external_employeeTableV = $('#external_employeeTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "user_id" },
{ "data": "position_number" },
{ "data": "position_name" },
{ "data": "fullname" },
{ "data": "user_id" },
{ "data": "user_email" }
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:external_employee_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i> Login</button> ";
}
}
],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": true
});
endLoad();
};
function external_employee_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/external_employee", external_employee_setupTable, AlertDanger);
}
function external_employee_DoSearch() {
var s = $("#external_employee_search_box").val();
var external_employee_reload = function (result) {
external_employeeTableV.destroy();
external_employee_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/external_employee?employee_type=" + s, external_employee_reload, AlertDanger);
}
function external_employee_GetSelect(f) {
var external_employee_selectitem = [];
$.each(external_employeeTableV.rows('.selected').data(), function (key, value) {
external_employee_selectitem.push(value[f]);
});
//alert(external_employee_selectitem);
window_close();
window.parent.AddMultiple(external_employee_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,60 @@
var rep_eva01_API = "/api/rep_eva01/";
//================= Search Customizaiton =========================================
function rep_eva01_GetSearchParameter(fileType) {
var rep_eva01SearchObject = new Object();
rep_eva01SearchObject.org_id = $("#s_rep_eva01_org_id").val();
rep_eva01SearchObject.round_id = $("#s_rep_eva01_round_id").val();
rep_eva01SearchObject.fileType = fileType;
console.log(rep_eva01SearchObject);
return rep_eva01SearchObject;
}
function rep_eva01_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
}
//================= Form Data Customizaiton =========================================
function rep_eva01_InitialForm(s) {
var successFunc = function (result) {
rep_eva01_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva01_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_eva01_customValidation = function (group) {
return "";
};
function rep_eva01_DoSearch(fileType) {
if (!ValidateForm('s_rep_eva01', s_rep_eva01_customValidation)) {
return;
}
var p = $.param(rep_eva01_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_eva01/rep_eva01_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,60 @@
var rep_eva02_API = "/api/rep_eva02/";
//================= Search Customizaiton =========================================
function rep_eva02_GetSearchParameter(fileType) {
var rep_eva02SearchObject = new Object();
rep_eva02SearchObject.org_id = $("#s_rep_eva02_org_id").val();
rep_eva02SearchObject.round_id = $("#s_rep_eva02_round_id").val();
rep_eva02SearchObject.fileType = fileType;
console.log(rep_eva02SearchObject);
return rep_eva02SearchObject;
}
function rep_eva02_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva02_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva02_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
}
//================= Form Data Customizaiton =========================================
function rep_eva02_InitialForm(s) {
var successFunc = function (result) {
rep_eva02_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva02_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_eva02_customValidation = function (group) {
return "";
};
function rep_eva02_DoSearch(fileType) {
if (!ValidateForm('s_rep_eva02', s_rep_eva02_customValidation)) {
return;
}
var p = $.param(rep_eva02_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_eva02/rep_eva02_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,216 @@
var rep_eva03_editMode = "CREATE";
var rep_eva03_API = "/api/rep_eva03/";
//================= Search Customizaiton =========================================
function rep_eva03_GetSearchParameter() {
var rep_eva03SearchObject = new Object();
rep_eva03SearchObject.position_type_id = $("#s_rep_eva03_position_type_id").val();
return rep_eva03SearchObject;
}
function rep_eva03_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
}
//================= Form Data Customizaiton =========================================
function rep_eva03_FeedDataToForm(data) {
$("#rep_eva03_id").val(data.id);
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
}
function rep_eva03_GetFromForm() {
var rep_eva03Object = new Object();
rep_eva03Object.id = $("#rep_eva03_id").val();
rep_eva03Object.position_type_id = $("#rep_eva03_position_type_id").val();
return rep_eva03Object;
}
function rep_eva03_InitialForm(s) {
var successFunc = function (result) {
rep_eva03_FeedDataToForm(result);
rep_eva03_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#rep_eva03Model").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva03_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function rep_eva03_GoCreate() {
// Incase model popup
rep_eva03_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/rep_eva03View/rep_eva03_d");
}
function rep_eva03_GoEdit(a) {
// Incase model popup
rep_eva03_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/rep_eva03View/rep_eva03_d?id=" + a);
}
function rep_eva03_SetEditForm(a) {
var successFunc = function (result) {
rep_eva03_editMode = "UPDATE";
rep_eva03_FeedDataToForm(result);
$("#rep_eva03Model").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva03_API + a, successFunc, AlertDanger);
}
function rep_eva03_SetCreateForm(s) {
rep_eva03_editMode = "CREATE";
rep_eva03_InitialForm(s);
}
function rep_eva03_RefreshTable() {
// Incase model popup
rep_eva03_DoSearch();
// Incase open new page
//window.parent.rep_eva03_DoSearch();
}
//================= Update and Delete =========================================
var rep_eva03_customValidation = function (group) {
return "";
};
function rep_eva03_PutUpdate() {
if (!ValidateForm('rep_eva03', rep_eva03_customValidation))
{
return;
}
var data = rep_eva03_GetFromForm();
//Update Mode
if (rep_eva03_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#rep_eva03Model").modal("hide");
AlertSuccess(result.code+" "+result.message);
rep_eva03_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + rep_eva03_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#rep_eva03Model").modal("hide");
AlertSuccess(result.code+" "+result.message);
rep_eva03_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + rep_eva03_API, data, successFunc2, AlertDanger);
}
}
function rep_eva03_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#rep_eva03Model").modal("hide");
AlertSuccess(result.code+" "+result.message);
rep_eva03_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + rep_eva03_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var rep_eva03TableV;
var rep_eva03_setupTable = function (result) {
tmp = '"';
rep_eva03TableV = $('#rep_eva03Table').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": {
"style": 'multi'
},
"columns": [
{ "data": "" },
{ "data": "id" },
{ "data": "id" },
{ "data": "position_type_id_external_linkage_external_name" },
],
"columnDefs": [
{
"targets": 1,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:rep_eva03_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:rep_eva03_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
},
{
targets: 0,
data: "",
defaultContent: '',
orderable: false,
className: 'select-checkbox'
}],
"language": {
"url": appsite + "/DataTables-1.10.16/thai.json"
},
"paging": true,
"searching": false
});
endLoad();
};
function rep_eva03_InitiateDataTable() {
startLoad();
AjaxGetRequest(apisite + "/api/rep_eva03/GetListBySearch", rep_eva03_setupTable, AlertDanger);
}
function rep_eva03_DoSearch() {
var p = $.param(rep_eva03_GetSearchParameter());
var rep_eva03_reload = function (result) {
rep_eva03TableV.destroy();
rep_eva03_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/rep_eva03/GetListBySearch?"+p, rep_eva03_reload, AlertDanger);
}
function rep_eva03_GetSelect(f) {
var rep_eva03_selectitem = [];
$.each(rep_eva03TableV.rows('.selected').data(), function (key, value) {
rep_eva03_selectitem.push(value[f]);
});
alert(rep_eva03_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,98 @@
var rep_eva03_editMode = "CREATE";
var rep_eva03_API = "/api/rep_eva03/";
//================= Form Data Customizaiton =========================================
function rep_eva03_FeedDataToForm(data) {
$("#rep_eva03_id").val(data.id);
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
}
function rep_eva03_GetFromForm() {
var rep_eva03Object = new Object();
rep_eva03Object.id = $("#rep_eva03_id").val();
rep_eva03Object.position_type_id = $("#rep_eva03_position_type_id").val();
return rep_eva03Object;
}
function rep_eva03_InitialForm() {
var successFunc = function (result) {
rep_eva03_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva03_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function rep_eva03_SetEditForm(a) {
var successFunc = function (result) {
rep_eva03_editMode = "UPDATE";
rep_eva03_FeedDataToForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva03_API + a, successFunc, AlertDanger);
}
function rep_eva03_SetCreateForm() {
rep_eva03_editMode = "CREATE";
rep_eva03_InitialForm();
}
//================= Update and Delete =========================================
var rep_eva03_customValidation = function (group) {
return "";
};
function rep_eva03_PutUpdate() {
if (!ValidateForm('rep_eva03', rep_eva03_customValidation))
{
return;
}
var data = rep_eva03_GetFromForm();
//Update Mode
if (rep_eva03_editMode === "UPDATE") {
var successFunc1 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPutRequest(apisite + rep_eva03_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
AlertSuccess(result.code+" "+result.message);
endLoad();
};
startLoad();
AjaxPostRequest(apisite + rep_eva03_API, data, successFunc2, AlertDanger);
}
}
function rep_eva03_GoDelete(a) {
if (confirm('คุณต้องการลบ ' + a + ' ใช่หรือไม่?')) {
var successFunc = function (result) {
AlertSuccess(result.code+" "+result.message);
rep_eva03_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + rep_eva03_API + a, null, successFunc, AlertDanger);
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -0,0 +1,124 @@
function rep_eva03_ClearForm(i, blankItem) {
var data = blankItem;
$("#rep_eva03_id_" + i).val("");
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id_" + i), blankItem, "id", "external_name", "item_position_type_id", data.position_type_id);
}
function rep_eva03_FeedDataToForm(data, i, blankItem) {
$("#rep_eva03_id_" + i).val(data.id);
DropDownClearFormAndFeedWithData($("#rep_eva03_position_type_id_" + i), blankItem, "id", "external_name", "item_position_type_id", data.position_type_id);
}
function rep_eva03_GetFromForm(obj, i) {
var rep_eva03Object = new Object();
rep_eva03Object.id = obj.find("#rep_eva03_id_" + i).val();
rep_eva03Object.position_type_id = obj.find("#rep_eva03_position_type_id_" + i).val();
rep_eva03Object.active_mode = obj.find("#isActive_" + i + "_rep_eva03").val();
return rep_eva03Object;
}
function rep_eva03_Save(id) {
//Insert rep_eva03 List
var rep_eva03 = [];
$('#rep_eva03Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var eachrep_eva03 = rep_eva03_GetFromForm($(this), i);
rep_eva03.push(eachrep_eva03);
});
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/rep_eva03/UpdateMultiple', rep_eva03, successFunc, AlertDanger);
}
function rep_eva03_Get(a, blankItem) {
$('#rep_eva03Body').empty();
var successFunc = function (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) + '_rep_eva03" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="rep_eva03_id_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="rep_eva03_position_type_id_' + (i + 1) +'"></select></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_eva03_Removerep_eva03(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:rep_eva03_Restorerep_eva03(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#rep_eva03Body').append($(tag));
rep_eva03_FeedDataToForm(data, (i + 1), blankItem);
});
rep_eva03_Summary();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/rep_eva03", successFunc, AlertDanger);
//AjaxGetRequest(apisite + '/api/rep_eva03/GetListByposition_type_id/' + a, successFunc, AlertDanger);
}
function rep_eva03_Add() {
var successFunc = function (result) {
var i = $("#rep_eva03Body tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_rep_eva03" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="rep_eva03_id_' + (i + 1)+'" /></td>';
tag += '<td><select class="form-control" id="rep_eva03_position_type_id_' + (i + 1) +'"></select></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:rep_eva03_Removerep_eva03(this)" id="removeBtn"><i class="fa fa-trash-o" style="color:white;"></i></a><a href="javascript:;" class="btn btn-primary btn-sm" onclick="javascript:rep_eva03_Restorerep_eva03(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#rep_eva03Body').append($(tag));
rep_eva03_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/rep_eva03/" + "GetBlankItem", successFunc, AlertDanger);
}
function rep_eva03_Removerep_eva03(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
rep_eva03_Summary();
}
}
function rep_eva03_Restorerep_eva03(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
rep_eva03_Summary();
}
}
function rep_eva03_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
}
function rep_eva03_InitialForm(id) {
var successFunc = function (result) {
rep_eva03_Get('', result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/rep_eva03/" + "GetBlankItem", successFunc, AlertDanger);
}

View File

@@ -0,0 +1,58 @@
var rep_eva03_API = "/api/rep_eva03/";
//================= Search Customizaiton =========================================
function rep_eva03_GetSearchParameter(fileType) {
var rep_eva03SearchObject = new Object();
rep_eva03SearchObject.position_type_id = $("#s_rep_eva03_position_type_id").val();
rep_eva03SearchObject.fileType = fileType;
console.log(rep_eva03SearchObject);
return rep_eva03SearchObject;
}
function rep_eva03_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva03_position_type_id"), data, "id", "external_name", "item_position_type_id", data.position_type_id);
}
//================= Form Data Customizaiton =========================================
function rep_eva03_InitialForm(s) {
var successFunc = function (result) {
rep_eva03_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_eva03_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_eva03_customValidation = function (group) {
return "";
};
function rep_eva03_DoSearch(fileType) {
if (!ValidateForm('s_rep_eva03', s_rep_eva03_customValidation)) {
return;
}
var p = $.param(rep_eva03_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_eva03/rep_eva03_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,64 @@
var rep_family_API = "/api/rep_family/";
//================= Search Customizaiton =========================================
function rep_family_GetSearchParameter(fileType) {
var rep_familySearchObject = new Object();
rep_familySearchObject.employee_id = $("#s_rep_family_employee_id").val();
rep_familySearchObject.position_id = $("#s_rep_family_position_id").val();
rep_familySearchObject.org_id = $("#s_rep_family_org_id").val();
rep_familySearchObject.relation_id = $("#s_rep_family_relation_id").val();
rep_familySearchObject.fileType = fileType;
console.log(rep_familySearchObject);
return rep_familySearchObject;
}
function rep_family_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_family_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_family_position_id"), data, "id", "external_name", "item_position_id", data.position_id);
DropDownClearFormAndFeedWithData($("#s_rep_family_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_family_relation_id"), data, "id", "external_name", "item_relation_id", data.relation_id);
}
//================= Form Data Customizaiton =========================================
function rep_family_InitialForm(s) {
var successFunc = function (result) {
rep_family_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_family_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_family_customValidation = function (group) {
return "";
};
function rep_family_DoSearch(fileType) {
if (!ValidateForm('s_rep_family', s_rep_family_customValidation)) {
return;
}
var p = $.param(rep_family_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_family/rep_family_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,62 @@
var rep_leave_summary_API = "/api/rep_leave_summary/";
//================= Search Customizaiton =========================================
function rep_leave_summary_GetSearchParameter(fileType) {
var rep_leave_summarySearchObject = new Object();
rep_leave_summarySearchObject.fiscal_year = $("#s_rep_leave_summary_fiscal_year").val();
rep_leave_summarySearchObject.org_id = $("#s_rep_leave_summary_org_id").val();
rep_leave_summarySearchObject.employee_id = $("#s_rep_leave_summary_employee_id").val();
rep_leave_summarySearchObject.fileType = fileType;
console.log(rep_leave_summarySearchObject);
return rep_leave_summarySearchObject;
}
function rep_leave_summary_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_fiscal_year"), data, "id", "external_name", "item_fiscal_year", data.fiscal_year);
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_leave_summary_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
}
//================= Form Data Customizaiton =========================================
function rep_leave_summary_InitialForm(s) {
var successFunc = function (result) {
rep_leave_summary_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_leave_summary_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_leave_summary_customValidation = function (group) {
return "";
};
function rep_leave_summary_DoSearch(fileType) {
if (!ValidateForm('s_rep_leave_summary', s_rep_leave_summary_customValidation)) {
return;
}
var p = $.param(rep_leave_summary_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_leave_summary/rep_leave_summary_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,64 @@
var rep_leave_total_API = "/api/rep_leave_total/";
//================= Search Customizaiton =========================================
function rep_leave_total_GetSearchParameter(fileType) {
var rep_leave_totalSearchObject = new Object();
rep_leave_totalSearchObject.employee_id = $("#s_rep_leave_total_employee_id").val();
rep_leave_totalSearchObject.org_id = $("#s_rep_leave_total_org_id").val();
rep_leave_totalSearchObject.start_date = formatDateForGetParameter(getDate($("#s_rep_leave_total_start_date").val()));
rep_leave_totalSearchObject.end_date = formatDateForGetParameter(getDate($("#s_rep_leave_total_end_date").val()));
rep_leave_totalSearchObject.fileType = fileType;
console.log(rep_leave_totalSearchObject);
return rep_leave_totalSearchObject;
}
function rep_leave_total_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_leave_total_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_leave_total_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_rep_leave_total_start_date").val(formatDate(data.start_date));
$("#s_rep_leave_total_end_date").val(formatDate(data.end_date));
}
//================= Form Data Customizaiton =========================================
function rep_leave_total_InitialForm(s) {
var successFunc = function (result) {
rep_leave_total_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_leave_total_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_leave_total_customValidation = function (group) {
return "";
};
function rep_leave_total_DoSearch(fileType) {
if (!ValidateForm('s_rep_leave_total', s_rep_leave_total_customValidation)) {
return;
}
var p = $.param(rep_leave_total_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_leave_total/rep_leave_total_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,62 @@
var rep_position_salary_API = "/api/rep_position_salary/";
//================= Search Customizaiton =========================================
function rep_position_salary_GetSearchParameter(fileType) {
var rep_position_salarySearchObject = new Object();
rep_position_salarySearchObject.employee_id = $("#s_rep_position_salary_employee_id").val();
rep_position_salarySearchObject.position_id = $("#s_rep_position_salary_position_id").val();
rep_position_salarySearchObject.org_id = $("#s_rep_position_salary_org_id").val();
rep_position_salarySearchObject.fileType = fileType;
console.log(rep_position_salarySearchObject);
return rep_position_salarySearchObject;
}
function rep_position_salary_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_position_salary_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_position_salary_position_id"), data, "id", "external_name", "item_position_id", data.position_id);
DropDownClearFormAndFeedWithData($("#s_rep_position_salary_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
}
//================= Form Data Customizaiton =========================================
function rep_position_salary_InitialForm(s) {
var successFunc = function (result) {
rep_position_salary_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_position_salary_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_position_salary_customValidation = function (group) {
return "";
};
function rep_position_salary_DoSearch(fileType) {
if (!ValidateForm('s_rep_position_salary', s_rep_position_salary_customValidation)) {
return;
}
var p = $.param(rep_position_salary_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_position_salary/rep_position_salary_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,64 @@
var rep_samana_API = "/api/rep_samana/";
//================= Search Customizaiton =========================================
function rep_samana_GetSearchParameter(fileType) {
var rep_samanaSearchObject = new Object();
rep_samanaSearchObject.employee_id = $("#s_rep_samana_employee_id").val();
rep_samanaSearchObject.org_id = $("#s_rep_samana_org_id").val();
rep_samanaSearchObject.date_from = formatDateForGetParameter(getDate($("#s_rep_samana_date_from").val()));
rep_samanaSearchObject.date_to = formatDateForGetParameter(getDate($("#s_rep_samana_date_to").val()));
rep_samanaSearchObject.fileType = fileType;
console.log(rep_samanaSearchObject);
return rep_samanaSearchObject;
}
function rep_samana_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_samana_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_samana_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_rep_samana_date_from").val(formatDate(data.date_from));
$("#s_rep_samana_date_to").val(formatDate(data.date_to));
}
//================= Form Data Customizaiton =========================================
function rep_samana_InitialForm(s) {
var successFunc = function (result) {
rep_samana_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_samana_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_samana_customValidation = function (group) {
return "";
};
function rep_samana_DoSearch(fileType) {
if (!ValidateForm('s_rep_samana', s_rep_samana_customValidation)) {
return;
}
var p = $.param(rep_samana_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_samana/rep_samana_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,64 @@
var rep_study_history_API = "/api/rep_study_history/";
//================= Search Customizaiton =========================================
function rep_study_history_GetSearchParameter(fileType) {
var rep_study_historySearchObject = new Object();
rep_study_historySearchObject.employee_id = $("#s_rep_study_history_employee_id").val();
rep_study_historySearchObject.org_id = $("#s_rep_study_history_org_id").val();
rep_study_historySearchObject.position_id = $("#s_rep_study_history_position_id").val();
rep_study_historySearchObject.study_level_id = $("#s_rep_study_history_study_level_id").val();
rep_study_historySearchObject.fileType = fileType;
console.log(rep_study_historySearchObject);
return rep_study_historySearchObject;
}
function rep_study_history_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_study_history_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_study_history_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_study_history_position_id"), data, "id", "external_name", "item_position_id", data.position_id);
DropDownClearFormAndFeedWithData($("#s_rep_study_history_study_level_id"), data, "id", "external_name", "item_study_level_id", data.study_level_id);
}
//================= Form Data Customizaiton =========================================
function rep_study_history_InitialForm(s) {
var successFunc = function (result) {
rep_study_history_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_study_history_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_study_history_customValidation = function (group) {
return "";
};
function rep_study_history_DoSearch(fileType) {
if (!ValidateForm('s_rep_study_history', s_rep_study_history_customValidation)) {
return;
}
var p = $.param(rep_study_history_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_study_history/rep_study_history_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}

View File

@@ -0,0 +1,64 @@
var rep_working_type_API = "/api/rep_working_type/";
//================= Search Customizaiton =========================================
function rep_working_type_GetSearchParameter(fileType) {
var rep_working_typeSearchObject = new Object();
rep_working_typeSearchObject.employee_id = $("#s_rep_working_type_employee_id").val();
rep_working_typeSearchObject.org_id = $("#s_rep_working_type_org_id").val();
rep_working_typeSearchObject.start_date = formatDateForGetParameter(getDate($("#s_rep_working_type_start_date").val()));
rep_working_typeSearchObject.end_date = formatDateForGetParameter(getDate($("#s_rep_working_type_end_date").val()));
rep_working_typeSearchObject.fileType = fileType;
console.log(rep_working_typeSearchObject);
return rep_working_typeSearchObject;
}
function rep_working_type_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_working_type_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#s_rep_working_type_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
$("#s_rep_working_type_start_date").val(formatDate(data.start_date));
$("#s_rep_working_type_end_date").val(formatDate(data.end_date));
}
//================= Form Data Customizaiton =========================================
function rep_working_type_InitialForm(s) {
var successFunc = function (result) {
rep_working_type_FeedDataToSearchForm(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + rep_working_type_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Data Table =========================================
var s_rep_working_type_customValidation = function (group) {
return "";
};
function rep_working_type_DoSearch(fileType) {
if (!ValidateForm('s_rep_working_type', s_rep_working_type_customValidation)) {
return;
}
var p = $.param(rep_working_type_GetSearchParameter(fileType));
var report_url = apisite + "/api/rep_working_type/rep_working_type_report?" + p;
if (fileType === "pdf") {
$("#report_result").attr("src", report_url);
$("#report_result").show();
//window.open(report_url);
} else {
$("#report_result").hide();
window.open(report_url);
}
}