First Initial
This commit is contained in:
@@ -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 =========================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user