From 9ffe9c30d38cfe557ce63466479e5b20b24974e4 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Sun, 5 Apr 2020 22:57:02 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=A7=E0=B8=A1=20code=20=E0=B8=88?= =?UTF-8?q?=E0=B8=B2=E0=B8=81=E0=B8=97=E0=B8=B8=E0=B8=81=E0=B8=84=E0=B8=99?= =?UTF-8?q?=20=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=E0=B9=84=E0=B8=82=20op=20=E0=B8=A5=E0=B9=88=E0=B8=B2=E0=B8=AA?= =?UTF-8?q?=E0=B8=B8=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiControllers/eva_idp_planControllers.cs | 321 +++++++ EF/DataContext.cs | 1 + EXCEL/eva_idp_plan.xlsx | Bin 0 -> 10631 bytes Migrations/25630405153506_idp.Designer.cs | 627 ++++++++++++ Migrations/25630405153506_idp.cs | 36 + Migrations/DataContextModelSnapshot.cs | 27 + ...djust_postponement_detail_normalService.cs | 18 +- ...st_postponement_detail_normal_02Service.cs | 2 +- ...ust_postponement_detail_quota_02Service.cs | 8 +- .../eva_create_evaluationService.cs | 50 +- .../eva_create_evaluation_detailService.cs | 3 + .../eva_create_evaluation_detailViewModel.cs | 2 + ...create_evaluation_detail_processService.cs | 6 +- Models/eva_idp_plan/Ieva_idp_planService.cs | 28 + Models/eva_idp_plan/eva_idp_planEntity.cs | 33 + Models/eva_idp_plan/eva_idp_planInputModel.cs | 32 + .../eva_idp_planReportRequestModel.cs | 21 + .../eva_idp_plan/eva_idp_planSearchModel.cs | 23 + Models/eva_idp_plan/eva_idp_planService.cs | 232 +++++ Models/eva_idp_plan/eva_idp_planViewModel.cs | 33 + .../eva_idp_planWithSelectionViewModel.cs | 12 + .../external_employeeService.cs | 23 +- .../external_employeeViewModel.cs | 25 +- Startup.cs | 7 + Views/Shared/_Layout.cshtml | 7 + Views/Shared/_LayoutDirect.cshtml | 9 +- .../eva_adjust_postponement_quota_d.cshtml | 17 +- .../eva_create_evaluation_d.cshtml | 3 +- ...reate_evaluation_detail_agreement_d.cshtml | 20 + ...create_evaluation_detail_process_d2.cshtml | 87 ++ appsettings.Development.json | 4 +- tb320eva.xml | 97 ++ wwwroot/BackendScript/css/style.css | 1 + ...st_postponement_detail_normal_02_inline.js | 81 +- ...ust_postponement_detail_quota_02_inline.js | 20 +- .../eva_adjust_postponement_normal_d.js | 43 +- .../eva_adjust_postponement_quota_d.js | 19 + .../eva_create_evaluation.js | 2 +- .../eva_create_evaluation_detail.js | 5 +- .../eva_evaluation_achievement.js | 6 + ...a_evaluation_achievement_process_inline.js | 20 +- ..._evaluation_achievement_process2_inline.js | 25 +- .../eva_evaluation_behavior.js | 6 + ...eva_evaluation_behavior_process2_inline.js | 6 +- wwwroot/js/eva_idp_plan/eva_idp_plan.js | 217 +++++ wwwroot/select2/css/select2.css | 900 ++++++++++-------- 46 files changed, 2636 insertions(+), 529 deletions(-) create mode 100644 ApiControllers/eva_idp_planControllers.cs create mode 100644 EXCEL/eva_idp_plan.xlsx create mode 100644 Migrations/25630405153506_idp.Designer.cs create mode 100644 Migrations/25630405153506_idp.cs create mode 100644 Models/eva_idp_plan/Ieva_idp_planService.cs create mode 100644 Models/eva_idp_plan/eva_idp_planEntity.cs create mode 100644 Models/eva_idp_plan/eva_idp_planInputModel.cs create mode 100644 Models/eva_idp_plan/eva_idp_planReportRequestModel.cs create mode 100644 Models/eva_idp_plan/eva_idp_planSearchModel.cs create mode 100644 Models/eva_idp_plan/eva_idp_planService.cs create mode 100644 Models/eva_idp_plan/eva_idp_planViewModel.cs create mode 100644 Models/eva_idp_plan/eva_idp_planWithSelectionViewModel.cs create mode 100644 wwwroot/js/eva_idp_plan/eva_idp_plan.js diff --git a/ApiControllers/eva_idp_planControllers.cs b/ApiControllers/eva_idp_planControllers.cs new file mode 100644 index 0000000..8f322a2 --- /dev/null +++ b/ApiControllers/eva_idp_planControllers.cs @@ -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 _logger; + private Ieva_idp_planService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public eva_idp_planController(ILogger logger, Ieva_idp_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + /// + /// Get specific item by id + /// + /// + /// + /// Return Get specific item by id + /// Returns the item + /// Error Occurred + [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}"); + } + } + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [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}"); + } + } + + /// + /// Get list items by create_evaluation_detail_id + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("")] + [ProducesResponseType(typeof(List), 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}"); + } + } + + /// + /// Get list items by search + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("GetListBySearch")] + [ProducesResponseType(typeof(List), 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}"); + } + } + + + /// + /// Create new item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + /// + /// Update item + /// + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + /// + /// Delete item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [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); + } + + /// + /// Update multiple item + /// + /// + /// + /// + /// Response Result Message + /// Response Result Message + /// If the model is invalid + /// Error Occurred + [HttpPut("UpdateMultiple")] + [ProducesResponseType(typeof(CommonResponseMessage), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult UpdateMultiple([FromBody] List 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); + } + + + } +} diff --git a/EF/DataContext.cs b/EF/DataContext.cs index 1e86be9..f15795c 100644 --- a/EF/DataContext.cs +++ b/EF/DataContext.cs @@ -37,6 +37,7 @@ namespace TTSW.EF { public DbSet eva_adjust_postponement_detail { get; set; } //public DbSet eva_adjust_postponement_detail_normal { get; set; } + public DbSet eva_idp_plan { get; set; } protected override void OnModelCreating (ModelBuilder modelBuilder) { base.OnModelCreating (modelBuilder); diff --git a/EXCEL/eva_idp_plan.xlsx b/EXCEL/eva_idp_plan.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..1d0fdddf1627005dc57456806ca89af38c342e0a GIT binary patch literal 10631 zcmeHtg;yL~_H{$!PVfN1-3e|%f@^RM+PKpJIs}Ktoj{Oa!QEX01eYMeAwdGc-2=bQ zdoz=H%=^B7V5VxVs#UA%?5ca~>~rqj=c*|J5%2*>02BZKKn0NC4;XWV0{{>Z0RTJz z3cP`olOq`92sYM)ID_1b*gYNWDRU6u8M6TJu;>4`{TKH@spf#=M^2nJo$Y7O+qJ{8 zLyC)0$ePIvXt$8xdB*F~)^Ct7-g+}wzR;>d>7sjKKW0FGB0^j?Pp>B_zGlyUt*1(B zf?g0+=6WRhQ!Z0FAh%RIswOsqH;Wka-~ef|4q2&j-i+Or`ktDOkhd1?>1Nll$`8qs z&}UL~ZOq?`;jdopRYvuK?jBkYlKF3CCWvNbAdovb?Z_b=p zb5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P8xjDBfYs3c b^-ceX+iHr4FdqZ}Fkm}9%#9W4e_j0_FxzCG literal 0 HcmV?d00001 diff --git a/Migrations/25630405153506_idp.Designer.cs b/Migrations/25630405153506_idp.Designer.cs new file mode 100644 index 0000000..3057cf9 --- /dev/null +++ b/Migrations/25630405153506_idp.Designer.cs @@ -0,0 +1,627 @@ +// +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("id"); + + b.Property("command_no") + .HasMaxLength(100); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("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("id"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("sarary"); + + b.Property("total_promote"); + + b.Property("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("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("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("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_supervisor"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("chief"); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_supervisor"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("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("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("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("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("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("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("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 + } + } +} diff --git a/Migrations/25630405153506_idp.cs b/Migrations/25630405153506_idp.cs new file mode 100644 index 0000000..e296bde --- /dev/null +++ b/Migrations/25630405153506_idp.cs @@ -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(nullable: false), + created = table.Column(nullable: false), + updated = table.Column(nullable: false), + isActive = table.Column(nullable: false), + create_evaluation_detail_id = table.Column(nullable: true), + develop = table.Column(maxLength: 1000, nullable: true), + development_method = table.Column(maxLength: 1000, nullable: true), + start_date = table.Column(nullable: true), + end_date = table.Column(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"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 9060f1e..48a8095 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -389,6 +389,33 @@ namespace tb320eva.Migrations b.ToTable("eva_evaluation_group_detail"); }); + modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => { b.Property("id") diff --git a/Models/eva_adjust_postponement_detail_normal/eva_adjust_postponement_detail_normalService.cs b/Models/eva_adjust_postponement_detail_normal/eva_adjust_postponement_detail_normalService.cs index 37cf1dd..184e4bd 100644 --- a/Models/eva_adjust_postponement_detail_normal/eva_adjust_postponement_detail_normalService.cs +++ b/Models/eva_adjust_postponement_detail_normal/eva_adjust_postponement_detail_normalService.cs @@ -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 @@ -262,21 +264,23 @@ namespace TodoAPI2.Models } var c = getCylinderForEmployee(theemp, cylinder); - - n.cost_living = 0; - n.middle = 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; diff --git a/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs b/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs index 88ffb0f..c7a3f13 100644 --- a/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs +++ b/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs @@ -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() diff --git a/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs b/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs index fd077d4..014a68e 100644 --- a/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs +++ b/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs @@ -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() diff --git a/Models/eva_create_evaluation/eva_create_evaluationService.cs b/Models/eva_create_evaluation/eva_create_evaluationService.cs index 2735540..2c392ca 100644 --- a/Models/eva_create_evaluation/eva_create_evaluationService.cs +++ b/Models/eva_create_evaluation/eva_create_evaluationService.cs @@ -22,15 +22,18 @@ namespace TodoAPI2.Models private IBaseRepository2 _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 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; diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs index ffd05b0..befbb31 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs @@ -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 diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs index 7d37e1b..c7b95c1 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs @@ -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; } } } \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs index 6d94ed5..1d82072 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs @@ -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, diff --git a/Models/eva_idp_plan/Ieva_idp_planService.cs b/Models/eva_idp_plan/Ieva_idp_planService.cs new file mode 100644 index 0000000..de61091 --- /dev/null +++ b/Models/eva_idp_plan/Ieva_idp_planService.cs @@ -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 + { + new eva_idp_planViewModel Insert(eva_idp_planInputModel model); + new eva_idp_planViewModel Update(int id, eva_idp_planInputModel model); + List GetListBycreate_evaluation_detail_id(int? create_evaluation_detail_id); + List GetListBySearch(eva_idp_planSearchModel model); + + string UpdateMultiple(List model); + eva_idp_planWithSelectionViewModel GetWithSelection(int id); + eva_idp_planWithSelectionViewModel GetBlankItem(); + + + + } +} + diff --git a/Models/eva_idp_plan/eva_idp_planEntity.cs b/Models/eva_idp_plan/eva_idp_planEntity.cs new file mode 100644 index 0000000..b6b36e8 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planEntity.cs @@ -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 + { + + + 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; } + + + } +} diff --git a/Models/eva_idp_plan/eva_idp_planInputModel.cs b/Models/eva_idp_plan/eva_idp_planInputModel.cs new file mode 100644 index 0000000..72fb3c1 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planInputModel.cs @@ -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; } + } +} + diff --git a/Models/eva_idp_plan/eva_idp_planReportRequestModel.cs b/Models/eva_idp_plan/eva_idp_planReportRequestModel.cs new file mode 100644 index 0000000..4dea0e9 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planReportRequestModel.cs @@ -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); } } + } +} + diff --git a/Models/eva_idp_plan/eva_idp_planSearchModel.cs b/Models/eva_idp_plan/eva_idp_planSearchModel.cs new file mode 100644 index 0000000..d0e9fbd --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planSearchModel.cs @@ -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; } + + } +} + diff --git a/Models/eva_idp_plan/eva_idp_planService.cs b/Models/eva_idp_plan/eva_idp_planService.cs new file mode 100644 index 0000000..8fd3250 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planService.cs @@ -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 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public eva_idp_planService(IBaseRepository2 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(model); + } + private List GetEntityList(List models) + { + return Mapper.Map>(models); + } + private eva_idp_planViewModel GetDto(eva_idp_planEntity entity) + { + return Mapper.Map(entity); + } + private List GetDtoList(List entities) + { + return Mapper.Map>(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(entity); + + + return i; + } + public eva_idp_planWithSelectionViewModel GetBlankItem() + { + var i = new eva_idp_planWithSelectionViewModel(); + + + return i; + } + + public List 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 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 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 + } +} \ No newline at end of file diff --git a/Models/eva_idp_plan/eva_idp_planViewModel.cs b/Models/eva_idp_plan/eva_idp_planViewModel.cs new file mode 100644 index 0000000..cf124f8 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planViewModel.cs @@ -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 + { + + 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); } } + + + } +} \ No newline at end of file diff --git a/Models/eva_idp_plan/eva_idp_planWithSelectionViewModel.cs b/Models/eva_idp_plan/eva_idp_planWithSelectionViewModel.cs new file mode 100644 index 0000000..33ccbc7 --- /dev/null +++ b/Models/eva_idp_plan/eva_idp_planWithSelectionViewModel.cs @@ -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 + { + + } +} \ No newline at end of file diff --git a/Models/external_employee/external_employeeService.cs b/Models/external_employee/external_employeeService.cs index 3f0cd0b..0a6484a 100644 --- a/Models/external_employee/external_employeeService.cs +++ b/Models/external_employee/external_employeeService.cs @@ -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,14 +175,14 @@ 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"]); - } + } result.Add(i); } diff --git a/Models/external_employee/external_employeeViewModel.cs b/Models/external_employee/external_employeeViewModel.cs index 80aa21e..f777373 100644 --- a/Models/external_employee/external_employeeViewModel.cs +++ b/Models/external_employee/external_employeeViewModel.cs @@ -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; + } + } + } } -} \ No newline at end of file +} + + diff --git a/Startup.cs b/Startup.cs index a92a1de..9f6d4d9 100644 --- a/Startup.cs +++ b/Startup.cs @@ -286,6 +286,9 @@ namespace Test01 services.AddScoped(); + services.AddScoped, BaseRepository2>(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -489,6 +492,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 7bc31c5..453c518 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -219,6 +219,13 @@ + diff --git a/Views/Shared/_LayoutDirect.cshtml b/Views/Shared/_LayoutDirect.cshtml index d99bb7e..48122d0 100644 --- a/Views/Shared/_LayoutDirect.cshtml +++ b/Views/Shared/_LayoutDirect.cshtml @@ -109,7 +109,7 @@
  • - + ออกจากระบบ @@ -202,6 +202,13 @@ + diff --git a/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d.cshtml b/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d.cshtml index 30541b6..2784821 100644 --- a/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d.cshtml +++ b/Views/eva_adjust_postponement_quotaView/eva_adjust_postponement_quota_d.cshtml @@ -67,13 +67,13 @@
    - - + +
    - - + +
    @@ -106,19 +106,20 @@ - - + + + + - - + diff --git a/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml b/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml index c2be239..8ec6ae5 100644 --- a/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml +++ b/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml @@ -167,8 +167,9 @@ เครื่องมือ + + - diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml index 6f3d310..142dbd5 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml @@ -242,6 +242,19 @@ + + +   +   +

    +   +   +   +   +   +   + + @@ -259,6 +272,13 @@ + + +   +   +

    + + diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index 2cbca21..8e685e0 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -5,6 +5,56 @@ Layout = "_LayoutDirect"; } + +
    @@ -308,6 +358,38 @@
    +
    +
    แผนพัฒนาการปฏิบัติงานรายบุคคล
    + +
    +
    + + + +
    + +
    + +
    +
    + + + + + + + + + + + + + +
    เครื่องมือ
    +
    + +
    +
    ความเห็นผู้ประเมิน
    @@ -508,6 +590,7 @@ + } diff --git a/appsettings.Development.json b/appsettings.Development.json index 52aa449..15a0255 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -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": "", diff --git a/tb320eva.xml b/tb320eva.xml index a06e0f6..eb72e28 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -2633,6 +2633,103 @@ If the model is invalid Error Occurred + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by create_evaluation_detail_id + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + Default constructure for dependency injection diff --git a/wwwroot/BackendScript/css/style.css b/wwwroot/BackendScript/css/style.css index d87d9aa..c68c95b 100644 --- a/wwwroot/BackendScript/css/style.css +++ b/wwwroot/BackendScript/css/style.css @@ -6655,6 +6655,7 @@ header.blue-bg .search:focus { height: 34px; } + /*-----*/ .is-sidebar-nav-open #sidebar { diff --git a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js index 47f982f..f1ee568 100644 --- a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js +++ b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js @@ -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 += '

    '; tag += '

    '; tag += '

    '; - tag += ''; + tag += ''; tag += ''; tag += '

    '; tag += '

    '; - tag += ''; - - + tag += '

    '; tag += ''; $('#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 = ''; - tag += ''; - tag += ''; - tag += ''; - tag += ''; - tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += ''; - tag += ''; - tag += '

    '; - tag += '

    '; - tag += ''; - tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += ''; - tag += ''; - - $('#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) { diff --git a/wwwroot/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js b/wwwroot/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js index 277c099..9842463 100644 --- a/wwwroot/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js +++ b/wwwroot/js/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02_inline.js @@ -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 += '

    '; tag += '

    '; tag += '

    '; - tag += '

    '; - tag += '

    '; tag += '

    '; tag += '

    '; + + tag += '

    '; + tag += '

    '; + tag += '

    '; tag += '

    '; - tag += '

    '; - tag += '

    '; - tag += '

    '; + tag += '

    '; - tag += ''; + tag += '

    '; + tag += '

    '; tag += ''; diff --git a/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js b/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js index 02d6761..4246d64 100644 --- a/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js +++ b/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js @@ -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); } diff --git a/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js b/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js index 941d79a..7c51b69 100644 --- a/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js +++ b/wwwroot/js/eva_adjust_postponement_quota/eva_adjust_postponement_quota_d.js @@ -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; }); diff --git a/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js b/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js index ba7feee..36abda4 100644 --- a/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js +++ b/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js @@ -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" }, diff --git a/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail.js b/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail.js index 608c4a9..c1d2d9f 100644 --- a/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail.js +++ b/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail.js @@ -160,7 +160,10 @@ var eva_create_evaluation_detail_setupTable = function (result) { "columns": [ { "data": "id" }, { "data": "employee_id_external_linkage_external_name" }, - { "data": "chief_external_linkage_external_name" }, +{ "data": "position_type_text" }, +{ "data": "position_level_text" }, + { "data": "chief_external_linkage_external_name" }, + ], "columnDefs": [ { diff --git a/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js b/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js index 2b6a0f8..de2f872 100644 --- a/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js +++ b/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js @@ -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, diff --git a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js index 1a053fa..4c9b515 100644 --- a/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js +++ b/wwwroot/js/eva_evaluation_achievement_process/eva_evaluation_achievement_process_inline.js @@ -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); } diff --git a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js index 7fce365..59b1483 100644 --- a/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js +++ b/wwwroot/js/eva_evaluation_achievement_process2/eva_evaluation_achievement_process2_inline.js @@ -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()); diff --git a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js index 6e64a55..c8e1038 100644 --- a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js +++ b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js @@ -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, diff --git a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js index 45e88e5..111204e 100644 --- a/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js +++ b/wwwroot/js/eva_evaluation_behavior_process2/eva_evaluation_behavior_process2_inline.js @@ -116,19 +116,23 @@ 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()); $("#eva_create_evaluation_detail_summary2_total_summary_competency_supervisor").text((total_behavior*20).toFixed(2)); diff --git a/wwwroot/js/eva_idp_plan/eva_idp_plan.js b/wwwroot/js/eva_idp_plan/eva_idp_plan.js new file mode 100644 index 0000000..dcf104e --- /dev/null +++ b/wwwroot/js/eva_idp_plan/eva_idp_plan.js @@ -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 " "; + } + }], + "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 ========================================= + + + diff --git a/wwwroot/select2/css/select2.css b/wwwroot/select2/css/select2.css index e03d22a..c73e537 100644 --- a/wwwroot/select2/css/select2.css +++ b/wwwroot/select2/css/select2.css @@ -1,486 +1,632 @@ .select2-container { - box-sizing: border-box; - display: inline-block; - margin: 0; - position: relative; - 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; } - .select2-container .select2-selection--single .select2-selection__rendered { - display: block; - padding-left: 8px; - padding-right: 20px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container .select2-selection--single .select2-selection__clear { - position: relative; } - .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { - padding-right: 8px; - 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; } - .select2-container .select2-selection--multiple .select2-selection__rendered { - display: inline-block; - overflow: hidden; - padding-left: 8px; - text-overflow: ellipsis; - white-space: nowrap; } - .select2-container .select2-search--inline { - float: left; } - .select2-container .select2-search--inline .select2-search__field { - box-sizing: border-box; - border: none; - font-size: 100%; - margin-top: 5px; - padding: 0; } - .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } + display: inline-block; + margin: 0; + position: relative; + 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; + } + + .select2-container .select2-selection--single .select2-selection__rendered { + display: block; + padding-left: 8px; + padding-right: 20px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .select2-container .select2-selection--single .select2-selection__clear { + position: relative; + } + + .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { + padding-right: 8px; + 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; + } + + .select2-container .select2-selection--multiple .select2-selection__rendered { + display: inline-block; + overflow: hidden; + padding-left: 8px; + text-overflow: ellipsis; + white-space: nowrap; + } + + .select2-container .select2-search--inline { + float: left; + } + + .select2-container .select2-search--inline .select2-search__field { + box-sizing: border-box; + border: none; + font-size: 100%; + margin-top: 5px; + padding: 0; + } + + .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button { + -webkit-appearance: none; + } .select2-dropdown { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - box-sizing: border-box; - display: block; - position: absolute; - left: -100000px; - width: 100%; - z-index: 12000; } + background-color: white; + border: 1px solid #aaa; + border-radius: 4px; + box-sizing: border-box; + display: block; + position: absolute; + left: -100000px; + width: 100%; + z-index: 12000; +} .select2-results { - display: block; } + display: block; +} .select2-results__options { - list-style: none; - margin: 0; - padding: 0; } + list-style: none; + margin: 0; + padding: 0; +} .select2-results__option { - padding: 6px; - user-select: none; - -webkit-user-select: none; } - .select2-results__option[aria-selected] { - cursor: pointer; } + padding: 6px; + user-select: none; + -webkit-user-select: none; +} + + .select2-results__option[aria-selected] { + cursor: pointer; + } .select2-container--open { z-index: 9999999 } -.select2-container--open .select2-dropdown { - left: 0; -} + .select2-container--open .select2-dropdown { + left: 0; + } -.select2-container--open .select2-dropdown--above { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } + .select2-container--open .select2-dropdown--above { + border-bottom: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } -.select2-container--open .select2-dropdown--below { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; } + .select2-container--open .select2-dropdown--below { + border-top: none; + border-top-left-radius: 0; + border-top-right-radius: 0; + } .select2-search--dropdown { - display: block; - padding: 4px; } - .select2-search--dropdown .select2-search__field { + display: block; padding: 4px; - width: 100%; - box-sizing: border-box; } - .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { - -webkit-appearance: none; } - .select2-search--dropdown.select2-search--hide { - display: none; } +} + + .select2-search--dropdown .select2-search__field { + padding: 4px; + width: 100%; + box-sizing: border-box; + } + + .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button { + -webkit-appearance: none; + } + + .select2-search--dropdown.select2-search--hide { + display: none; + } .select2-close-mask { - border: 0; - margin: 0; - padding: 0; - display: block; - position: fixed; - left: 0; - top: 0; - min-height: 100%; - min-width: 100%; - height: auto; - width: auto; - opacity: 0; - z-index: 99; - background-color: #fff; - filter: alpha(opacity=0); } + border: 0; + margin: 0; + padding: 0; + display: block; + position: fixed; + left: 0; + top: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + opacity: 0; + z-index: 99; + background-color: #fff; + filter: alpha(opacity=0); +} .select2-hidden-accessible { - border: 0 !important; - clip: rect(0 0 0 0) !important; - -webkit-clip-path: inset(50%) !important; - clip-path: inset(50%) !important; - height: 1px !important; - overflow: hidden !important; - padding: 0 !important; - position: absolute !important; - width: 1px !important; - white-space: nowrap !important; } + border: 0 !important; + clip: rect(0 0 0 0) !important; + -webkit-clip-path: inset(50%) !important; + clip-path: inset(50%) !important; + height: 1px !important; + overflow: hidden !important; + padding: 0 !important; + position: absolute !important; + width: 1px !important; + white-space: nowrap !important; +} .select2-container--default .select2-selection--single { - background-color: #fff; - border: 1px solid #aaa; - border-radius: 4px; } - .select2-container--default .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--default .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; } - .select2-container--default .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--default .select2-selection--single .select2-selection__arrow { - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; } - .select2-container--default .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } + background-color: #fff; + border: 1px solid #aaa; + border-radius: 4px; +} + + .select2-container--default .select2-selection--single .select2-selection__rendered { + color: #444; + line-height: 28px; + } + + .select2-container--default .select2-selection--single .select2-selection__clear { + cursor: pointer; + float: right; + font-weight: bold; + } + + .select2-container--default .select2-selection--single .select2-selection__placeholder { + color: #999; + } + + .select2-container--default .select2-selection--single .select2-selection__arrow { + height: 26px; + position: absolute; + top: 1px; + right: 1px; + width: 20px; + } + + .select2-container--default .select2-selection--single .select2-selection__arrow b { + border-color: #888 transparent transparent transparent; + border-style: solid; + border-width: 5px 4px 0 4px; + height: 0; + left: 50%; + margin-left: -4px; + margin-top: -2px; + position: absolute; + top: 50%; + 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; } + left: 1px; + right: auto; +} .select2-container--default.select2-container--disabled .select2-selection--single { - background-color: #eee; - cursor: default; } - .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { - display: none; } + background-color: #eee; + cursor: default; +} + + .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { + 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-color: transparent transparent #888 transparent; + border-width: 0 4px 5px 4px; +} .select2-container--default .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - 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%; } - .select2-container--default .select2-selection--multiple .select2-selection__rendered li { - 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; } - .select2-container--default .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; + background-color: white; border: 1px solid #aaa; border-radius: 4px; - cursor: default; - float: left; - margin-right: 5px; - margin-top: 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; } - .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #333; } + 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%; + } + + .select2-container--default .select2-selection--multiple .select2-selection__rendered li { + 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; + } + + .select2-container--default .select2-selection--multiple .select2-selection__choice { + background-color: #e4e4e4; + border: 1px solid #aaa; + border-radius: 4px; + cursor: default; + float: left; + margin-right: 5px; + margin-top: 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; + } + + .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { + 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-left: 5px; + margin-right: auto; +} .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } + margin-left: 2px; + margin-right: auto; +} .select2-container--default.select2-container--focus .select2-selection--multiple { - border: solid black 1px; - outline: 0; } + border: solid black 1px; + outline: 0; +} .select2-container--default.select2-container--disabled .select2-selection--multiple { - background-color: #eee; - cursor: default; } + background-color: #eee; + 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-left-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-left-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; } + background: transparent; + border: none; + outline: 0; + box-shadow: none; + -webkit-appearance: textfield; +} .select2-container--default .select2-results > .select2-results__options { - max-height: 200px; - overflow-y: auto; } + max-height: 200px; + 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; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__group { - padding-left: 0; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option { - margin-left: -1em; - padding-left: 2em; } - .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { - margin-left: -2em; - 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; } - .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; } - .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: 1em; +} + + .select2-container--default .select2-results__option .select2-results__option .select2-results__group { + padding-left: 0; + } + + .select2-container--default .select2-results__option .select2-results__option .select2-results__option { + margin-left: -1em; + padding-left: 2em; + } + + .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { + margin-left: -2em; + 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; + } + + .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; + } + + .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; + } .select2-container--default .select2-results__option--highlighted[aria-selected] { - background-color: #5897fb; - color: white; } + background-color: #5897fb; + color: white; +} .select2-container--default .select2-results__group { - cursor: default; - display: block; - padding: 6px; } + cursor: default; + display: block; + padding: 6px; +} .select2-container--classic .select2-selection--single { - background-color: #f7f7f7; - border: 1px solid #aaa; - border-radius: 4px; - outline: 0; - background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); - 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); } - .select2-container--classic .select2-selection--single:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--single .select2-selection__rendered { - color: #444; - line-height: 28px; } - .select2-container--classic .select2-selection--single .select2-selection__clear { - cursor: pointer; - float: right; - font-weight: bold; - margin-right: 10px; } - .select2-container--classic .select2-selection--single .select2-selection__placeholder { - color: #999; } - .select2-container--classic .select2-selection--single .select2-selection__arrow { - background-color: #ddd; - border: none; - border-left: 1px solid #aaa; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - height: 26px; - position: absolute; - top: 1px; - right: 1px; - width: 20px; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); - 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); } - .select2-container--classic .select2-selection--single .select2-selection__arrow b { - border-color: #888 transparent transparent transparent; - border-style: solid; - border-width: 5px 4px 0 4px; - height: 0; - left: 50%; - margin-left: -4px; - margin-top: -2px; - position: absolute; - top: 50%; - width: 0; } - -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { - float: left; } - -.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { - border: none; - border-right: 1px solid #aaa; - border-radius: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - left: 1px; - right: auto; } - -.select2-container--classic.select2-container--open .select2-selection--single { - border: 1px solid #5897fb; } - .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { - background: transparent; - 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; } - -.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { - border-top: none; - border-top-left-radius: 0; - border-top-right-radius: 0; - background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); - 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); } - -.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { - border-bottom: none; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); - 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); } - -.select2-container--classic .select2-selection--multiple { - background-color: white; - border: 1px solid #aaa; - border-radius: 4px; - cursor: text; - outline: 0; } - .select2-container--classic .select2-selection--multiple:focus { - border: 1px solid #5897fb; } - .select2-container--classic .select2-selection--multiple .select2-selection__rendered { - list-style: none; - margin: 0; - padding: 0 5px; } - .select2-container--classic .select2-selection--multiple .select2-selection__clear { - display: none; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice { - background-color: #e4e4e4; + background-color: #f7f7f7; border: 1px solid #aaa; border-radius: 4px; - cursor: default; + outline: 0; + background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%); + 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); +} + + .select2-container--classic .select2-selection--single:focus { + border: 1px solid #5897fb; + } + + .select2-container--classic .select2-selection--single .select2-selection__rendered { + color: #444; + line-height: 28px; + } + + .select2-container--classic .select2-selection--single .select2-selection__clear { + cursor: pointer; + float: right; + font-weight: bold; + margin-right: 10px; + } + + .select2-container--classic .select2-selection--single .select2-selection__placeholder { + color: #999; + } + + .select2-container--classic .select2-selection--single .select2-selection__arrow { + background-color: #ddd; + border: none; + border-left: 1px solid #aaa; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + height: 26px; + position: absolute; + top: 1px; + right: 1px; + width: 20px; + background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); + 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); + } + + .select2-container--classic .select2-selection--single .select2-selection__arrow b { + border-color: #888 transparent transparent transparent; + border-style: solid; + border-width: 5px 4px 0 4px; + height: 0; + left: 50%; + margin-left: -4px; + margin-top: -2px; + position: absolute; + top: 50%; + width: 0; + } + +.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; - margin-right: 5px; - margin-top: 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; } - .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { - color: #555; } +} + +.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { + border: none; + border-right: 1px solid #aaa; + border-radius: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + left: 1px; + right: auto; +} + +.select2-container--classic.select2-container--open .select2-selection--single { + border: 1px solid #5897fb; +} + + .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { + background: transparent; + 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; + } + +.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { + border-top: none; + border-top-left-radius: 0; + border-top-right-radius: 0; + background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%); + 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); +} + +.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { + border-bottom: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%); + 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); +} + +.select2-container--classic .select2-selection--multiple { + background-color: white; + border: 1px solid #aaa; + border-radius: 4px; + cursor: text; + outline: 0; +} + + .select2-container--classic .select2-selection--multiple:focus { + border: 1px solid #5897fb; + } + + .select2-container--classic .select2-selection--multiple .select2-selection__rendered { + list-style: none; + margin: 0; + padding: 0 5px; + } + + .select2-container--classic .select2-selection--multiple .select2-selection__clear { + display: none; + } + + .select2-container--classic .select2-selection--multiple .select2-selection__choice { + background-color: #e4e4e4; + border: 1px solid #aaa; + border-radius: 4px; + cursor: default; + float: left; + margin-right: 5px; + margin-top: 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; + } + + .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { + color: #555; + } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { - float: right; - margin-left: 5px; - margin-right: auto; } + float: right; + margin-left: 5px; + margin-right: auto; +} .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { - margin-left: 2px; - margin-right: auto; } + margin-left: 2px; + 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: none; + border-top-left-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: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} .select2-container--classic .select2-search--dropdown .select2-search__field { - border: 1px solid #aaa; - outline: 0; } + border: 1px solid #aaa; + outline: 0; +} .select2-container--classic .select2-search--inline .select2-search__field { - outline: 0; - box-shadow: none; } + outline: 0; + box-shadow: none; +} .select2-container--classic .select2-dropdown { - background-color: white; - border: 1px solid transparent; } + background-color: white; + 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; } + max-height: 200px; + 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; } + background-color: #3875d7; + color: white; +} .select2-container--classic .select2-results__group { - cursor: default; - display: block; - padding: 6px; } + cursor: default; + display: block; + padding: 6px; +} .select2-container--classic.select2-container--open .select2-dropdown { - border-color: #5897fb; } + border-color: #5897fb; +}