นำเข้าหน้าจอ เพิ่ม แก้ไข ลบ แบบข้อตกลง

This commit is contained in:
Nakorn Rientrakrunchai
2021-02-02 15:59:55 +07:00
parent 95277cedea
commit 91c6ecd5a1
20 changed files with 2298 additions and 7 deletions

View File

@@ -0,0 +1,403 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Logging;
using TTSW.Controllers;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
using System.Data;
using Microsoft.Extensions.Configuration;
using System.IO;
using System.Net;
namespace TodoAPI2.Controllers
{
//[Authorize]
[Produces("application/json")]
[Route("api/eva_evaluation_operating_agreement")]
public class eva_evaluation_operating_agreementController : BaseController
{
#region Private Variables
private ILogger<eva_evaluation_operating_agreementController> _logger;
private Ieva_evaluation_operating_agreementService _repository;
private IConfiguration Configuration { get; set; }
#endregion
#region Properties
#endregion
/// <summary>
/// Default constructure for dependency injection
/// </summary>
/// <param name="repository"></param>
/// <param name="configuration"></param>
/// <param name="logger"></param>
public eva_evaluation_operating_agreementController(ILogger<eva_evaluation_operating_agreementController> logger, Ieva_evaluation_operating_agreementService repository, IConfiguration configuration)
{
_logger = logger;
_repository = repository;
Configuration = configuration;
}
/// <summary>
/// Get specific item by id
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return Get specific item by id</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("{id}")]
[ProducesResponseType(typeof(eva_evaluation_operating_agreementWithSelectionViewModel), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult Get(int id)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.GetWithSelection(id);
return Ok(result);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult Get.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get Blank Item
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return a blank item</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("GetBlankItem")]
[ProducesResponseType(typeof(eva_evaluation_operating_agreementWithSelectionViewModel), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetBlankItem()
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.GetBlankItem();
return Ok(result);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get list items by create_evaluation_detail_id
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("")]
[ProducesResponseType(typeof(List<eva_evaluation_operating_agreementViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetList(int? create_evaluation_detail_id)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
return Ok(_repository.GetListBycreate_evaluation_detail_id(create_evaluation_detail_id));
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Get list items by search
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("GetListBySearch")]
[ProducesResponseType(typeof(List<eva_evaluation_operating_agreementViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetListBySearch(eva_evaluation_operating_agreementSearchModel model)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
return Ok(_repository.GetListBySearch(model));
}
catch (Exception ex)
{
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Download Report
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Return list of items by specifced keyword</returns>
/// <response code="200">Returns the item</response>
/// <response code="500">Error Occurred</response>
[HttpGet("eva_evaluation_operating_agreement_report")]
[ProducesResponseType(typeof(FileStreamResult), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult eva_evaluation_operating_agreement_report(eva_evaluation_operating_agreementReportRequestModel model)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var httpclient = new WebClient();
string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL");
string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite");
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
string url = $"{mainurl}{reportsite}/xxใส่ชื่อรายงานตรงนี้xx.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
if (model.filetype == "xlsx")
{
url += "&ignorePagination=true";
}
var data = httpclient.DownloadData(url);
var stream = new MemoryStream(data);
return File(stream, model.contentType);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while GetReport.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
/// <summary>
/// Create new item
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="model"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPost("")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult Insert([FromBody] eva_evaluation_operating_agreementInputModel model)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.Insert(model);
var message = new CommonResponseMessage();
message.code = "200";
message.message = $"เพิ่มข้อมูล เรียบร้อย";
message.data = result;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while insert.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary>
/// Update item
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="id"></param>
/// <param name="model"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPut("{id}")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult Update(int id, [FromBody] eva_evaluation_operating_agreementInputModel model)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
var result = _repository.Update(id, model);
var message = new CommonResponseMessage();
message.code = "200";
message.message = $"แก้ไขข้อมูล เรียบร้อย";
message.data = result;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary>
/// Delete item
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="id"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpDelete("{id}")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult Delete(int id)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
_repository.Delete(id);
var message = new CommonResponseMessage();
message.code = "200";
message.message = $"ลบข้อมูล เรียบร้อย";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while delete {id.ToString()}.", ex);
return StatusCode(500, $"{id.ToString()}. {ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary>
/// Update multiple item
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="model"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPut("UpdateMultiple")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult UpdateMultiple([FromBody] List<eva_evaluation_operating_agreementInputModel> model)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
string rowCount = _repository.UpdateMultiple(model, true);
var message = new CommonResponseMessage();
message.code = "200";
message.message = "ปรับปรุงข้อมูลเรียบร้อย จำนวน "+rowCount+" รายการ";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while UpdateMultiple.", ex);
return StatusCode(500, $"{ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary>
/// Refresh AutoField of all items
/// </summary>
/// <remarks>
/// </remarks>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPut("RefreshAutoField")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult RefreshAutoField()
{
if (ModelState.IsValid)
{
try
{
//if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
_repository.RefreshAutoFieldOfAllData();
var message = new CommonResponseMessage();
message.code = "200";
message.message = $"ปรับปรุง Auto Field ของทุก record เรียบร้อย";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while RefreshAutoField.", ex);
return StatusCode(500, $"มีปัญหาระหว่างการปรับปรุง Auto Field. {ex.Message}");
}
}
return BadRequest(ModelState);
}
}
}

View File

@@ -37,6 +37,8 @@ namespace TTSW.EF {
public DbSet<eva_adjust_postponement_detailEntity> eva_adjust_postponement_detail { get; set; }
//public DbSet<eva_adjust_postponement_detail_normalEntity> eva_adjust_postponement_detail_normal { get; set; }
public DbSet<eva_evaluation_operating_agreementEntity> eva_evaluation_operating_agreement { get; set; }
public DbSet<eva_idp_planEntity> eva_idp_plan { get; set; }
protected override void OnModelCreating (ModelBuilder modelBuilder) {

Binary file not shown.

View File

@@ -0,0 +1,754 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TTSW.EF;
namespace tb320eva.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("25640202082506_AddOperatingAgreement")]
partial class AddOperatingAgreement
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
{
b.Property<int>("id");
b.Property<string>("command_no")
.HasMaxLength(4000);
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<DateTime?>("imported_date");
b.Property<string>("imported_file")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("limit");
b.Property<decimal?>("limit_frame");
b.Property<decimal?>("limit_frame_quota");
b.Property<decimal?>("limit_quota");
b.Property<int?>("managed_by");
b.Property<decimal?>("percentage");
b.Property<string>("report_type")
.HasMaxLength(1000);
b.Property<DateTime?>("theDate");
b.Property<int?>("theRound");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_id");
b.ToTable("eva_adjust_postponement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("adjust_postponement_id");
b.Property<int?>("adjust_postponement_quota_id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("middle");
b.Property<string>("migration_eva_result")
.HasMaxLength(1000);
b.Property<decimal?>("migration_total_score");
b.Property<decimal?>("new_cost_living");
b.Property<decimal?>("new_sarary");
b.Property<decimal?>("new_sarary_with_quota");
b.Property<int?>("order_at_this_time");
b.Property<int?>("org_at_this_time");
b.Property<decimal?>("other_money_at_this_time");
b.Property<decimal?>("position_allowance_at_this_time");
b.Property<string>("position_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("promoted_percentage");
b.Property<decimal?>("receive_quota");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<decimal?>("sarary");
b.Property<decimal?>("total_promote");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("adjust_postponement_id");
b.HasIndex("adjust_postponement_quota_id");
b.ToTable("eva_adjust_postponement_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
{
b.Property<int>("id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<Guid?>("performance_plan_id");
b.Property<decimal?>("score1");
b.Property<decimal?>("score2");
b.Property<int?>("supervisor1_id");
b.Property<int?>("supervisor2_id");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("evaluation_group_id");
b.HasIndex("performance_plan_id");
b.ToTable("eva_create_evaluation");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
{
b.Property<int>("id");
b.Property<decimal?>("Final_summary_chief");
b.Property<decimal?>("Final_summary_competency_chief");
b.Property<decimal?>("Final_summary_competency_supervisor");
b.Property<decimal?>("Final_summary_competency_supervisor1A");
b.Property<decimal?>("Final_summary_competency_supervisor2A");
b.Property<decimal?>("Final_summary_supervisor");
b.Property<decimal?>("Final_summary_supervisor1A");
b.Property<decimal?>("Final_summary_supervisor2A");
b.Property<decimal?>("achievement_chief");
b.Property<decimal?>("achievement_supervisor");
b.Property<decimal?>("achievement_supervisor1A");
b.Property<decimal?>("achievement_supervisor2A");
b.Property<int?>("chief");
b.Property<decimal?>("competency_chief");
b.Property<decimal?>("competency_supervisor");
b.Property<decimal?>("competency_supervisor1A");
b.Property<decimal?>("competency_supervisor2A");
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_score_chief")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor1A")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor2A")
.HasMaxLength(255);
b.Property<decimal?>("score_chief");
b.Property<decimal?>("score_supervisor");
b.Property<decimal?>("score_supervisor1A");
b.Property<decimal?>("score_supervisor2A");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<DateTime?>("status_chief_click_date");
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<DateTime?>("status_self_click_date");
b.Property<string>("status_supervisor")
.HasMaxLength(1);
b.Property<string>("status_supervisor1A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor1A_click_date");
b.Property<string>("status_supervisor2A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor2A_click_date");
b.Property<DateTime?>("status_supervisor_click_date");
b.Property<int?>("supervisor1");
b.Property<int?>("supervisor1A");
b.Property<DateTime?>("supervisor1A_date");
b.Property<string>("supervisor1A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor1_date");
b.Property<string>("supervisor1_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1_result")
.HasMaxLength(1);
b.Property<int?>("supervisor2");
b.Property<int?>("supervisor2A");
b.Property<DateTime?>("supervisor2A_date");
b.Property<string>("supervisor2A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor2_date");
b.Property<string>("supervisor2_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2_result")
.HasMaxLength(1);
b.Property<decimal?>("total_summary_chief");
b.Property<decimal?>("total_summary_competency_chief");
b.Property<decimal?>("total_summary_competency_supervisor");
b.Property<decimal?>("total_summary_competency_supervisor1A");
b.Property<decimal?>("total_summary_competency_supervisor2A");
b.Property<decimal?>("total_summary_supervisor");
b.Property<decimal?>("total_summary_supervisor1A");
b.Property<decimal?>("total_summary_supervisor2A");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_create_evaluation_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.Property<int>("id");
b.Property<string>("achievement")
.HasMaxLength(1000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<string>("thefile")
.HasMaxLength(1000);
b.Property<DateTime>("updated");
b.Property<decimal?>("weight");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_achievement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
{
b.Property<int>("id");
b.Property<string>("behavior")
.HasMaxLength(1000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.Property<decimal?>("weight");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_behavior");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<string>("thegroup")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_evaluation_group");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("evaluation_group_id");
b.ToTable("eva_evaluation_group_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("indicators")
.HasMaxLength(4000);
b.Property<bool>("isActive");
b.Property<string>("mission_detail")
.HasMaxLength(4000);
b.Property<int?>("mission_no");
b.Property<string>("target")
.HasMaxLength(4000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_operating_agreement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("develop")
.HasMaxLength(1000);
b.Property<string>("development_method")
.HasMaxLength(1000);
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<string>("period_text")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_idp_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_level_score");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<bool>("isActive");
b.Property<int?>("theTime");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_performance_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<int?>("list_no");
b.Property<Guid?>("performance_plan_id");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<string>("step")
.HasMaxLength(1000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("performance_plan_id");
b.ToTable("eva_performance_plan_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<Guid?>("level_score_id");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<decimal?>("promoted_percentage");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("level_score_id");
b.ToTable("eva_promoted_percentage");
});
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
{
b.Property<int>("id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("middle");
b.Property<int?>("position_level");
b.Property<int?>("position_type");
b.Property<decimal?>("temporary_min");
b.Property<decimal?>("themax");
b.Property<decimal?>("themin");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_salary_cylinder");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
.WithMany()
.HasForeignKey("create_evaluation_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
.WithMany()
.HasForeignKey("adjust_postponement_id");
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
.WithMany()
.HasForeignKey("adjust_postponement_quota_id")
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
.WithMany()
.HasForeignKey("level_score_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class AddOperatingAgreement : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "eva_evaluation_operating_agreement",
columns: table => new
{
id = table.Column<int>(nullable: false),
created = table.Column<DateTime>(nullable: false),
updated = table.Column<DateTime>(nullable: false),
isActive = table.Column<bool>(nullable: false),
create_evaluation_detail_id = table.Column<int>(nullable: true),
mission_no = table.Column<int>(nullable: true),
mission_detail = table.Column<string>(maxLength: 4000, nullable: true),
target = table.Column<string>(maxLength: 4000, nullable: true),
indicators = table.Column<string>(maxLength: 4000, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_eva_evaluation_operating_agreement", x => x.id);
table.ForeignKey(
name: "FK_eva_evaluation_operating_agreement_eva_create_evaluation_de~",
column: x => x.create_evaluation_detail_id,
principalTable: "eva_create_evaluation_detail",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_eva_evaluation_operating_agreement_create_evaluation_detail~",
table: "eva_evaluation_operating_agreement",
column: "create_evaluation_detail_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "eva_evaluation_operating_agreement");
}
}
}

View File

@@ -476,6 +476,36 @@ namespace tb320eva.Migrations
b.ToTable("eva_evaluation_group_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("indicators")
.HasMaxLength(4000);
b.Property<bool>("isActive");
b.Property<string>("mission_detail")
.HasMaxLength(4000);
b.Property<int?>("mission_no");
b.Property<string>("target")
.HasMaxLength(4000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_operating_agreement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
{
b.Property<int>("id");
@@ -696,6 +726,13 @@ namespace tb320eva.Migrations
.HasForeignKey("evaluation_group_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
namespace TodoAPI2.Models
{
public interface Ieva_evaluation_operating_agreementService : IBaseService<int, eva_evaluation_operating_agreementInputModel, eva_evaluation_operating_agreementViewModel>
{
new eva_evaluation_operating_agreementViewModel Insert(eva_evaluation_operating_agreementInputModel model);
new eva_evaluation_operating_agreementViewModel Update(int id, eva_evaluation_operating_agreementInputModel model);
List<eva_evaluation_operating_agreementViewModel> GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id);
List<eva_evaluation_operating_agreementViewModel> GetListBySearch(eva_evaluation_operating_agreementSearchModel model);
string UpdateMultiple(List<eva_evaluation_operating_agreementInputModel> model, bool is_force_save);
eva_evaluation_operating_agreementWithSelectionViewModel GetWithSelection(int id);
eva_evaluation_operating_agreementWithSelectionViewModel GetBlankItem();
void RefreshAutoFieldOfAllData();
eva_evaluation_operating_agreementEntity GetEntity(int id);
DataContext GetContext();
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using System.IO;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementEntity : BaseEntity2<int>
{
[ForeignKey("create_evaluation_detail_id")]
public eva_create_evaluation_detailEntity eva_create_evaluation_detail_create_evaluation_detail_id { get; set; }
public int? create_evaluation_detail_id { get; set; }
public int? mission_no { get; set; }
[MaxLength(4000)]
public string mission_detail { get; set; }
[MaxLength(4000)]
public string target { get; set; }
[MaxLength(4000)]
public string indicators { get; set; }
public void SetAutoField(DataContext context)
{
}
public void DoAfterInsertUpdate(DataContext context)
{
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementInputModel
{
public int? id { get; set; }
public int? create_evaluation_detail_id { get; set; }
public int? mission_no { get; set; }
public string mission_detail { get; set; }
public string target { get; set; }
public string indicators { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementReportRequestModel : eva_evaluation_operating_agreementSearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementSearchModel
{
public int id { get; set; }
public int? create_evaluation_detail_id { get; set; }
}
}

View File

@@ -0,0 +1,287 @@
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
using System.IO;
using System.Web;
using System.Net;
using TTSW.Configure;
using Microsoft.Extensions.Options;
using System.Data;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementService : Ieva_evaluation_operating_agreementService
{
private IBaseRepository2<eva_evaluation_operating_agreementEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
public eva_evaluation_operating_agreementService(IBaseRepository2<eva_evaluation_operating_agreementEntity, int> repository, IMyDatabase mydb, Iexternal_linkageService inext)
{
_repository = repository;
db = mydb;
ext = inext;
}
#region Private Functions
private eva_evaluation_operating_agreementEntity GetEntity(eva_evaluation_operating_agreementInputModel model)
{
return Mapper.Map<eva_evaluation_operating_agreementEntity>(model);
}
private List<eva_evaluation_operating_agreementEntity> GetEntityList(List<eva_evaluation_operating_agreementInputModel> models)
{
return Mapper.Map<List<eva_evaluation_operating_agreementEntity>>(models);
}
private eva_evaluation_operating_agreementViewModel GetDto(eva_evaluation_operating_agreementEntity entity)
{
return Mapper.Map<eva_evaluation_operating_agreementViewModel>(entity);
}
private List<eva_evaluation_operating_agreementViewModel> GetDtoList(List<eva_evaluation_operating_agreementEntity> entities)
{
return Mapper.Map<List<eva_evaluation_operating_agreementViewModel>>(entities);
}
#endregion
#region Public Functions
#region Query Functions
public eva_evaluation_operating_agreementViewModel Get(int id)
{
var entity = _repository.Get(id);
return GetDto(entity);
}
public eva_evaluation_operating_agreementEntity GetEntity(int id)
{
var entity = _repository.Get(id);
return entity;
}
public DataContext GetContext()
{
return _repository.Context;
}
public eva_evaluation_operating_agreementWithSelectionViewModel GetWithSelection(int id)
{
var entity = _repository.Get(id);
var i = Mapper.Map<eva_evaluation_operating_agreementWithSelectionViewModel>(entity);
return i;
}
public eva_evaluation_operating_agreementWithSelectionViewModel GetBlankItem()
{
var i = new eva_evaluation_operating_agreementWithSelectionViewModel();
return i;
}
public List<eva_evaluation_operating_agreementViewModel> GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id)
{
var model = new eva_evaluation_operating_agreementSearchModel();
model.create_evaluation_detail_id = create_evaluation_detail_id;
return GetListBySearch(model);
}
public List<eva_evaluation_operating_agreementViewModel> GetListBySearch(eva_evaluation_operating_agreementSearchModel model)
{
var data = (
from m_eva_evaluation_operating_agreement in _repository.Context.eva_evaluation_operating_agreement
join fk_eva_create_evaluation_detail1 in _repository.Context.eva_create_evaluation_detail on m_eva_evaluation_operating_agreement.create_evaluation_detail_id equals fk_eva_create_evaluation_detail1.id
into eva_create_evaluation_detailResult1
from fk_eva_create_evaluation_detailResult1 in eva_create_evaluation_detailResult1.DefaultIfEmpty()
where
(model.create_evaluation_detail_id.HasValue && m_eva_evaluation_operating_agreement.create_evaluation_detail_id == model.create_evaluation_detail_id)
orderby m_eva_evaluation_operating_agreement.created descending
select new eva_evaluation_operating_agreementViewModel()
{
id = m_eva_evaluation_operating_agreement.id,
create_evaluation_detail_id = m_eva_evaluation_operating_agreement.create_evaluation_detail_id,
mission_no = m_eva_evaluation_operating_agreement.mission_no,
mission_detail = m_eva_evaluation_operating_agreement.mission_detail,
target = m_eva_evaluation_operating_agreement.target,
indicators = m_eva_evaluation_operating_agreement.indicators,
create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id = fk_eva_create_evaluation_detailResult1.create_evaluation_id,
isActive = m_eva_evaluation_operating_agreement.isActive,
Created = m_eva_evaluation_operating_agreement.created,
Updated = m_eva_evaluation_operating_agreement.updated
}
).Take(1000).ToList();
return data;
}
#endregion
#region Manipulation Functions
public int GetNewPrimaryKey()
{
int? newkey = 0;
var x = (from i in _repository.Context.eva_evaluation_operating_agreement
orderby i.id descending
select i).Take(1).ToList();
if(x.Count > 0)
{
newkey = x[0].id + 1;
}
return newkey.Value;
}
public eva_evaluation_operating_agreementViewModel Insert(eva_evaluation_operating_agreementInputModel model)
{
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
entity.SetAutoField(_repository.Context);
var inserted = _repository.Insert(entity);
entity.DoAfterInsertUpdate(_repository.Context);
return Get(inserted.id);
}
public eva_evaluation_operating_agreementViewModel Update(int id, eva_evaluation_operating_agreementInputModel model)
{
var existingEntity = _repository.Get(id);
if (existingEntity != null)
{
existingEntity.create_evaluation_detail_id = model.create_evaluation_detail_id;
existingEntity.mission_no = model.mission_no;
existingEntity.mission_detail = model.mission_detail;
existingEntity.target = model.target;
existingEntity.indicators = model.indicators;
existingEntity.SetAutoField(_repository.Context);
var updated = _repository.Update(id, existingEntity);
existingEntity.DoAfterInsertUpdate(_repository.Context);
return Get(updated.id);
}
else
throw new NotificationException("No data to update");
}
public string UpdateMultiple(List<eva_evaluation_operating_agreementInputModel> model, bool is_force_save)
{
foreach(var i in model)
{
if (i.active_mode == "1" && i.id.HasValue) // update
{
var existingEntity = _repository.Get(i.id.Value);
if (existingEntity != null)
{
existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id;
existingEntity.mission_no = i.mission_no;
existingEntity.mission_detail = i.mission_detail;
existingEntity.target = i.target;
existingEntity.indicators = i.indicators;
existingEntity.SetAutoField(_repository.Context);
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
}
else if (i.active_mode == "1" && !i.id.HasValue) // add
{
var entity = GetEntity(i);
entity.id = GetNewPrimaryKey();
entity.SetAutoField(_repository.Context);
_repository.InsertWithoutCommit(entity);
}
else if (i.active_mode == "0" && i.id.HasValue) // remove
{
_repository.DeleteWithoutCommit(i.id.Value);
}
else if (i.active_mode == "0" && !i.id.HasValue)
{
// nothing to do
}
}
if (is_force_save)
{
_repository.Context.SaveChanges();
}
return model.Count().ToString();
}
public eva_evaluation_operating_agreementViewModel SetAsActive(int id)
{
var updated = _repository.SetAsActive(id);
return Get(updated.id);
}
public eva_evaluation_operating_agreementViewModel SetAsInactive(int id)
{
var updated = _repository.SetAsInActive(id);
return Get(updated.id);
}
public void Delete(int id)
{
_repository.Delete(id);
return;
}
public void RefreshAutoFieldOfAllData()
{
var all_items = from i in _repository.Context.eva_evaluation_operating_agreement
select i;
foreach (var item in all_items)
{
item.SetAutoField(_repository.Context);
}
_repository.Context.SaveChanges();
}
private Dictionary<string,string> GetLookupForLog()
{
var i = new Dictionary<string, string>();
i.Add("create_evaluation_detail_id", "อ้างอิงตาราง eva_create_evaluation_detail");
i.Add("create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id", "อ้างอิงตาราง eva_create_evaluation_detail");
i.Add("mission_no", "ภารกิจที่");
i.Add("mission_detail", "รายละเอียดภารกิจ");
i.Add("target", "เป้าหมาย");
i.Add("indicators", "ตัวชี้วัด");
return i;
}
#endregion
#region Match Item
#endregion
#endregion
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementViewModel : BaseViewModel2<int>
{
public int? create_evaluation_detail_id { get; set; }
public int? mission_no { get; set; }
public string mission_detail { get; set; }
public string target { get; set; }
public string indicators { get; set; }
public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class eva_evaluation_operating_agreementWithSelectionViewModel: eva_evaluation_operating_agreementViewModel
{
}
}

View File

@@ -305,6 +305,9 @@ namespace Test01
services.AddScoped<Irep_eva_self_review_allService, rep_eva_self_review_allService>();
services.AddScoped<IBaseRepository2<eva_evaluation_operating_agreementEntity, int>, BaseRepository2<eva_evaluation_operating_agreementEntity, int>>();
services.AddScoped<Ieva_evaluation_operating_agreementService, eva_evaluation_operating_agreementService>();
#endregion
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
@@ -551,6 +554,11 @@ namespace Test01
cfg.CreateMap<rep_eva_self_review_allInputModel, eva_level_scoreEntity>();
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_review_allViewModel>();
cfg.CreateMap<eva_level_scoreEntity, rep_eva_self_review_allWithSelectionViewModel>();
cfg.CreateMap<eva_evaluation_operating_agreementInputModel, eva_evaluation_operating_agreementEntity>();
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementViewModel>();
cfg.CreateMap<eva_evaluation_operating_agreementEntity, eva_evaluation_operating_agreementWithSelectionViewModel>();
});
#endregion

View File

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

View File

@@ -0,0 +1,124 @@
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@{
ViewData["Title"] = "eva_evaluation_operating_agreement";
}
<div class="modal fade" id="eva_evaluation_operating_agreementModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_evaluation_operating_agreementModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="eva_evaluation_operating_agreementModelLabel">บันทึกข้อมูล eva_evaluation_operating_agreement</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_id" />
<input class="form-control" type="hidden" id="eva_evaluation_operating_agreement_create_evaluation_detail_id" />
<div class='row'></div>
<div class='row'></div>
<div class='row'>
<div class="form-group col-md-4">
<label id="lab_eva_evaluation_operating_agreement_mission_no" for="eva_evaluation_operating_agreement_mission_no">ภารกิจที่</label>
<input class="form-control" type="number" id="eva_evaluation_operating_agreement_mission_no" iLabel="ภารกิจที่" iRequire="true" iGroup="eva_evaluation_operating_agreement" />
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_mission_detail" for="eva_evaluation_operating_agreement_mission_detail">รายละเอียดภารกิจ</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_mission_detail" iLabel="รายละเอียดภารกิจ" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_target" for="eva_evaluation_operating_agreement_target">เป้าหมาย</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_target" iLabel="เป้าหมาย" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-12">
<label id="lab_eva_evaluation_operating_agreement_indicators" for="eva_evaluation_operating_agreement_indicators">ตัวชี้วัด</label>
<textarea class="form-control" rows="4" cols="50" id="eva_evaluation_operating_agreement_indicators" iLabel="ตัวชี้วัด" iRequire="true" iGroup="eva_evaluation_operating_agreement"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
<button type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_operating_agreement_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@Configuration["SiteInformation:modulename"]
</div>
</div>
<div class="col-md-7">
<ol class="breadcrumb" style="">
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
<li class="breadcrumb-item active">eva_evaluation_operating_agreement</li>
</ol>
</div>
</div>
<section class="wrapper">
<div class="title"><div class="line"></div>ค้นหา eva_evaluation_operating_agreement</div>
<div class="tools">
<div class="row">
<div class="form-group col-md-3">
<label id='lab_s_eva_evaluation_operating_agreement_create_evaluation_detail_id' for='s_eva_evaluation_operating_agreement_create_evaluation_detail_id'>อ้างอิงตาราง eva_create_evaluation_detail</label>
<input class="form-control" type="hidden" id="s_eva_evaluation_operating_agreement_create_evaluation_detail_id" />
</div>
<div class="col-md-6">
<button class="btn btn-info" onclick="javascript:eva_evaluation_operating_agreement_DoSearch();">ค้นหา</button>
<button class="btn btn-info" onclick="javascript:eva_evaluation_operating_agreement_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_evaluation_operating_agreement_GetSelect('id');">ดึงตัวเลือก</button>
</div>
</div>
</div>
<table id="eva_evaluation_operating_agreementTable" class="display table table-bordered table-striped">
<thead>
<tr>
<!--<th>เลือก</th>-->
<th>เครื่องมือ</th>
<th><label id='h_eva_evaluation_operating_agreement_id'>รหัสอ้างอิง</label></th>
<th><label id='h_eva_evaluation_operating_agreement_create_evaluation_detail_id'>อ้างอิงตาราง eva_create_evaluation_detail</label></th>
<th><label id='h_eva_evaluation_operating_agreement_mission_no'>ภารกิจที่</label></th>
<th><label id='h_eva_evaluation_operating_agreement_mission_detail'>รายละเอียดภารกิจ</label></th>
<th><label id='h_eva_evaluation_operating_agreement_target'>เป้าหมาย</label></th>
<th><label id='h_eva_evaluation_operating_agreement_indicators'>ตัวชี้วัด</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
@section FooterPlaceHolder{
<script src="~/js/eva_evaluation_operating_agreement/eva_evaluation_operating_agreement.js"></script>
<script>
$(document).ready(function () {
eva_evaluation_operating_agreement_InitiateDataTable();
eva_evaluation_operating_agreement_InitialForm();
SetupValidationRemark("eva_evaluation_operating_agreement");
});
</script>
}

View File

@@ -68,15 +68,11 @@
<None Remove="Files\**" />
<None Remove="Uploads\**" />
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
<None Include="Views\eva_adjust_postponement_detail_migrationView\eva_adjust_postponement_detail_migration.cshtml" />
<None Include="Views\eva_adjust_postponement_migrationView\eva_adjust_postponement_migration.cshtml" />
<None Include="Views\eva_adjust_postponement_migrationView\eva_adjust_postponement_migration_d.cshtml" />
<None Include="Views\eva_self_reviewView\eva_self_review.cshtml" />
<None Include="Views\rep_eva_self_reviewView\rep_eva_self_review_report.cshtml" />
<None Include="Views\rep_eva_self_review_allView\rep_eva_self_review_all_report.cshtml" />
<None Include="Views\eva_evaluation_operating_agreementView\eva_evaluation_operating_agreement.cshtml" />
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration.js" />
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration_d.js" />
<None Include="wwwroot\js\eva_evaluation_operating_agreement\eva_evaluation_operating_agreement.js" />
<None Include="wwwroot\js\eva_self_review\eva_self_review.js" />
<None Include="wwwroot\js\rep_eva_self_review\rep_eva_self_review_report.js" />
<None Include="wwwroot\js\rep_eva_self_review_all\rep_eva_self_review_all_report.js" />

View File

@@ -2659,6 +2659,124 @@
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_evaluation_operating_agreementController},TodoAPI2.Models.Ieva_evaluation_operating_agreementService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection
</summary>
<param name="repository"></param>
<param name="configuration"></param>
<param name="logger"></param>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.Get(System.Int32)">
<summary>
Get specific item by id
</summary>
<remarks>
</remarks>
<returns>Return Get specific item by id</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.GetBlankItem">
<summary>
Get Blank Item
</summary>
<remarks>
</remarks>
<returns>Return a blank item</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.GetList(System.Nullable{System.Int32})">
<summary>
Get list items by create_evaluation_detail_id
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.GetListBySearch(TodoAPI2.Models.eva_evaluation_operating_agreementSearchModel)">
<summary>
Get list items by search
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.eva_evaluation_operating_agreement_report(TodoAPI2.Models.eva_evaluation_operating_agreementReportRequestModel)">
<summary>
Download Report
</summary>
<remarks>
</remarks>
<returns>Return list of items by specifced keyword</returns>
<response code="200">Returns the item</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.Insert(TodoAPI2.Models.eva_evaluation_operating_agreementInputModel)">
<summary>
Create new item
</summary>
<remarks>
</remarks>
<param name="model"></param>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.Update(System.Int32,TodoAPI2.Models.eva_evaluation_operating_agreementInputModel)">
<summary>
Update item
</summary>
<remarks>
</remarks>
<param name="id"></param>
<param name="model"></param>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.Delete(System.Int32)">
<summary>
Delete item
</summary>
<remarks>
</remarks>
<param name="id"></param>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_evaluation_operating_agreementInputModel})">
<summary>
Update multiple item
</summary>
<remarks>
</remarks>
<param name="model"></param>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_operating_agreementController.RefreshAutoField">
<summary>
Refresh AutoField of all items
</summary>
<remarks>
</remarks>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_idp_planController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_idp_planController},TodoAPI2.Models.Ieva_idp_planService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection

View File

@@ -0,0 +1,227 @@
var eva_evaluation_operating_agreement_editMode = "CREATE";
var eva_evaluation_operating_agreement_API = "/api/eva_evaluation_operating_agreement/";
//================= Search Customizaiton =========================================
function eva_evaluation_operating_agreement_GetSearchParameter() {
var eva_evaluation_operating_agreementSearchObject = new Object();
eva_evaluation_operating_agreementSearchObject.create_evaluation_detail_id = getUrlParameter("id");
return eva_evaluation_operating_agreementSearchObject;
}
function eva_evaluation_operating_agreement_FeedDataToSearchForm(data) {
$("#s_eva_evaluation_operating_agreement_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
}
//================= Form Data Customizaiton =========================================
function eva_evaluation_operating_agreement_FeedDataToForm(data) {
$("#eva_evaluation_operating_agreement_id").val(data.id);
$("#eva_evaluation_operating_agreement_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
$("#eva_evaluation_operating_agreement_mission_no").val(data.mission_no);
$("#eva_evaluation_operating_agreement_mission_detail").val(data.mission_detail);
$("#eva_evaluation_operating_agreement_target").val(data.target);
$("#eva_evaluation_operating_agreement_indicators").val(data.indicators);
}
function eva_evaluation_operating_agreement_GetFromForm() {
var eva_evaluation_operating_agreementObject = new Object();
eva_evaluation_operating_agreementObject.id = $("#eva_evaluation_operating_agreement_id").val();
eva_evaluation_operating_agreementObject.create_evaluation_detail_id = getUrlParameter("id");
eva_evaluation_operating_agreementObject.mission_no = $("#eva_evaluation_operating_agreement_mission_no").val();
eva_evaluation_operating_agreementObject.mission_detail = $("#eva_evaluation_operating_agreement_mission_detail").val();
eva_evaluation_operating_agreementObject.target = $("#eva_evaluation_operating_agreement_target").val();
eva_evaluation_operating_agreementObject.indicators = $("#eva_evaluation_operating_agreement_indicators").val();
return eva_evaluation_operating_agreementObject;
}
function eva_evaluation_operating_agreement_InitialForm(s) {
var successFunc = function (result) {
eva_evaluation_operating_agreement_FeedDataToForm(result);
eva_evaluation_operating_agreement_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_evaluation_operating_agreementModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_operating_agreement_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_evaluation_operating_agreement_GoCreate() {
// Incase model popup
eva_evaluation_operating_agreement_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_evaluation_operating_agreementView/eva_evaluation_operating_agreement_d");
}
function eva_evaluation_operating_agreement_GoEdit(a) {
// Incase model popup
eva_evaluation_operating_agreement_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_evaluation_operating_agreementView/eva_evaluation_operating_agreement_d?id=" + a);
}
function eva_evaluation_operating_agreement_SetEditForm(a) {
var successFunc = function (result) {
eva_evaluation_operating_agreement_editMode = "UPDATE";
eva_evaluation_operating_agreement_FeedDataToForm(result);
$("#eva_evaluation_operating_agreementModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_evaluation_operating_agreement_API + a, successFunc, AlertDanger);
}
function eva_evaluation_operating_agreement_SetCreateForm(s) {
eva_evaluation_operating_agreement_editMode = "CREATE";
eva_evaluation_operating_agreement_InitialForm(s);
}
function eva_evaluation_operating_agreement_RefreshTable() {
// Incase model popup
eva_evaluation_operating_agreement_DoSearch();
// Incase open new page
//window.parent.eva_evaluation_operating_agreement_DoSearch();
}
//================= Update and Delete =========================================
var eva_evaluation_operating_agreement_customValidation = function (group) {
return "";
};
function eva_evaluation_operating_agreement_PutUpdate() {
if (!ValidateForm('eva_evaluation_operating_agreement', eva_evaluation_operating_agreement_customValidation)) {
return;
}
var data = eva_evaluation_operating_agreement_GetFromForm();
//Update Mode
if (eva_evaluation_operating_agreement_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_evaluation_operating_agreementModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_evaluation_operating_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_operating_agreement_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_evaluation_operating_agreementModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_evaluation_operating_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_evaluation_operating_agreement_API, data, successFunc2, AlertDanger);
}
}
function eva_evaluation_operating_agreement_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_evaluation_operating_agreementModel").modal("hide");
AlertSuccess(result.code + " " + result.message);
eva_evaluation_operating_agreement_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_evaluation_operating_agreement_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_evaluation_operating_agreementTableV;
var eva_evaluation_operating_agreement_setupTable = function (result) {
tmp = '"';
eva_evaluation_operating_agreementTableV = $('#eva_evaluation_operating_agreementTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
//"select": {
// "style": 'multi'
//},
"columns": [
//{ "data": "" },
{ "data": "id" },
{ "data": "mission_no" },
{ "data": "mission_detail" },
{ "data": "target" },
{ "data": "indicators" },
],
"columnDefs": [
{
"targets": 0, //1,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_evaluation_operating_agreement_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_evaluation_operating_agreement_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 eva_evaluation_operating_agreement_InitiateDataTable() {
startLoad();
var p = $.param(eva_evaluation_operating_agreement_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_evaluation_operating_agreement/GetListBySearch?" + p, eva_evaluation_operating_agreement_setupTable, AlertDanger);
}
function eva_evaluation_operating_agreement_DoSearch() {
var p = $.param(eva_evaluation_operating_agreement_GetSearchParameter());
var eva_evaluation_operating_agreement_reload = function (result) {
eva_evaluation_operating_agreementTableV.destroy();
eva_evaluation_operating_agreement_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_operating_agreement/GetListBySearch?" + p, eva_evaluation_operating_agreement_reload, AlertDanger);
}
function eva_evaluation_operating_agreement_GetSelect(f) {
var eva_evaluation_operating_agreement_selectitem = [];
$.each(eva_evaluation_operating_agreementTableV.rows('.selected').data(), function (key, value) {
eva_evaluation_operating_agreement_selectitem.push(value[f]);
});
alert(eva_evaluation_operating_agreement_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================