รวม code จากทุกคน ที่แก้ไข op ล่าสุด

This commit is contained in:
Nakorn Rientrakrunchai
2020-04-05 22:57:02 +07:00
parent 6135a2ec09
commit 9ffe9c30d3
46 changed files with 2636 additions and 529 deletions

View File

@@ -0,0 +1,321 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Logging;
using TTSW.Controllers;
using TTSW.EF;
using TTSW.Utils;
using TTSW.Constant;
using TTSW.Common;
using TodoAPI2.Models;
using System.Data;
using Microsoft.Extensions.Configuration;
using System.IO;
namespace TodoAPI2.Controllers
{
//[Authorize]
[Produces("application/json")]
[Route("api/eva_idp_plan")]
public class eva_idp_planController : BaseController
{
#region Private Variables
private ILogger<eva_idp_planController> _logger;
private Ieva_idp_planService _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_idp_planController(ILogger<eva_idp_planController> logger, Ieva_idp_planService 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_idp_planWithSelectionViewModel), 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_idp_planWithSelectionViewModel), 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_idp_planViewModel>), 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_idp_planViewModel>), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult GetListBySearch(eva_idp_planSearchModel 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>
/// 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_idp_planInputModel 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_idp_planInputModel 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_idp_planInputModel> model)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
string rowCount = _repository.UpdateMultiple(model);
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);
}
}
}

View File

@@ -37,6 +37,7 @@ 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_idp_planEntity> eva_idp_plan { get; set; }
protected override void OnModelCreating (ModelBuilder modelBuilder) {
base.OnModelCreating (modelBuilder);

BIN
EXCEL/eva_idp_plan.xlsx Normal file

Binary file not shown.

627
Migrations/25630405153506_idp.Designer.cs generated Normal file
View File

@@ -0,0 +1,627 @@
// <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("25630405153506_idp")]
partial class idp
{
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(100);
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
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<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<decimal?>("middle");
b.Property<decimal?>("new_cost_living");
b.Property<decimal?>("new_sarary");
b.Property<decimal?>("new_sarary_with_quota");
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_supervisor");
b.Property<decimal?>("achievement_chief");
b.Property<decimal?>("achievement_supervisor");
b.Property<int?>("chief");
b.Property<decimal?>("competency_chief");
b.Property<decimal?>("competency_supervisor");
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<decimal?>("score_chief");
b.Property<decimal?>("score_supervisor");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<string>("status_supervisor")
.HasMaxLength(1);
b.Property<string>("status_supervisor1A")
.HasMaxLength(1);
b.Property<string>("status_supervisor2A")
.HasMaxLength(1);
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_supervisor");
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?>("sumary");
b.Property<decimal?>("sumary2");
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?>("sumary");
b.Property<decimal?>("sumary2");
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_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<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_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,36 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class idp : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "eva_idp_plan",
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),
develop = table.Column<string>(maxLength: 1000, nullable: true),
development_method = table.Column<string>(maxLength: 1000, nullable: true),
start_date = table.Column<DateTime>(nullable: true),
end_date = table.Column<DateTime>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_eva_idp_plan", x => x.id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "eva_idp_plan");
}
}
}

View File

@@ -389,6 +389,33 @@ namespace tb320eva.Migrations
b.ToTable("eva_evaluation_group_detail");
});
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<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")

View File

@@ -254,6 +254,8 @@ namespace TodoAPI2.Models
if (theemp.salary.HasValue)
{
n.sarary = theemp.salary;
if (n.sarary < 13285) n.cost_living = 1000;
else n.cost_living = 0;
sum_salary += n.sarary.Value;
}
else
@@ -263,20 +265,22 @@ namespace TodoAPI2.Models
var c = getCylinderForEmployee(theemp, cylinder);
n.cost_living = 0;
n.middle = 0;
if (c != null)
{
n.middle = c.middle;
n.cost_living = c.cost_living;
}
n.promoted_percentage = 0;
n.total_promote = 0;
n.promoted_percentage = 0; // ร้อยละที่ได้เลื่อน
n.total_promote = 0; // จำนวนเงินที่ได้เลื่อน
n.new_sarary = n.sarary;
n.new_cost_living = n.cost_living;
n.remark = null;
if(theemp.worked_month < 4)
{
n.remark = "ปฏิบัติงานไม่ครบ 4 เดือน";
}
n.receive_quota = 0;
n.new_sarary_with_quota = n.sarary;

View File

@@ -108,7 +108,7 @@ namespace TodoAPI2.Models
where 1==1
//&& (m_eva_adjust_postponement_detail_normal_02.id == model.id || !model.id.HasValue)
&& (m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id == model.adjust_postponement_id || !model.adjust_postponement_id.HasValue)
&& fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id
//&& fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id
orderby m_eva_adjust_postponement_detail_normal_02.created descending
select new eva_adjust_postponement_detail_normal_02ViewModel()

View File

@@ -96,19 +96,23 @@ namespace TodoAPI2.Models
into eva_adjust_postponementResult1
from fk_eva_adjust_postponementResult1 in eva_adjust_postponementResult1.DefaultIfEmpty()
join fk_eva_adjust_postponement1A in _repository.Context.eva_adjust_postponement on m_eva_adjust_postponement_detail_quota_02.adjust_postponement_id equals fk_eva_adjust_postponement1A.id
into eva_adjust_postponementResult1A
from fk_eva_adjust_postponementResult1A in eva_adjust_postponementResult1A.DefaultIfEmpty()
join fk_external_linkage2 in all_emp on m_eva_adjust_postponement_detail_quota_02.employee_id equals fk_external_linkage2.id
into external_linkageResult2
from fk_external_linkageResult2 in external_linkageResult2.DefaultIfEmpty()
join create_detail in _repository.Context.eva_create_evaluation_detail
on fk_eva_adjust_postponementResult1.create_evaluation_id equals create_detail.create_evaluation_id
on fk_eva_adjust_postponementResult1A.create_evaluation_id equals create_detail.create_evaluation_id
into create_detailResult
from fk_create_detailResult in create_detailResult.DefaultIfEmpty()
where 1==1
//&& (m_eva_adjust_postponement_detail_quota_02.id == model.id || !model.id.HasValue)
&& (m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id == model.adjust_postponement_quota_id || !model.adjust_postponement_quota_id.HasValue)
&& (fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_quota_02.employee_id || fk_create_detailResult == null)
orderby m_eva_adjust_postponement_detail_quota_02.created descending
select new eva_adjust_postponement_detail_quota_02ViewModel()

View File

@@ -22,15 +22,18 @@ namespace TodoAPI2.Models
private IBaseRepository2<eva_create_evaluationEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
Iexternal_employeeService emp;
private Iexternal_employeeService emp;
private Ieva_create_evaluation_detailService create_detail;
public eva_create_evaluationService(IBaseRepository2<eva_create_evaluationEntity, int> repository, IMyDatabase mydb,
Iexternal_linkageService inext, Iexternal_employeeService inemp)
Iexternal_linkageService inext, Iexternal_employeeService inemp,
Ieva_create_evaluation_detailService in_create_detail)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
create_detail = in_create_detail;
}
#region Private Functions
@@ -183,10 +186,14 @@ namespace TodoAPI2.Models
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var inserted = _repository.Insert(entity);
var selected_emp = (from i in _repository.Context.eva_evaluation_group_detail
where i.evaluation_group_id == model.evaluation_group_id
select i.employee_id.Value).ToList();
create_detail.AddMultiple(entity.id, selected_emp);
return Get(inserted.id);
}
@@ -266,6 +273,39 @@ namespace TodoAPI2.Models
}
public void Delete(int id)
{
var p = from i in _repository.Context.eva_adjust_postponement
where i.create_evaluation_id == id
select i;
foreach(var j in p)
{
var p2 = from i in _repository.Context.eva_adjust_postponement_detail
where i.adjust_postponement_id == j.id
select i;
_repository.Context.eva_adjust_postponement_detail.RemoveRange(p2);
}
_repository.Context.eva_adjust_postponement.RemoveRange(p);
var p3 = from i in _repository.Context.eva_create_evaluation_detail
where i.create_evaluation_id == id
select i;
foreach(var k in p3)
{
var p4 = from i in _repository.Context.eva_evaluation_behavior
where i.create_evaluation_detail_id == k.id
select i;
_repository.Context.eva_evaluation_behavior.RemoveRange(p4);
var p5 = from i in _repository.Context.eva_evaluation_achievement
where i.create_evaluation_detail_id == k.id
select i;
_repository.Context.eva_evaluation_achievement.RemoveRange(p5);
}
_repository.Context.eva_create_evaluation_detail.RemoveRange(p3);
_repository.Delete(id);
return;

View File

@@ -162,6 +162,9 @@ namespace TodoAPI2.Models
supervisor1_result_external_linkage_external_name = fk_external_linkageResult21.external_name,
supervisor2_result_external_linkage_external_name = fk_external_linkageResult25.external_name,
position_level_text = fk_external_linkageResult2.position_level_text,
position_type_text = fk_external_linkageResult2.position_type_name,
isActive = m_eva_create_evaluation_detail.isActive,
Created = m_eva_create_evaluation_detail.created,
Updated = m_eva_create_evaluation_detail.updated

View File

@@ -87,5 +87,7 @@ namespace TodoAPI2.Models
public string supervisor1_result_external_linkage_external_name { get; set; }
public string supervisor2_result_external_linkage_external_name { get; set; }
public string position_type_text { get; set; }
public string position_level_text { get; set; }
}
}

View File

@@ -85,7 +85,7 @@ namespace TodoAPI2.Models
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,
employee_position_type = fk_external_employee.employee_type_name,
employee_position_type = fk_external_employee.position_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
chief_fullname = fk_external_chief.fullname,
@@ -195,8 +195,8 @@ namespace TodoAPI2.Models
employee_code = fk_external_employee.employee_no,
employee_fullname = fk_external_employee.fullname,
employee_position = fk_external_employee.position_name,
employee_position_type = null,
employee_position_level = null,
employee_position_type = fk_external_employee.position_type_name,
employee_position_level = fk_external_employee.position_level_text,
employee_org = fk_external_employee.department_name,
chief_fullname = fk_external_chief.fullname,
chief_position = fk_external_chief.position_name,

View File

@@ -0,0 +1,28 @@
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_idp_planService : IBaseService<int, eva_idp_planInputModel, eva_idp_planViewModel>
{
new eva_idp_planViewModel Insert(eva_idp_planInputModel model);
new eva_idp_planViewModel Update(int id, eva_idp_planInputModel model);
List<eva_idp_planViewModel> GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id);
List<eva_idp_planViewModel> GetListBySearch(eva_idp_planSearchModel model);
string UpdateMultiple(List<eva_idp_planInputModel> model);
eva_idp_planWithSelectionViewModel GetWithSelection(int id);
eva_idp_planWithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,33 @@
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_idp_planEntity : BaseEntity2<int>
{
public int? create_evaluation_detail_id { get; set; }
[MaxLength(1000)]
public string develop { get; set; }
[MaxLength(1000)]
public string development_method { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { get; set; }
}
}

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_idp_planInputModel
{
public int? id { get; set; }
public int? create_evaluation_detail_id { get; set; }
public string develop { get; set; }
public string development_method { get; set; }
public DateTime? start_date { get; set; }
public DateTime? end_date { 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_idp_planReportRequestModel : eva_idp_planSearchModel
{
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_idp_planSearchModel
{
public int id { get; set; }
public int? create_evaluation_detail_id { get; set; }
}
}

View File

@@ -0,0 +1,232 @@
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_idp_planService : Ieva_idp_planService
{
private IBaseRepository2<eva_idp_planEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
public eva_idp_planService(IBaseRepository2<eva_idp_planEntity, int> repository, IMyDatabase mydb, Iexternal_linkageService inext)
{
_repository = repository;
db = mydb;
ext = inext;
}
#region Private Functions
private eva_idp_planEntity GetEntity(eva_idp_planInputModel model)
{
return Mapper.Map<eva_idp_planEntity>(model);
}
private List<eva_idp_planEntity> GetEntityList(List<eva_idp_planInputModel> models)
{
return Mapper.Map<List<eva_idp_planEntity>>(models);
}
private eva_idp_planViewModel GetDto(eva_idp_planEntity entity)
{
return Mapper.Map<eva_idp_planViewModel>(entity);
}
private List<eva_idp_planViewModel> GetDtoList(List<eva_idp_planEntity> entities)
{
return Mapper.Map<List<eva_idp_planViewModel>>(entities);
}
#endregion
#region Public Functions
#region Query Functions
public eva_idp_planViewModel Get(int id)
{
var entity = _repository.Get(id);
return GetDto(entity);
}
public eva_idp_planWithSelectionViewModel GetWithSelection(int id)
{
var entity = _repository.Get(id);
var i = Mapper.Map<eva_idp_planWithSelectionViewModel>(entity);
return i;
}
public eva_idp_planWithSelectionViewModel GetBlankItem()
{
var i = new eva_idp_planWithSelectionViewModel();
return i;
}
public List<eva_idp_planViewModel> GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id)
{
var model = new eva_idp_planSearchModel();
model.create_evaluation_detail_id = create_evaluation_detail_id;
return GetListBySearch(model);
}
public List<eva_idp_planViewModel> GetListBySearch(eva_idp_planSearchModel model)
{
var data = (
from m_eva_idp_plan in _repository.Context.eva_idp_plan
where 1==1
//&& (m_eva_idp_plan.id == model.id || !model.id.HasValue)
&& (m_eva_idp_plan.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue)
orderby m_eva_idp_plan.created descending
select new eva_idp_planViewModel()
{
id = m_eva_idp_plan.id,
create_evaluation_detail_id = m_eva_idp_plan.create_evaluation_detail_id,
develop = m_eva_idp_plan.develop,
development_method = m_eva_idp_plan.development_method,
start_date = m_eva_idp_plan.start_date,
end_date = m_eva_idp_plan.end_date,
isActive = m_eva_idp_plan.isActive,
Created = m_eva_idp_plan.created,
Updated = m_eva_idp_plan.updated
}
).Take(100).ToList();
return data;
}
#endregion
#region Manipulation Functions
public int GetNewPrimaryKey()
{
int? newkey = 0;
var x = (from i in _repository.Context.eva_idp_plan
orderby i.id descending
select i).Take(1).ToList();
if(x.Count > 0)
{
newkey = x[0].id + 1;
}
return newkey.Value;
}
public eva_idp_planViewModel Insert(eva_idp_planInputModel model)
{
var entity = GetEntity(model);
entity.id = GetNewPrimaryKey();
var inserted = _repository.Insert(entity);
return Get(inserted.id);
}
public eva_idp_planViewModel Update(int id, eva_idp_planInputModel model)
{
var existingEntity = _repository.Get(id);
if (existingEntity != null)
{
existingEntity.create_evaluation_detail_id = model.create_evaluation_detail_id;
existingEntity.develop = model.develop;
existingEntity.development_method = model.development_method;
existingEntity.start_date = model.start_date;
existingEntity.end_date = model.end_date;
var updated = _repository.Update(id, existingEntity);
return Get(updated.id);
}
else
throw new NotificationException("No data to update");
}
public string UpdateMultiple(List<eva_idp_planInputModel> model)
{
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.develop = i.develop;
existingEntity.development_method = i.development_method;
existingEntity.start_date = i.start_date;
existingEntity.end_date = i.end_date;
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
}
else if (i.active_mode == "1" && !i.id.HasValue) // add
{
var entity = GetEntity(i);
entity.id = GetNewPrimaryKey();
_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
}
}
_repository.Context.SaveChanges();
return model.Count().ToString();
}
public eva_idp_planViewModel SetAsActive(int id)
{
var updated = _repository.SetAsActive(id);
return Get(updated.id);
}
public eva_idp_planViewModel SetAsInactive(int id)
{
var updated = _repository.SetAsInActive(id);
return Get(updated.id);
}
public void Delete(int id)
{
_repository.Delete(id);
return;
}
#endregion
#region Match Item
#endregion
#endregion
}
}

View File

@@ -0,0 +1,33 @@
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_idp_planViewModel : BaseViewModel2<int>
{
public int? create_evaluation_detail_id { get; set; }
public string develop { get; set; }
public string development_method { get; set; }
public DateTime? start_date { get; set; }
public string txt_start_date { get { return MyHelper.GetDateStringForReport(this.start_date); } }
public DateTime? end_date { get; set; }
public string txt_end_date { get { return MyHelper.GetDateStringForReport(this.end_date); } }
}
}

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_idp_planWithSelectionViewModel: eva_idp_planViewModel
{
}
}

View File

@@ -70,8 +70,10 @@ select he.employee_id as id, mpn.position_number,he.employee_no,he.position_no,
CONCAT(htm.title_name,' ',he.firstname,' ',he.lastname) as fullname,opd.position_name,
orgdata.id as department_id,orgdata.department_name,orgdata.department_code,he.salary,
he.employee_type_id, het.employee_type_name,opd.position_id as position_id,
u.email as user_email, u.id as user_id,hpl.position_level_name,hpl.position_level_id
u.email as user_email, u.id as user_id,hpl.position_level_name,he.position_level_id,
he.position_type_id,hpt.position_type_name,he.packing_date
from public.hrm_employees as he
left join public.hrm_position_types as hpt on he.position_type_id=hpt.id
left join public.hrm_position_levels as hpl on he.position_level_id = hpl.id
left join public.mpp_position_numbers as mpn on he.position_no = mpn.id
left join public.org_position_datas as opd on opd.position_id = mpn.position_id
@@ -98,7 +100,12 @@ order by he.firstname,he.lastname;
i.employee_type_id = Convert.ToInt32(dr["employee_type_id"]);
i.employee_type_name = dr["employee_type_name"].ToString();
}
i.position_type_id = null;
if (dr["position_type_id"] != DBNull.Value)
{
i.position_type_id = Convert.ToInt32(dr["position_type_id"]);
i.position_type_name = dr["position_type_name"].ToString();
}
if (dr["position_id"] != DBNull.Value)
{
@@ -130,6 +137,10 @@ order by he.firstname,he.lastname;
{
i.salary = Convert.ToDecimal(dr["salary"]);
}
if (dr["packing_date"] != DBNull.Value)
{
i.packing_date = Convert.ToDateTime(dr["packing_date"]);
}
result.Add(i);
}
@@ -141,7 +152,7 @@ order by he.firstname,he.lastname;
var sql = @"
select he.employee_id as id, mpn.position_number, opd.position_name,
CONCAT(htm.title_name,' ',he.firstname,' ',he.lastname) as fullname,
u.email as user_email, u.id as user_id
u.email as user_email, u.id as user_id,u.name as fullname2
from public.hrm_employees as he
left join public.mpp_position_numbers as mpn on he.position_no = mpn.id
left join public.org_position_datas as opd on opd.position_id = mpn.position_id
@@ -164,10 +175,10 @@ and u.id=@user_id;
i.id = Convert.ToInt32(dr["id"]);
i.position_number = dr["position_number"].ToString();
i.position_name = dr["position_name"].ToString();
i.fullname = dr["fullname"].ToString();
i.fullname = dr["fullname2"].ToString();
i.employee_type_id = null;
i.position_type_id = null;
if(dr["user_id"] != DBNull.Value)
if (dr["user_id"] != DBNull.Value)
{
i.user_email = dr["user_email"].ToString();
i.user_id = Convert.ToInt32(dr["user_id"]);

View File

@@ -26,6 +26,7 @@ namespace TodoAPI2.Models
public int? position_id { get; set; }
public int? position_type_id { get; set; }
public string position_type_name { get; set; }
public string user_email { get; set; }
@@ -40,5 +41,27 @@ namespace TodoAPI2.Models
public int? position_level_id { get; set; }
public string position_level_text { get; set; }
public DateTime? packing_date { get; set; }
public int? worked_month // ทำงานมาแล้วกี่เดือน
{
get
{
if (packing_date.HasValue)
{
DateTime startDate = packing_date.Value;
DateTime endDate = DateTime.Now;
int monthsApart = 12 * (startDate.Year - endDate.Year) + startDate.Month - endDate.Month;
return Math.Abs(monthsApart);
}
else
{
return 0;
}
}
}
}
}

View File

@@ -286,6 +286,9 @@ namespace Test01
services.AddScoped<Isearch_employee_for_groupService, search_employee_for_groupService>();
services.AddScoped<IBaseRepository2<eva_idp_planEntity, int>, BaseRepository2<eva_idp_planEntity, int>>();
services.AddScoped<Ieva_idp_planService, eva_idp_planService>();
#endregion
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
@@ -489,6 +492,10 @@ namespace Test01
cfg.CreateMap<eva_level_scoreEntity, eva_level_score_basicViewModel>();
cfg.CreateMap<eva_level_scoreEntity, eva_level_score_basicWithSelectionViewModel>();
cfg.CreateMap<eva_idp_planInputModel, eva_idp_planEntity>();
cfg.CreateMap<eva_idp_planEntity, eva_idp_planViewModel>();
cfg.CreateMap<eva_idp_planEntity, eva_idp_planWithSelectionViewModel>();
});
#endregion

View File

@@ -219,6 +219,13 @@
<script>
$("#username").text(getCookie("emp_name"));
</script>
<script>
$(document).ready(function () {
$( document ).on( 'focus', ':input', function(){
$( this ).attr( 'autocomplete', 'off' );
});
});
</script>
</body>
</html>

View File

@@ -109,7 +109,7 @@
</li>
<li class="dropdown-divider"></li>
<li>
<a href="@Environment.GetEnvironmentVariable("SiteInformation_appsite")/home/logout');">
<a href="javascript:window_open_from_root('@Environment.GetEnvironmentVariable("SiteInformation_appsite")/home/logout');">
<i class="fa fa-power-off" style="font-size: 14px"></i>
ออกจากระบบ
</a>
@@ -202,6 +202,13 @@
<script>
$("#username").text(getCookie("emp_name"));
</script>
<script>
$(document).ready(function () {
$( document ).on( 'focus', ':input', function(){
$( this ).attr( 'autocomplete', 'off' );
});
});
</script>
</body>
</html>

View File

@@ -67,13 +67,13 @@
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_adjust_postponement_quota_command_no" for="eva_adjust_postponement_quota_command_no">เลขที่คำสั่ง</label>
<input class="form-control" type="text" id="eva_adjust_postponement_quota_command_no" iLabel="เลขที่คำสั่ง" iRequire="true" iGroup="eva_adjust_postponement_quota" />
<label for="remain_quota">จำนวนเงินโควต้าพิเศษคงเหลือ</label>
<input disabled class="form-control" type="text" id="remain_quota" iLabel="จำนวนเงินโควต้าพิเศษคงเหลือ" iRequire="false" iGroup="eva_adjust_postponement_quota" />
</div>
<div class="form-group col-md-6">
<label for="remain_quota">จำนวนเงินโควต้าพิเศษคงเหลือ</label>
<input disabled class="form-control" type="text" id="remain_quota" iLabel="จำนวนเงินโควต้าพิเศษคงเหลือ" iRequire="false" iGroup="eva_adjust_postponement_quota" />
<label id="lab_eva_adjust_postponement_quota_command_no" for="eva_adjust_postponement_quota_command_no">เลขที่คำสั่ง</label>
<input class="form-control" type="text" id="eva_adjust_postponement_quota_command_no" iLabel="เลขที่คำสั่ง" iRequire="true" iGroup="eva_adjust_postponement_quota" />
</div>
</div>
@@ -106,19 +106,20 @@
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_fullname'>ชื่อ-นามสกุล</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_position'>ตำแหน่ง</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_emp_level'>ระดับ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_sarary'>เงินเดือน ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_cost_living'>ค่าครองชีพ ก่อนปรับเลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_score'>คะแนนรวม</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_eva_result'>ผลการประเมิน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_middle'>ค่ากลางฐานในการคำนวณ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_promoted_percentage'>ร้อยละที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_total_promote'>จำนวนเงินที่ได้เลื่อน</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary'>เงินเดือนใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_receive_quota'>ได้รับเงินโควต้าพิเศษ</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_sarary_with_quota'>เงินเดือนใหม่ (รวมโควต้า)</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_new_cost_living'>ค่าครองชีพใหม่</label></th>
<th><label id='h_eva_adjust_postponement_detail_quota_02_remark'>หมายเหตุ</label></th>

View File

@@ -167,8 +167,9 @@
<tr>
<th>เครื่องมือ</th>
<th><label id='h_eva_create_evaluation_detail_employee_id'>ผู้รับการประเมิน</label></th>
<th><label>ประเภทตำแหน่ง</label></th>
<th><label>ระดับตำแหน่ง</label></th>
<th><label id='h_eva_create_evaluation_detail_chief'>ผู้ประเมิน </label></th>
</tr>
</thead>
<tbody></tbody>

View File

@@ -242,6 +242,19 @@
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th><p id="sum_a"></p></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</tfoot>
</table>
</section>
@@ -259,6 +272,13 @@
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th><p id="sum_b"></p></th>
</tr>
</tfoot>
</table>
</section>

View File

@@ -5,6 +5,56 @@
Layout = "_LayoutDirect";
}
<div class="modal fade" id="eva_idp_planModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_idp_planModelLabel" 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_idp_planModelLabel">บันทึกข้อมูล แผนพัฒนาการปฏิบัติงานรายบุคคล</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_idp_plan_create_evaluation_detail_id" />
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_idp_plan_develop" for="eva_idp_plan_develop">ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา</label>
<textarea class="form-control" rows="4" cols="50" id="eva_idp_plan_develop" iLabel="ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา" iRequire="true" iGroup="eva_idp_plan"></textarea>
</div>
<div class="form-group col-md-6">
<label id="lab_eva_idp_plan_development_method" for="eva_idp_plan_development_method">วิธีการพัฒนา</label>
<textarea class="form-control" rows="4" cols="50" id="eva_idp_plan_development_method" iLabel="วิธีการพัฒนา" iRequire="true" iGroup="eva_idp_plan"></textarea>
</div>
</div>
<div class='row'>
<div class="form-group col-md-6">
<label id="lab_eva_idp_plan_start_date" for="eva_idp_plan_start_date">ช่วงเวลาเริ่มต้นพัฒนา</label>
<input class="form-control" type="text" id="eva_idp_plan_start_date" data-provide="datepicker" data-date-language="th-th" iLabel="ช่วงเวลาเริ่มต้นพัฒนา" iRequire="true" iGroup="eva_idp_plan" />
</div>
<div class="form-group col-md-6">
<label id="lab_eva_idp_plan_end_date" for="eva_idp_plan_end_date">ช่วงเวลาสิ้นสุดพัฒนา</label>
<input class="form-control" type="text" id="eva_idp_plan_end_date" data-provide="datepicker" data-date-language="th-th" iLabel="ช่วงเวลาสิ้นสุดพัฒนา" iRequire="true" iGroup="eva_idp_plan" />
</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_idp_plan_PutUpdate()">บันทึก</button>
</div>
</div>
</div>
</div>
<div class="row page-title">
<div class="col-md-5">
<div class="page-title">
@@ -308,6 +358,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_idp_plan_create_evaluation_detail_id" />
<div class="col-md-3">
<button class="btn btn-info" onclick="javascript:eva_idp_plan_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
</div>
</div>
</div>
<table id="eva_idp_planTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th><label id='h_eva_idp_plan_develop'>ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา</label></th>
<th><label id='h_eva_idp_plan_development_method'>วิธีการพัฒนา</label></th>
<th><label id='h_eva_idp_plan_start_date'>ช่วงเวลาเริ่มต้นพัฒนา</label></th>
<th><label id='h_eva_idp_plan_end_date'>ช่วงเวลาสิ้นสุดพัฒนา</label></th>
</tr>
</thead>
<tbody></tbody>
</table>
</section>
<br/>
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>ความเห็นผู้ประเมิน <span style="color:red;" id="thestatus"></span></div>
@@ -508,6 +590,7 @@
<script src="~/js/eva_create_evaluation_detail_review03/eva_create_evaluation_detail_review03_d.js"></script>
<script src="~/js/eva_create_evaluation_detail_review04/eva_create_evaluation_detail_review04_d.js"></script>
<script src="~/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js"></script>
<script src="~/js/eva_idp_plan/eva_idp_plan.js"></script>
<script>
$(document).ready(function () {
var id = getUrlParameter("id");
@@ -522,6 +605,9 @@
eva_create_evaluation_detail_review04_SetEditForm(id);
eva_create_evaluation_detail_status_SetEditForm(id);
eva_idp_plan_InitiateDataTable(id);
eva_idp_plan_InitialForm();
setTimeout(Oneva_evaluation_achievement_process2_scoreChange, 1000);
setTimeout(Oneva_evaluation_behavior_process2_scoreChange, 1000);
@@ -532,6 +618,7 @@
SetupValidationRemark("eva_create_evaluation_detail_review02");
SetupValidationRemark("eva_create_evaluation_detail_review03");
SetupValidationRemark("eva_create_evaluation_detail_review04");
SetupValidationRemark("eva_idp_plan");
});
</script>
}

View File

@@ -1,7 +1,7 @@
{
"connectionStrings": {
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr2;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;"
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;",
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr;User ID=postgres;Password=project0*;"
},
"IdentityServer": {
"url": "",

View File

@@ -2633,6 +2633,103 @@
<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
</summary>
<param name="repository"></param>
<param name="configuration"></param>
<param name="logger"></param>
</member>
<member name="M:TodoAPI2.Controllers.eva_idp_planController.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_idp_planController.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_idp_planController.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_idp_planController.GetListBySearch(TodoAPI2.Models.eva_idp_planSearchModel)">
<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_idp_planController.Insert(TodoAPI2.Models.eva_idp_planInputModel)">
<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_idp_planController.Update(System.Int32,TodoAPI2.Models.eva_idp_planInputModel)">
<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_idp_planController.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_idp_planController.UpdateMultiple(System.Collections.Generic.List{TodoAPI2.Models.eva_idp_planInputModel})">
<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_level_scoreController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_level_scoreController},TodoAPI2.Models.Ieva_level_scoreService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary>
Default constructure for dependency injection

View File

@@ -6655,6 +6655,7 @@ header.blue-bg .search:focus {
height: 34px;
}
/*-----*/
.is-sidebar-nav-open #sidebar {

View File

@@ -10,7 +10,7 @@ $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val("");
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text("");
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text("");
@@ -31,7 +31,7 @@ $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(data
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(data.total_promote);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).val(data.remark);
$("#eva_adjust_postponement_detail_normal_02_remark_" + i).text(data.remark);
$("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text(data.emp_code);
$("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text(data.emp_fullname);
$("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text(data.emp_position);
@@ -53,7 +53,7 @@ eva_adjust_postponement_detail_normal_02Object.promoted_percentage = obj.find("#
eva_adjust_postponement_detail_normal_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val();
eva_adjust_postponement_detail_normal_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text();
eva_adjust_postponement_detail_normal_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text();
eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).val();
eva_adjust_postponement_detail_normal_02Object.remark = obj.find("#eva_adjust_postponement_detail_normal_02_remark_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_normal_02_emp_code_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_fullname = obj.find("#eva_adjust_postponement_detail_normal_02_emp_fullname_" + i).text();
eva_adjust_postponement_detail_normal_02Object.emp_position = obj.find("#eva_adjust_postponement_detail_normal_02_emp_position_" + i).text();
@@ -103,19 +103,17 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" onchange="Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged()" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><input disabled class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, (i + 1), blankItem);
});
eva_adjust_postponement_detail_normal_02_Summary();
//eva_adjust_postponement_detail_normal_02_Summary();
endLoad();
};
startLoad();
@@ -124,70 +122,15 @@ function eva_adjust_postponement_detail_normal_02_Get(a, blankItem) {
}
function eva_adjust_postponement_detail_normal_02_Add() {
var successFunc = function (result) {
var i = $("#eva_adjust_postponement_detail_normal_02Body tr").length;
var tag = '<tr>';
tag += '<td><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_adjust_postponement_detail_normal_02" value="1" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_adjust_postponement_id_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="hidden" id="eva_adjust_postponement_detail_normal_02_employee_id_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="number" id="eva_adjust_postponement_detail_normal_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_normal_02_remark_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_code_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_normal_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><a href="javascript:;" class="btn btn-danger btn-sm" onclick="javascript:eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(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_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(this)" style="display: none;" id="restoreBtn"><i class="fa fa-upload" style="color:white;"></i></a></td>';
tag += '</tr>';
$('#eva_adjust_postponement_detail_normal_02Body').append($(tag));
eva_adjust_postponement_detail_normal_02_ClearForm(i + 1, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_detail_normal_02/" + "GetBlankItem", successFunc, AlertDanger);
}
function eva_adjust_postponement_detail_normal_02_Removeeva_adjust_postponement_detail_normal_02(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_detail_normal_02_Summary();
}
}
function eva_adjust_postponement_detail_normal_02_Restoreeva_adjust_postponement_detail_normal_02(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_detail_normal_02_Summary();
}
}
function eva_adjust_postponement_detail_normal_02_Summary() {
var sum = 0;
$(".input_score").each(function () {
sum += +$(this).val();
});
$("#score_label").text("ผลรวม: " + sum);
console.log("eva_adjust_postponement_detail_normal_02_Summary()");
//var sum = 0;
//$(".input_score").each(function () {
// sum += +$(this).val();
//});
//$("#score_label").text("ผลรวม: " + sum);
}
function eva_adjust_postponement_detail_normal_02_InitialForm(id) {

View File

@@ -10,7 +10,7 @@ $("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val("");
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text("");
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text("");
@@ -33,7 +33,7 @@ $("#eva_adjust_postponement_detail_quota_02_promoted_percentage_" + i).text(data
$("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text(data.total_promote);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text(data.new_sarary);
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(data.new_cost_living);
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).val(data.remark);
$("#eva_adjust_postponement_detail_quota_02_remark_" + i).text(data.remark);
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(data.receive_quota);
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(data.new_sarary_with_quota);
$("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text(data.emp_code);
@@ -57,7 +57,7 @@ eva_adjust_postponement_detail_quota_02Object.promoted_percentage = obj.find("#e
eva_adjust_postponement_detail_quota_02Object.total_promote = obj.find("#eva_adjust_postponement_detail_quota_02_total_promote_" + i).text();
eva_adjust_postponement_detail_quota_02Object.new_sarary = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text();
eva_adjust_postponement_detail_quota_02Object.new_cost_living = obj.find("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text();
eva_adjust_postponement_detail_quota_02Object.remark = obj.find("#eva_adjust_postponement_detail_quota_02_remark_" + i).val();
eva_adjust_postponement_detail_quota_02Object.remark = obj.find("#eva_adjust_postponement_detail_quota_02_remark_" + i).text();
eva_adjust_postponement_detail_quota_02Object.receive_quota = obj.find("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val();
eva_adjust_postponement_detail_quota_02Object.new_sarary_with_quota = obj.find("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text();
eva_adjust_postponement_detail_quota_02Object.emp_code = obj.find("#eva_adjust_postponement_detail_quota_02_emp_code_" + i).text();
@@ -101,19 +101,21 @@ function eva_adjust_postponement_detail_quota_02_Get(a, blankItem) {
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_fullname_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_position_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_emp_level_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_score_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_eva_result_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_middle_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_promoted_percentage_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_total_promote_' + (i + 1)+'" /><p style="display:none;" id="eva_adjust_postponement_detail_quota_02_new_sarary_' + (i + 1)+'" /></td>';
tag += '<td><input onchange="CalculateRemainQuota();" class="form-control" type="number" id="eva_adjust_postponement_detail_quota_02_receive_quota_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_' + (i + 1)+'" /></td>';
tag += '<td><input class="form-control" type="text" id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_new_cost_living_' + (i + 1)+'" /></td>';
tag += '<td><p id="eva_adjust_postponement_detail_quota_02_remark_' + (i + 1)+'" /></td>';
tag += '</tr>';

View File

@@ -117,23 +117,29 @@ function eva_adjust_postponement_normal_GoDelete(a) {
}
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================
//================= Control Function =========================================
function Oneva_adjust_postponement_normal_limit_frameChange(){
var limit = $("#eva_adjust_postponement_normal_limit").val();
var limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val();
$("#eva_adjust_postponement_normal_limit_quota").val(limit*limit_frame/100);
limit_frame = Math.round(limit_frame*100)/100;
$("#eva_adjust_postponement_normal_limit_frame").val(limit_frame);
$("#eva_adjust_postponement_normal_limit_quota").val(Math.round((limit*limit_frame/100)*100)/100);
}
function Oneva_adjust_postponement_normal_percentageChange(){
var percentage = $("#eva_adjust_postponement_normal_percentage").val();
percentage = Math.round(percentage*100)/100;
$("#eva_adjust_postponement_normal_percentage").val(percentage)
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
});
Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged();
}
function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(){
var current_quota = $("#eva_adjust_postponement_normal_limit_quota").val();
var sum_postpone = 0;
@@ -141,18 +147,27 @@ function Oneva_adjust_postponement_normal_percentageChange(){
$('#eva_adjust_postponement_detail_normal_02Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var percentage = $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val();
percentage = Math.round(percentage*100)/100;
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text());
var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text());
var new_salary = parseFloat(old_salary + (percentage * middle));
$("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(percentage * middle);
var new_added = Math.ceil(((percentage * middle)/100)/10)*10;
var new_salary = parseFloat(old_salary + new_added);
$("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(new_added);
$("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(new_salary);
sum_postpone += percentage * middle;
if(new_salary < 13285){
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(1000);
}else{
$("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(0);
}
sum_postpone += new_added;
});
$("#remain_cost").val(current_quota - sum_postpone);
$("#remain_cost").val(Math.round((current_quota - sum_postpone)*100)/100);
}

View File

@@ -121,7 +121,14 @@ function eva_adjust_postponement_quota_GoDelete(a) {
function Oneva_adjust_postponement_quota_limit_frame_quotaChange()
{
var limit_frame_quota = parseFloat($("#eva_adjust_postponement_quota_limit_frame_quota").val());
limit_frame_quota = Math.round(limit_frame_quota * 100) / 100;
if(limit_frame_quota < 0) limit_frame_quota = 0;
$("#eva_adjust_postponement_quota_limit_frame_quota").val(limit_frame_quota);
var limit = parseFloat($("#eva_adjust_postponement_quota_limit").val());
limit = Math.round(limit * 100)/100;
$("#eva_adjust_postponement_quota_limit").val(limit);
limit_quota = limit_frame_quota * limit / 100;
$("#eva_adjust_postponement_quota_limit_quota").val(limit_quota);
CalculateRemainQuota();
@@ -136,8 +143,20 @@ function CalculateRemainQuota(){
var i = $(this).find("#rowCount").text();
var new_sarary = parseFloat($("#eva_adjust_postponement_detail_quota_02_new_sarary_" + i).text());
var receive_quota = parseFloat($("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val());
receive_quota = Math.round(receive_quota*100)/100;
if(receive_quota < 0) receive_quota = 0;
$("#eva_adjust_postponement_detail_quota_02_receive_quota_" + i).val(receive_quota);
var new_sarary_with_quota = new_sarary + receive_quota;
$("#eva_adjust_postponement_detail_quota_02_new_sarary_with_quota_" + i).text(new_sarary_with_quota);
if(new_sarary_with_quota < 13285){
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(1000);
}else{
$("#eva_adjust_postponement_detail_quota_02_new_cost_living_" + i).text(0);
}
sum_receive_quota += receive_quota;
});

View File

@@ -166,7 +166,7 @@ var eva_create_evaluation_setupTable = function (result) {
"columns": [
{ "data": "id" },
{ "data": "performance_plan_id_eva_performance_plan_fiscal_year" },
{ "data": "evaluation_group_id_eva_evaluation_group_code" },
{ "data": "evaluation_group_id_eva_evaluation_group_name" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "score1" },
{ "data": "score2" },

View File

@@ -160,7 +160,10 @@ var eva_create_evaluation_detail_setupTable = function (result) {
"columns": [
{ "data": "id" },
{ "data": "employee_id_external_linkage_external_name" },
{ "data": "position_type_text" },
{ "data": "position_level_text" },
{ "data": "chief_external_linkage_external_name" },
],
"columnDefs": [
{

View File

@@ -163,6 +163,12 @@ var eva_evaluation_achievementTableV;
var eva_evaluation_achievement_setupTable = function (result) {
tmp = '"';
var sum_a = 0;
$.each(result, function( k, v ) {
sum_a += v.weight;
});
$("#sum_a").text(sum_a);
eva_evaluation_achievementTableV = $('#eva_evaluation_achievementTable').DataTable({
"processing": true,
"serverSide": false,

View File

@@ -6,11 +6,11 @@ $("#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("");
$("#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("");
}
@@ -22,11 +22,11 @@ $("#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);
$("#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);
}

View File

@@ -8,11 +8,11 @@ $("#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("");
$("#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("");
}
@@ -26,11 +26,11 @@ $("#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);
$("#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);
}
@@ -120,8 +120,10 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
var total_achievement = 0;
var total_achievement_weight = 0;
var total_achievement_score = 0;
var total_achievement_score_old = 0;
$('#eva_evaluation_achievement_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score_old = $("#eva_evaluation_achievement_process2_score_" + i).text();
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);
@@ -129,9 +131,12 @@ function Oneva_evaluation_achievement_process2_scoreChange(){
total_achievement += parseFloat(total);
total_achievement_weight += parseFloat(weight);
total_achievement_score += parseFloat(score);
total_achievement_score_old += parseFloat(score_old);
console.log(score_old);
});
$("#h_eva_evaluation_achievement_process2_weight").text(total_achievement_weight.toFixed(2));
$("#h_eva_evaluation_achievement_process2_score2").text(total_achievement_score.toFixed(2));
$("#h_eva_evaluation_achievement_process2_score").text(total_achievement_score_old.toFixed(2));
var w1 = parseFloat($("#w1").text());

View File

@@ -149,6 +149,12 @@ var eva_evaluation_behaviorTableV;
var eva_evaluation_behavior_setupTable = function (result) {
tmp = '"';
var sum_b = 0;
$.each(result, function( k, v ) {
sum_b += v.weight;
});
$("#sum_b").text(sum_b);
eva_evaluation_behaviorTableV = $('#eva_evaluation_behaviorTable').DataTable({
"processing": true,
"serverSide": false,

View File

@@ -116,18 +116,22 @@ function Oneva_evaluation_behavior_process2_scoreChange(){
var total_behavior = 0;
var total_behavior_weight = 0;
var total_behavior_score = 0;
var total_behavior_score_old = 0;
$('#eva_evaluation_behavior_process2Body tr').each(function () {
var i = $(this).find("#rowCount").text();
var score = $("#eva_evaluation_behavior_process2_score2_" + i).val();
var score_old = $("#eva_evaluation_behavior_process2_score_" + i).text();
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);
total_behavior_score_old += parseFloat(score_old);
});
$("#h_eva_evaluation_behavior_process2_weight").text(total_behavior_weight.toFixed(2));
$("#h_eva_evaluation_behavior_process2_score2").text(total_behavior_score.toFixed(2));
$("#h_eva_evaluation_behavior_process2_score").text(total_behavior_score_old.toFixed(2));
var w2 = parseFloat($("#w2").text());

View File

@@ -0,0 +1,217 @@
var eva_idp_plan_editMode = "CREATE";
var eva_idp_plan_API = "/api/eva_idp_plan/";
//================= Search Customizaiton =========================================
function eva_idp_plan_GetSearchParameter() {
var eva_idp_planSearchObject = new Object();
eva_idp_planSearchObject.create_evaluation_detail_id = getUrlParameter("id");
return eva_idp_planSearchObject;
}
function eva_idp_plan_FeedDataToSearchForm(data) {
$("#s_eva_idp_plan_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
}
//================= Form Data Customizaiton =========================================
function eva_idp_plan_FeedDataToForm(data) {
$("#eva_idp_plan_id").val(data.id);
$("#eva_idp_plan_create_evaluation_detail_id").val(data.create_evaluation_detail_id);
$("#eva_idp_plan_develop").val(data.develop);
$("#eva_idp_plan_development_method").val(data.development_method);
$("#eva_idp_plan_start_date").val(formatDate(data.start_date));
$("#eva_idp_plan_end_date").val(formatDate(data.end_date));
}
function eva_idp_plan_GetFromForm() {
var eva_idp_planObject = new Object();
eva_idp_planObject.id = $("#eva_idp_plan_id").val();
eva_idp_planObject.create_evaluation_detail_id = getUrlParameter("id");
eva_idp_planObject.develop = $("#eva_idp_plan_develop").val();
eva_idp_planObject.development_method = $("#eva_idp_plan_development_method").val();
eva_idp_planObject.start_date = getDate($("#eva_idp_plan_start_date").val());
eva_idp_planObject.end_date = getDate($("#eva_idp_plan_end_date").val());
return eva_idp_planObject;
}
function eva_idp_plan_InitialForm(s) {
var successFunc = function (result) {
eva_idp_plan_FeedDataToForm(result);
eva_idp_plan_FeedDataToSearchForm(result);
if (s) {
// Incase model popup
$("#eva_idp_planModel").modal("show");
}
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_idp_plan_API + "GetBlankItem", successFunc, AlertDanger);
}
//================= Form Mode Setup and Flow =========================================
function eva_idp_plan_GoCreate() {
// Incase model popup
eva_idp_plan_SetCreateForm(true);
// Incase open new page
//window_open(appsite + "/eva_idp_planView/eva_idp_plan_d");
}
function eva_idp_plan_GoEdit(a) {
// Incase model popup
eva_idp_plan_SetEditForm(a);
// Incase open new page
//window_open(appsite + "/eva_idp_planView/eva_idp_plan_d?id=" + a);
}
function eva_idp_plan_SetEditForm(a) {
var successFunc = function (result) {
eva_idp_plan_editMode = "UPDATE";
eva_idp_plan_FeedDataToForm(result);
$("#eva_idp_planModel").modal("show");
endLoad();
};
startLoad();
AjaxGetRequest(apisite + eva_idp_plan_API + a, successFunc, AlertDanger);
}
function eva_idp_plan_SetCreateForm(s) {
eva_idp_plan_editMode = "CREATE";
eva_idp_plan_InitialForm(s);
}
function eva_idp_plan_RefreshTable() {
// Incase model popup
eva_idp_plan_DoSearch();
// Incase open new page
//window.parent.eva_idp_plan_DoSearch();
}
//================= Update and Delete =========================================
var eva_idp_plan_customValidation = function (group) {
return "";
};
function eva_idp_plan_PutUpdate() {
if (!ValidateForm('eva_idp_plan', eva_idp_plan_customValidation))
{
return;
}
var data = eva_idp_plan_GetFromForm();
//Update Mode
if (eva_idp_plan_editMode === "UPDATE") {
var successFunc1 = function (result) {
$("#eva_idp_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_idp_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_idp_plan_API + data.id, data, successFunc1, AlertDanger);
}
// Create mode
else {
var successFunc2 = function (result) {
$("#eva_idp_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_idp_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxPostRequest(apisite + eva_idp_plan_API, data, successFunc2, AlertDanger);
}
}
function eva_idp_plan_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) {
$("#eva_idp_planModel").modal("hide");
AlertSuccess(result.code+" "+result.message);
eva_idp_plan_RefreshTable();
endLoad();
};
startLoad();
AjaxDeleteRequest(apisite + eva_idp_plan_API + a, null, successFunc, AlertDanger);
}
}
//================= Data Table =========================================
var eva_idp_planTableV;
var eva_idp_plan_setupTable = function (result) {
tmp = '"';
eva_idp_planTableV = $('#eva_idp_planTable').DataTable({
"processing": true,
"serverSide": false,
"data": result,
"select": false,
"columns": [
{ "data": "id" },
{ "data": "develop" },
{ "data": "development_method" },
{ "data": "txt_start_date" },
{ "data": "txt_end_date" },
],
"columnDefs": [
{
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_idp_plan_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_idp_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_idp_plan_InitiateDataTable() {
startLoad();
var p = $.param(eva_idp_plan_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_idp_plan/GetListBySearch?"+p, eva_idp_plan_setupTable, AlertDanger);
}
function eva_idp_plan_DoSearch() {
var p = $.param(eva_idp_plan_GetSearchParameter());
var eva_idp_plan_reload = function (result) {
eva_idp_planTableV.destroy();
eva_idp_plan_setupTable(result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_idp_plan/GetListBySearch?"+p, eva_idp_plan_reload, AlertDanger);
}
function eva_idp_plan_GetSelect(f) {
var eva_idp_plan_selectitem = [];
$.each(eva_idp_planTableV.rows('.selected').data(), function (key, value) {
eva_idp_plan_selectitem.push(value[f]);
});
alert(eva_idp_plan_selectitem);
}
//================= File Upload =========================================
//================= Multi-Selection Function =========================================

View File

@@ -3,49 +3,68 @@
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
vertical-align: middle;
}
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 28px;
user-select: none;
-webkit-user-select: none; }
-webkit-user-select: none;
}
.select2-container .select2-selection--single .select2-selection__rendered {
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
white-space: nowrap;
}
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
position: relative;
}
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
padding-left: 20px;
}
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
-webkit-user-select: none;
}
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
white-space: nowrap;
}
.select2-container .select2-search--inline {
float: left; }
float: left;
}
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
padding: 0;
}
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
-webkit-appearance: none;
}
.select2-dropdown {
background-color: white;
@@ -56,52 +75,67 @@
position: absolute;
left: -100000px;
width: 100%;
z-index: 12000; }
z-index: 12000;
}
.select2-results {
display: block; }
display: block;
}
.select2-results__options {
list-style: none;
margin: 0;
padding: 0; }
padding: 0;
}
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
-webkit-user-select: none;
}
.select2-results__option[aria-selected] {
cursor: pointer; }
cursor: pointer;
}
.select2-container--open {
z-index: 9999999
}
.select2-container--open .select2-dropdown {
.select2-container--open .select2-dropdown {
left: 0;
}
}
.select2-container--open .select2-dropdown--above {
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
border-bottom-right-radius: 0;
}
.select2-container--open .select2-dropdown--below {
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
border-top-right-radius: 0;
}
.select2-search--dropdown {
display: block;
padding: 4px; }
padding: 4px;
}
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
box-sizing: border-box;
}
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
-webkit-appearance: none;
}
.select2-search--dropdown.select2-search--hide {
display: none; }
display: none;
}
.select2-close-mask {
border: 0;
@@ -118,7 +152,8 @@
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
filter: alpha(opacity=0);
}
.select2-hidden-accessible {
border: 0 !important;
@@ -130,27 +165,38 @@
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important; }
white-space: nowrap !important;
}
.select2-container--default .select2-selection--single {
background-color: #fff;
border: 1px solid #aaa;
border-radius: 4px; }
border-radius: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
font-weight: bold;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
color: #999;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
width: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
@@ -161,45 +207,60 @@
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
width: 0;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
float: left;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
right: auto;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
display: none;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
border-width: 0 4px 5px 4px;
}
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text; }
cursor: text;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
width: 100%;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
list-style: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px;
padding: 1px; }
padding: 1px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
@@ -208,97 +269,131 @@
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
padding: 0 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
margin-right: 2px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
color: #333;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
float: right;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
margin-right: auto;
}
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
margin-right: auto;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
outline: 0;
}
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
cursor: default;
}
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
display: none;
}
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
border-top-right-radius: 0;
}
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
border-bottom-right-radius: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa; }
border: 1px solid #aaa;
}
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
-webkit-appearance: textfield;
}
.select2-container--default .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
overflow-y: auto;
}
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
padding: 0;
}
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
color: #999;
}
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; }
background-color: #ddd;
}
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
padding-left: 1em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
padding-left: 0;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
padding-left: 2em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
padding-left: 3em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
padding-left: 4em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
padding-left: 5em;
}
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
padding-left: 6em;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #5897fb;
color: white; }
color: white;
}
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
padding: 6px;
}
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
@@ -309,19 +404,29 @@
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
}
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
border: 1px solid #5897fb;
}
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 28px; }
line-height: 28px;
}
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
margin-right: 10px;
}
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
color: #999;
}
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
@@ -337,7 +442,9 @@
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0);
}
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
@@ -348,10 +455,12 @@
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
width: 0;
}
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
float: left;
}
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
@@ -360,16 +469,22 @@
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
left: 1px;
right: auto; }
right: auto;
}
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
border: 1px solid #5897fb;
}
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
border: none;
}
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
border-width: 0 4px 5px 4px;
}
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
@@ -379,7 +494,8 @@
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0);
}
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
@@ -389,22 +505,31 @@
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0);
}
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 4px;
cursor: text;
outline: 0; }
outline: 0;
}
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
border: 1px solid #5897fb;
}
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
padding: 0 5px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
display: none;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
@@ -413,74 +538,95 @@
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
padding: 0 5px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
margin-right: 2px;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
color: #555;
}
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right;
margin-left: 5px;
margin-right: auto; }
margin-right: auto;
}
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
margin-right: auto;
}
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
border: 1px solid #5897fb;
}
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
border-top-right-radius: 0;
}
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
border-bottom-right-radius: 0;
}
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
outline: 0;
}
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
box-shadow: none;
}
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
border: 1px solid transparent;
}
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
border-bottom: none;
}
.select2-container--classic .select2-dropdown--below {
border-top: none; }
border-top: none;
}
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
overflow-y: auto;
}
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
padding: 0;
}
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
color: grey;
}
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
color: white;
}
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
padding: 6px;
}
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }
border-color: #5897fb;
}