อนุมัติและส่งต่อ การปรับเลื่อน ค่าตอบแทน
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TTSW.Controllers;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
//[Authorize]
|
||||
[Produces("application/json")]
|
||||
[Route("api/eva_adjust_postponement_update_status")]
|
||||
public class eva_adjust_postponement_update_statusController : BaseController
|
||||
{
|
||||
#region Private Variables
|
||||
private ILogger<eva_adjust_postponement_update_statusController> _logger;
|
||||
private Ieva_adjust_postponement_update_statusService _repository;
|
||||
private Iexternal_employeeService emp;
|
||||
private IConfiguration Configuration { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Default constructure for dependency injection
|
||||
/// </summary>
|
||||
/// <param name="repository"></param>
|
||||
/// <param name="configuration"></param>
|
||||
/// <param name="logger"></param>
|
||||
public eva_adjust_postponement_update_statusController(ILogger<eva_adjust_postponement_update_statusController> logger,
|
||||
Ieva_adjust_postponement_update_statusService repository, IConfiguration configuration,
|
||||
Iexternal_employeeService inemp)
|
||||
{
|
||||
_logger = logger;
|
||||
_repository = repository;
|
||||
Configuration = configuration;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get specific item by id
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return Get specific item by id</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(eva_adjust_postponement_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetWithSelection(id);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult Get.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Blank Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return a blank item</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetBlankItem")]
|
||||
[ProducesResponseType(typeof(eva_adjust_postponement_update_statusWithSelectionViewModel), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetBlankItem()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var result = _repository.GetBlankItem();
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by postponement_status_note
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetList(string postponement_status_note)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBypostponement_status_note(postponement_status_note));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetList.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list items by search
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <returns>Return list of items by specifced keyword</returns>
|
||||
/// <response code="200">Returns the item</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpGet("GetListBySearch")]
|
||||
[ProducesResponseType(typeof(List<eva_adjust_postponement_update_statusViewModel>), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult GetListBySearch(eva_adjust_postponement_update_statusSearchModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
return Ok(_repository.GetListBySearch(model));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogCritical($"Exception in IActionResult GetListBySearch.", ex);
|
||||
return StatusCode(500, $"{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Update item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="model"></param>
|
||||
/// <returns>Response Result Message</returns>
|
||||
/// <response code="200">Response Result Message</response>
|
||||
/// <response code="400">If the model is invalid</response>
|
||||
/// <response code="500">Error Occurred</response>
|
||||
[HttpPut("{id}")]
|
||||
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
|
||||
[ProducesResponseType(400)]
|
||||
[ProducesResponseType(500)]
|
||||
//[ValidateAntiForgeryToken]
|
||||
public IActionResult Update(int id, [FromBody] eva_adjust_postponement_update_statusInputModel model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
|
||||
int? e = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(HttpContext.Request.Cookies["user_id"]))
|
||||
{
|
||||
var loginid = Convert.ToInt32(HttpContext.Request.Cookies["user_id"]);
|
||||
var theEmp = emp.GetEmployeeForLogin(Convert.ToInt32(loginid));
|
||||
if(theEmp != null)
|
||||
{
|
||||
e = theEmp.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
var result = _repository.Update(id, model, true, e);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
1257
Migrations/20220501044125_AddPostponementStatus.Designer.cs
generated
Normal file
1257
Migrations/20220501044125_AddPostponementStatus.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
92
Migrations/20220501044125_AddPostponementStatus.cs
Normal file
92
Migrations/20220501044125_AddPostponementStatus.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace tb320eva.Migrations
|
||||
{
|
||||
public partial class AddPostponementStatus : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "postponement_status",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 5,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "postponement_status_by",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "postponement_status_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "postponement_status_note",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_status",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 5,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "quota_status_by",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 255,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "quota_status_date",
|
||||
table: "eva_adjust_postponement",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "quota_status_note",
|
||||
table: "eva_adjust_postponement",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_by",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_date",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "postponement_status_note",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_by",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_date",
|
||||
table: "eva_adjust_postponement");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "quota_status_note",
|
||||
table: "eva_adjust_postponement");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,28 @@ namespace tb320eva.Migrations
|
||||
|
||||
b.Property<decimal?>("percentage");
|
||||
|
||||
b.Property<string>("postponement_status")
|
||||
.HasMaxLength(5);
|
||||
|
||||
b.Property<int?>("postponement_status_by")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime?>("postponement_status_date");
|
||||
|
||||
b.Property<string>("postponement_status_note")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("quota_status")
|
||||
.HasMaxLength(5);
|
||||
|
||||
b.Property<int?>("quota_status_by")
|
||||
.HasMaxLength(255);
|
||||
|
||||
b.Property<DateTime?>("quota_status_date");
|
||||
|
||||
b.Property<string>("quota_status_note")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
b.Property<string>("report_type")
|
||||
.HasMaxLength(1000);
|
||||
|
||||
|
||||
@@ -58,5 +58,23 @@ namespace TodoAPI2.Models
|
||||
public string report_type { get; set; }
|
||||
|
||||
public DateTime? imported_date { get; set; }
|
||||
|
||||
[MaxLength(5)]
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
[MaxLength(255)]
|
||||
public int? postponement_status_by { get; set; }
|
||||
[MaxLength(1000)]
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
[MaxLength(5)]
|
||||
public string quota_status { get; set; }
|
||||
|
||||
public DateTime? quota_status_date { get; set; }
|
||||
[MaxLength(255)]
|
||||
public int? quota_status_by { get; set; }
|
||||
[MaxLength(1000)]
|
||||
public string quota_status_note { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
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_adjust_postponement_update_statusService
|
||||
{
|
||||
|
||||
new eva_adjust_postponement_update_statusViewModel Update(int id, eva_adjust_postponement_update_statusInputModel model, bool is_force_save, int? updateby);
|
||||
List<eva_adjust_postponement_update_statusViewModel> GetListBypostponement_status_note(string postponement_status_note);
|
||||
List<eva_adjust_postponement_update_statusViewModel> GetListBySearch(eva_adjust_postponement_update_statusSearchModel model);
|
||||
|
||||
|
||||
eva_adjust_postponement_update_statusWithSelectionViewModel GetWithSelection(int id);
|
||||
eva_adjust_postponement_update_statusWithSelectionViewModel GetBlankItem();
|
||||
|
||||
eva_adjust_postponementEntity GetEntity(int id);
|
||||
DataContext GetContext();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TTSW.EF;
|
||||
using TTSW.Utils;
|
||||
using TTSW.Constant;
|
||||
using TTSW.Common;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_update_statusInputModel
|
||||
{
|
||||
|
||||
public int? id { get; set; }
|
||||
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
|
||||
public int? postponement_status_by { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
public string active_mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_adjust_postponement_update_statusReportRequestModel : eva_adjust_postponement_update_statusSearchModel
|
||||
{
|
||||
public string filetype { get; set; }
|
||||
|
||||
public string contentType { get { return MyHelper.GetContentType(filetype); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_adjust_postponement_update_statusSearchModel
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
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_adjust_postponement_update_statusService : Ieva_adjust_postponement_update_statusService
|
||||
{
|
||||
private IBaseRepository2<eva_adjust_postponementEntity, int> _repository;
|
||||
private IMyDatabase db;
|
||||
private Iexternal_linkageService ext;
|
||||
private Iexternal_employeeService emp;
|
||||
|
||||
public eva_adjust_postponement_update_statusService(
|
||||
IBaseRepository2<eva_adjust_postponementEntity, int> repository,
|
||||
IMyDatabase mydb,
|
||||
Iexternal_linkageService inext,
|
||||
Iexternal_employeeService inemp
|
||||
)
|
||||
{
|
||||
_repository = repository;
|
||||
db = mydb;
|
||||
ext = inext;
|
||||
emp = inemp;
|
||||
}
|
||||
|
||||
#region Private Functions
|
||||
private eva_adjust_postponementEntity GetEntity(eva_adjust_postponement_update_statusInputModel model)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponementEntity>(model);
|
||||
}
|
||||
private List<eva_adjust_postponementEntity> GetEntityList(List<eva_adjust_postponement_update_statusInputModel> models)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponementEntity>>(models);
|
||||
}
|
||||
private eva_adjust_postponement_update_statusViewModel GetDto(eva_adjust_postponementEntity entity)
|
||||
{
|
||||
return Mapper.Map<eva_adjust_postponement_update_statusViewModel>(entity);
|
||||
}
|
||||
private List<eva_adjust_postponement_update_statusViewModel> GetDtoList(List<eva_adjust_postponementEntity> entities)
|
||||
{
|
||||
return Mapper.Map<List<eva_adjust_postponement_update_statusViewModel>>(entities);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
#region Query Functions
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel Get(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
if (!entity.postponement_status_date.HasValue) entity.postponement_status_date = DateTime.Now;
|
||||
|
||||
return GetDto(entity);
|
||||
}
|
||||
|
||||
public eva_adjust_postponementEntity GetEntity(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
|
||||
if (!entity.postponement_status_date.HasValue) entity.postponement_status_date = DateTime.Now;
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public DataContext GetContext()
|
||||
{
|
||||
return _repository.Context;
|
||||
}
|
||||
|
||||
public eva_adjust_postponement_update_statusWithSelectionViewModel GetWithSelection(int id)
|
||||
{
|
||||
var entity = _repository.Get(id);
|
||||
var i = Mapper.Map<eva_adjust_postponement_update_statusWithSelectionViewModel>(entity);
|
||||
i.item_postponement_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_postponement_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.postponement_status_date = DateTime.Now;
|
||||
|
||||
return i;
|
||||
}
|
||||
public eva_adjust_postponement_update_statusWithSelectionViewModel GetBlankItem()
|
||||
{
|
||||
var i = new eva_adjust_postponement_update_statusWithSelectionViewModel();
|
||||
i.item_postponement_status = (from x in ext.GetAgreeDisagree4() select x).ToList();
|
||||
i.item_postponement_status_by = (from x in emp.GetAllEmployee() select x).ToList();
|
||||
i.postponement_status_date = DateTime.Now;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_update_statusViewModel> GetListBypostponement_status_note(string postponement_status_note)
|
||||
{
|
||||
var model = new eva_adjust_postponement_update_statusSearchModel();
|
||||
model.postponement_status_note = postponement_status_note;
|
||||
return GetListBySearch(model);
|
||||
}
|
||||
|
||||
public List<eva_adjust_postponement_update_statusViewModel> GetListBySearch(eva_adjust_postponement_update_statusSearchModel model)
|
||||
{
|
||||
var data = (
|
||||
from m_eva_adjust_postponement_update_status in _repository.Context.eva_adjust_postponement
|
||||
|
||||
join fk_external_linkage1 in ext.GetAgreeDisagree4() on m_eva_adjust_postponement_update_status.postponement_status equals fk_external_linkage1.external_code
|
||||
into external_linkageResult1
|
||||
from fk_external_linkageResult1 in external_linkageResult1.DefaultIfEmpty()
|
||||
|
||||
join fk_external_linkage3 in ext.GetAgreeDisagree4() on m_eva_adjust_postponement_update_status.postponement_status_by equals fk_external_linkage3.id
|
||||
into external_linkageResult3
|
||||
from fk_external_linkageResult3 in external_linkageResult3.DefaultIfEmpty()
|
||||
|
||||
|
||||
where
|
||||
1 == 1
|
||||
&& (string.IsNullOrEmpty(model.postponement_status_note) || m_eva_adjust_postponement_update_status.postponement_status_note.Contains(model.postponement_status_note))
|
||||
|
||||
|
||||
orderby m_eva_adjust_postponement_update_status.created descending
|
||||
select new eva_adjust_postponement_update_statusViewModel()
|
||||
{
|
||||
id = m_eva_adjust_postponement_update_status.id,
|
||||
postponement_status = m_eva_adjust_postponement_update_status.postponement_status,
|
||||
postponement_status_date = m_eva_adjust_postponement_update_status.postponement_status_date,
|
||||
postponement_status_by = m_eva_adjust_postponement_update_status.postponement_status_by,
|
||||
postponement_status_note = m_eva_adjust_postponement_update_status.postponement_status_note,
|
||||
|
||||
postponement_status_external_linkage_external_name = fk_external_linkageResult1.external_name,
|
||||
postponement_status_by_external_linkage_external_name = fk_external_linkageResult3.external_name,
|
||||
|
||||
isActive = m_eva_adjust_postponement_update_status.isActive,
|
||||
Created = m_eva_adjust_postponement_update_status.created,
|
||||
Updated = m_eva_adjust_postponement_update_status.updated
|
||||
}
|
||||
).Take(1000).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Manipulation Functions
|
||||
|
||||
|
||||
public int GetNewPrimaryKey()
|
||||
{
|
||||
int? newkey = 0;
|
||||
|
||||
var x = (from i in _repository.Context.eva_adjust_postponement
|
||||
orderby i.id descending
|
||||
select i).Take(1).ToList();
|
||||
|
||||
if(x.Count > 0)
|
||||
{
|
||||
newkey = x[0].id + 1;
|
||||
}
|
||||
|
||||
return newkey.Value;
|
||||
}
|
||||
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel Update(int id, eva_adjust_postponement_update_statusInputModel model, bool is_force_save, int? updateby)
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
if (existingEntity != null)
|
||||
{
|
||||
existingEntity.postponement_status = model.postponement_status;
|
||||
existingEntity.postponement_status_date = DateTime.Now;
|
||||
existingEntity.postponement_status_by = updateby;
|
||||
existingEntity.postponement_status_note = model.postponement_status_note;
|
||||
|
||||
var updated = _repository.Update(id, existingEntity);
|
||||
return Get(updated.id);
|
||||
}
|
||||
else
|
||||
throw new NotificationException("No data to update");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public eva_adjust_postponement_update_statusViewModel SetAsActive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public eva_adjust_postponement_update_statusViewModel SetAsInactive(int id)
|
||||
{
|
||||
var updated = _repository.SetAsInActive(id);
|
||||
|
||||
return Get(updated.id);
|
||||
}
|
||||
public void Delete(int id)
|
||||
{
|
||||
_repository.Delete(id);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Dictionary<string,string> GetLookupForLog()
|
||||
{
|
||||
var i = new Dictionary<string, string>();
|
||||
|
||||
|
||||
i.Add("postponement_status", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("postponement_status_external_linkage_external_name", "สถานะการปรับเลื่อนเงินเดือน");
|
||||
i.Add("postponement_status_date", "วันที่");
|
||||
i.Add("txt_postponement_status_date", "วันที่");
|
||||
i.Add("postponement_status_by", "ปรับสถานะโดย");
|
||||
i.Add("postponement_status_by_external_linkage_external_name", "ปรับสถานะโดย");
|
||||
i.Add("postponement_status_note", "หมายเหตุ");
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Match Item
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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_adjust_postponement_update_statusViewModel : BaseViewModel2<int>
|
||||
{
|
||||
|
||||
public string postponement_status { get; set; }
|
||||
|
||||
public DateTime? postponement_status_date { get; set; }
|
||||
|
||||
public string txt_postponement_status_date { get { return MyHelper.GetDateStringForReport(this.postponement_status_date); } }
|
||||
|
||||
public int? postponement_status_by { get; set; }
|
||||
|
||||
public string postponement_status_note { get; set; }
|
||||
|
||||
public string postponement_status_external_linkage_external_name { get; set; }
|
||||
public string postponement_status_by_external_linkage_external_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TodoAPI2.Models
|
||||
{
|
||||
public class eva_adjust_postponement_update_statusWithSelectionViewModel: eva_adjust_postponement_update_statusViewModel
|
||||
{
|
||||
public List<external_linkageViewModel> item_postponement_status { get; set; }
|
||||
public List<external_employeeViewModel> item_postponement_status_by { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ namespace TodoAPI2.Models
|
||||
string GetMainDept(int? dep_id);
|
||||
|
||||
List<external_linkageViewModel> GetSalaryReportType();
|
||||
List<external_linkageViewModel> GetAgreeDisagree4();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -308,6 +308,31 @@ namespace TodoAPI2.Models
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetAgreeDisagree4()
|
||||
{
|
||||
var result = new List<external_linkageViewModel>();
|
||||
|
||||
var k = new external_linkageViewModel();
|
||||
k.external_id = 1;
|
||||
k.external_code = "";
|
||||
k.external_name = "อยู่ระหว่างพิจารณา";
|
||||
result.Add(k);
|
||||
|
||||
var i = new external_linkageViewModel();
|
||||
i.external_id = 2;
|
||||
i.external_code = "Y";
|
||||
i.external_name = "อนุมัติและส่งต่อ";
|
||||
result.Add(i);
|
||||
|
||||
var j = new external_linkageViewModel();
|
||||
j.external_id = 3;
|
||||
j.external_code = "N";
|
||||
j.external_name = "ตีกลับ";
|
||||
result.Add(j);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<external_linkageViewModel> GetDepartmentData()
|
||||
{
|
||||
var sql_parent = string.Format("select" +
|
||||
|
||||
@@ -345,6 +345,8 @@ namespace Test01
|
||||
services.AddScoped<IBaseRepository2<eva_level_score_detailEntity, Guid>, BaseRepository2<eva_level_score_detailEntity, Guid>>();
|
||||
services.AddScoped<Ieva_level_score_detailService, eva_level_score_detailService>();
|
||||
|
||||
services.AddScoped<Ieva_adjust_postponement_update_statusService, eva_adjust_postponement_update_statusService>();
|
||||
|
||||
#endregion
|
||||
|
||||
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
@@ -655,6 +657,10 @@ namespace Test01
|
||||
cfg.CreateMap<eva_level_score_detailInputModel, eva_level_score_detailEntity>();
|
||||
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailViewModel>();
|
||||
cfg.CreateMap<eva_level_score_detailEntity, eva_level_score_detailWithSelectionViewModel>();
|
||||
|
||||
cfg.CreateMap<eva_adjust_postponement_update_statusInputModel, eva_adjust_postponementEntity>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusViewModel>();
|
||||
cfg.CreateMap<eva_adjust_postponementEntity, eva_adjust_postponement_update_statusWithSelectionViewModel>();
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -5,7 +5,55 @@
|
||||
Layout = "_LayoutDirect";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_update_statusModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_adjust_postponement_update_statusModelLabel">บันทึกข้อมูล การอนุมัติและส่งต่อ</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_update_status_id" />
|
||||
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status" for="eva_adjust_postponement_update_status_postponement_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_date" for="eva_adjust_postponement_update_status_postponement_status_date">วันที่</label>
|
||||
<input disabled class="form-control" type="text" id="eva_adjust_postponement_update_status_postponement_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="false" iGroup="eva_adjust_postponement_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="display:none;">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_by" for="eva_adjust_postponement_update_status_postponement_status_by">ปรับสถานะโดย</label>
|
||||
<select disabled class="form-control" id="eva_adjust_postponement_update_status_postponement_status_by" iLabel="ปรับสถานะโดย" iRequire="false" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_note" for="eva_adjust_postponement_update_status_postponement_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="false" iGroup="eva_adjust_postponement_update_status"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
@@ -104,6 +152,9 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button style="display:none;" class="btn btn-info" type="button" onclick="javascript:Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(true)">คำนวณค่าครองชีพใหม่ ตามเกณฑ์เงินเดือน 13,285</button>
|
||||
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_SetEditForm(getUrlParameter('id'));">อนุมัติและส่งต่อ</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,16 +220,19 @@
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script src="~/js/eva_adjust_postponement_update_status/eva_adjust_postponement_update_status.js?version=@MyHelper.GetDummyText()"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var id = getUrlParameter("id");
|
||||
if (id) {
|
||||
eva_adjust_postponement_normal_SetEditForm(id);
|
||||
eva_adjust_postponement_detail_normal_02_InitialForm(id);
|
||||
eva_adjust_postponement_update_status_InitialForm();
|
||||
} else {
|
||||
eva_adjust_postponement_normal_SetCreateForm();
|
||||
}
|
||||
SetupValidationRemark("eva_adjust_postponement_normal");
|
||||
SetupValidationRemark("eva_adjust_postponement_update_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
@using Microsoft.Extensions.Configuration
|
||||
@inject IConfiguration Configuration
|
||||
@{
|
||||
ViewData["Title"] = "eva_adjust_postponement_update_status";
|
||||
}
|
||||
|
||||
<div class="modal fade" id="eva_adjust_postponement_update_statusModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="eva_adjust_postponement_update_statusModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="eva_adjust_postponement_update_statusModelLabel">บันทึกข้อมูล eva_adjust_postponement_update_status</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<input class="form-control" type="hidden" id="eva_adjust_postponement_update_status_id" />
|
||||
|
||||
<div class='row'></div>
|
||||
<div class='row'></div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status" for="eva_adjust_postponement_update_status_postponement_status">สถานะการปรับเลื่อนเงินเดือน</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status" iLabel="สถานะการปรับเลื่อนเงินเดือน" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_date" for="eva_adjust_postponement_update_status_postponement_status_date">วันที่</label>
|
||||
<input class="form-control" type="text" id="eva_adjust_postponement_update_status_postponement_status_date" data-provide="datepicker" data-date-language="th-th" iLabel="วันที่" iRequire="true" iGroup="eva_adjust_postponement_update_status" />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_by" for="eva_adjust_postponement_update_status_postponement_status_by">ปรับสถานะโดย</label>
|
||||
<select class="form-control" id="eva_adjust_postponement_update_status_postponement_status_by" iLabel="ปรับสถานะโดย" iRequire="true" iGroup="eva_adjust_postponement_update_status"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="form-group col-md-12">
|
||||
<label id="lab_eva_adjust_postponement_update_status_postponement_status_note" for="eva_adjust_postponement_update_status_postponement_status_note">หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="eva_adjust_postponement_update_status"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">ยกเลิก</button>
|
||||
<button type="button" class="btn btn-primary" onclick="javascript:eva_adjust_postponement_update_status_PutUpdate()">บันทึก</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row page-title">
|
||||
<div class="col-md-5">
|
||||
<div class="page-title">
|
||||
@Configuration["SiteInformation:modulename"]
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<ol class="breadcrumb" style="">
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]">หน้าแรก</a></li>
|
||||
<li class="breadcrumb-item "><a href="@Configuration["SiteInformation:mainsite"]@Configuration["SiteInformation:appsite"]">@Configuration["SiteInformation:modulename"]</a></li>
|
||||
<li class="breadcrumb-item active">eva_adjust_postponement_update_status</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="wrapper">
|
||||
<div class="title"><div class="line"></div>ค้นหา eva_adjust_postponement_update_status</div>
|
||||
<div class="tools">
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id='lab_s_eva_adjust_postponement_update_status_postponement_status_note' for='s_eva_adjust_postponement_update_status_postponement_status_note'>หมายเหตุ</label>
|
||||
<textarea class="form-control" rows="4" cols="50" id="s_eva_adjust_postponement_update_status_postponement_status_note" iLabel="หมายเหตุ" iRequire="true" iGroup="s_eva_adjust_postponement_update_status" title='หมายเหตุ' placeholder='หมายเหตุ'></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_DoSearch();">ค้นหา</button>
|
||||
<button class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
|
||||
<button style="display:none;" class="btn btn-info" onclick="javascript:eva_adjust_postponement_update_status_GetSelect('id');">ดึงตัวเลือก</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="eva_adjust_postponement_update_statusTable" class="display table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>เลือก</th>-->
|
||||
<th>เครื่องมือ</th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_id'>รหัสอ้างอิง</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status'>สถานะการปรับเลื่อนเงินเดือน</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_date'>วันที่</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_by'>ปรับสถานะโดย</label></th>
|
||||
<th><label id='h_eva_adjust_postponement_update_status_postponement_status_note'>หมายเหตุ</label></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@section FooterPlaceHolder{
|
||||
<script src="~/js/eva_adjust_postponement_update_status/eva_adjust_postponement_update_status.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
eva_adjust_postponement_update_status_InitiateDataTable();
|
||||
eva_adjust_postponement_update_status_InitialForm();
|
||||
SetupValidationRemark("eva_adjust_postponement_update_status");
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<None Remove="Files\**" />
|
||||
<None Remove="Uploads\**" />
|
||||
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
|
||||
<None Include="Views\eva_adjust_postponement_update_statusView\eva_adjust_postponement_update_status.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc_d.cshtml" />
|
||||
<None Include="Views\eva_create_evaluation_detail_historyView\eva_create_evaluation_detail_history.cshtml" />
|
||||
@@ -86,6 +87,7 @@
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_detail_migration\eva_adjust_postponement_detail_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_migration\eva_adjust_postponement_migration_d.js" />
|
||||
<None Include="wwwroot\js\eva_adjust_postponement_update_status\eva_adjust_postponement_update_status.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_firstdoc\eva_create_evaluation_detail_firstdoc_d.js" />
|
||||
<None Include="wwwroot\js\eva_create_evaluation_detail_history\eva_create_evaluation_detail_history.js" />
|
||||
|
||||
61
tb320eva.xml
61
tb320eva.xml
@@ -896,6 +896,67 @@
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_adjust_postponement_update_statusController},TodoAPI2.Models.Ieva_adjust_postponement_update_statusService,Microsoft.Extensions.Configuration.IConfiguration,TodoAPI2.Models.Iexternal_employeeService)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
</summary>
|
||||
<param name="repository"></param>
|
||||
<param name="configuration"></param>
|
||||
<param name="logger"></param>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.Get(System.Int32)">
|
||||
<summary>
|
||||
Get specific item by id
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return Get specific item by id</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.GetBlankItem">
|
||||
<summary>
|
||||
Get Blank Item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return a blank item</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.GetList(System.String)">
|
||||
<summary>
|
||||
Get list items by postponement_status_note
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.GetListBySearch(TodoAPI2.Models.eva_adjust_postponement_update_statusSearchModel)">
|
||||
<summary>
|
||||
Get list items by search
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<returns>Return list of items by specifced keyword</returns>
|
||||
<response code="200">Returns the item</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_adjust_postponement_update_statusController.Update(System.Int32,TodoAPI2.Models.eva_adjust_postponement_update_statusInputModel)">
|
||||
<summary>
|
||||
Update item
|
||||
</summary>
|
||||
<remarks>
|
||||
</remarks>
|
||||
<param name="id"></param>
|
||||
<param name="model"></param>
|
||||
<returns>Response Result Message</returns>
|
||||
<response code="200">Response Result Message</response>
|
||||
<response code="400">If the model is invalid</response>
|
||||
<response code="500">Error Occurred</response>
|
||||
</member>
|
||||
<member name="M:TodoAPI2.Controllers.eva_create_evaluationController.#ctor(Microsoft.Extensions.Logging.ILogger{TodoAPI2.Controllers.eva_create_evaluationController},TodoAPI2.Models.Ieva_create_evaluationService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary>
|
||||
Default constructure for dependency injection
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
var eva_adjust_postponement_update_status_editMode = "CREATE";
|
||||
var eva_adjust_postponement_update_status_API = "/api/eva_adjust_postponement_update_status/";
|
||||
|
||||
//================= Search Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_update_status_GetSearchParameter() {
|
||||
var eva_adjust_postponement_update_statusSearchObject = new Object();
|
||||
eva_adjust_postponement_update_statusSearchObject.postponement_status_note = $("#s_eva_adjust_postponement_update_status_postponement_status_note").val();
|
||||
|
||||
return eva_adjust_postponement_update_statusSearchObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_adjust_postponement_update_status_postponement_status_note").val(data.postponement_status_note);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_adjust_postponement_update_status_FeedDataToForm(data) {
|
||||
$("#eva_adjust_postponement_update_status_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_update_status_postponement_status"), data, "id", "external_name", "item_postponement_status", data.postponement_status);
|
||||
$("#eva_adjust_postponement_update_status_postponement_status_date").val(formatDate(data.postponement_status_date));
|
||||
DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_update_status_postponement_status_by"), data, "id", "external_name", "item_postponement_status_by", data.postponement_status_by);
|
||||
$("#eva_adjust_postponement_update_status_postponement_status_note").val(data.postponement_status_note);
|
||||
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GetFromForm() {
|
||||
var eva_adjust_postponement_update_statusObject = new Object();
|
||||
eva_adjust_postponement_update_statusObject.id = $("#eva_adjust_postponement_update_status_id").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status = $("#eva_adjust_postponement_update_status_postponement_status").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_date = getDate($("#eva_adjust_postponement_update_status_postponement_status_date").val());
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_by = $("#eva_adjust_postponement_update_status_postponement_status_by").val();
|
||||
eva_adjust_postponement_update_statusObject.postponement_status_note = $("#eva_adjust_postponement_update_status_postponement_status_note").val();
|
||||
|
||||
|
||||
return eva_adjust_postponement_update_statusObject;
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_update_status_FeedDataToForm(result);
|
||||
eva_adjust_postponement_update_status_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_update_status_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
//================= Form Mode Setup and Flow =========================================
|
||||
|
||||
function eva_adjust_postponement_update_status_GoCreate() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_SetCreateForm(true);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_update_statusView/eva_adjust_postponement_update_status_d");
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GoEdit(a) {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_SetEditForm(a);
|
||||
|
||||
// Incase open new page
|
||||
//window_open(appsite + "/eva_adjust_postponement_update_statusView/eva_adjust_postponement_update_status_d?id=" + a);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
eva_adjust_postponement_update_status_editMode = "UPDATE";
|
||||
eva_adjust_postponement_update_status_FeedDataToForm(result);
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("show");
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_adjust_postponement_update_status_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_SetCreateForm(s) {
|
||||
eva_adjust_postponement_update_status_editMode = "CREATE";
|
||||
eva_adjust_postponement_update_status_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_RefreshTable() {
|
||||
// Incase model popup
|
||||
eva_adjust_postponement_update_status_DoSearch();
|
||||
|
||||
// Incase open new page
|
||||
//window.parent.eva_adjust_postponement_update_status_DoSearch();
|
||||
}
|
||||
|
||||
//================= Update and Delete =========================================
|
||||
|
||||
var eva_adjust_postponement_update_status_customValidation = function (group) {
|
||||
return "";
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_update_status_PutUpdate() {
|
||||
if (!ValidateForm('eva_adjust_postponement_update_status', eva_adjust_postponement_update_status_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = eva_adjust_postponement_update_status_GetFromForm();
|
||||
|
||||
//Update Mode
|
||||
if (eva_adjust_postponement_update_status_editMode === "UPDATE") {
|
||||
var successFunc1 = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_postponement_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_adjust_postponement_update_status_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
else {
|
||||
var successFunc2 = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
//eva_adjust_postponement_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_adjust_postponement_update_status_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GoDelete(a) {
|
||||
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
|
||||
var successFunc = function (result) {
|
||||
$("#eva_adjust_postponement_update_statusModel").modal("hide");
|
||||
AlertSuccess(result.code + " " + result.message);
|
||||
eva_adjust_postponement_update_status_RefreshTable();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_adjust_postponement_update_status_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
|
||||
//================= Data Table =========================================
|
||||
|
||||
var eva_adjust_postponement_update_statusTableV;
|
||||
|
||||
var eva_adjust_postponement_update_status_setupTable = function (result) {
|
||||
tmp = '"';
|
||||
eva_adjust_postponement_update_statusTableV = $('#eva_adjust_postponement_update_statusTable').DataTable({
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
//"select": {
|
||||
// "style": 'multi'
|
||||
//},
|
||||
"columns": [
|
||||
//{ "data": "" },
|
||||
{ "data": "id" },
|
||||
{ "data": "id" },
|
||||
{ "data": "postponement_status_external_linkage_external_name" },
|
||||
{ "data": "txt_postponement_status_date" },
|
||||
{ "data": "postponement_status_by_external_linkage_external_name" },
|
||||
{ "data": "postponement_status_note" },
|
||||
],
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0, //1,
|
||||
"data": "id",
|
||||
"render": function (data, type, row, meta) {
|
||||
return "<button type='button' class='btn btn-warning btn-sm' onclick='javascript:eva_adjust_postponement_update_status_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm' onclick='javascript:eva_adjust_postponement_update_status_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
|
||||
}
|
||||
},
|
||||
//{
|
||||
// targets: 0,
|
||||
// data: "",
|
||||
// defaultContent: '',
|
||||
// orderable: false,
|
||||
// className: 'select-checkbox'
|
||||
//}
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false
|
||||
});
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_adjust_postponement_update_status_InitiateDataTable() {
|
||||
startLoad();
|
||||
var p = $.param(eva_adjust_postponement_update_status_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_update_status/GetListBySearch?" + p, eva_adjust_postponement_update_status_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_DoSearch() {
|
||||
var p = $.param(eva_adjust_postponement_update_status_GetSearchParameter());
|
||||
var eva_adjust_postponement_update_status_reload = function (result) {
|
||||
eva_adjust_postponement_update_statusTableV.destroy();
|
||||
eva_adjust_postponement_update_status_setupTable(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_adjust_postponement_update_status/GetListBySearch?" + p, eva_adjust_postponement_update_status_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_adjust_postponement_update_status_GetSelect(f) {
|
||||
var eva_adjust_postponement_update_status_selectitem = [];
|
||||
$.each(eva_adjust_postponement_update_statusTableV.rows('.selected').data(), function (key, value) {
|
||||
eva_adjust_postponement_update_status_selectitem.push(value[f]);
|
||||
});
|
||||
alert(eva_adjust_postponement_update_status_selectitem);
|
||||
}
|
||||
|
||||
//================= File Upload =========================================
|
||||
|
||||
|
||||
|
||||
//================= Multi-Selection Function =========================================
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user