diff --git a/AMESCoreStudio.Web/Views/WHS/WHS014.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS014.cshtml
new file mode 100644
index 00000000..c2c87fcb
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS014.cshtml
@@ -0,0 +1,147 @@
+@{
+ ViewData["Title"] = "異常工時類別資料維護";
+ Layout = "~/Views/Shared/_AMESLayout.cshtml";
+}
+
+
+
+@section Scripts{
+
+}
\ No newline at end of file
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS014C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS014C.cshtml
new file mode 100644
index 00000000..4abe5df3
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS014C.cshtml
@@ -0,0 +1,65 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionClass
+
+
+@{ ViewData["Title"] = "WHS014C";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS014U.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS014U.cshtml
new file mode 100644
index 00000000..b5b3f395
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS014U.cshtml
@@ -0,0 +1,65 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionClass
+
+
+@{ ViewData["Title"] = "WHS014U";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS015.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS015.cshtml
new file mode 100644
index 00000000..714382c9
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS015.cshtml
@@ -0,0 +1,204 @@
+@{
+ ViewData["Title"] = "異常工時代碼資料維護";
+ Layout = "~/Views/Shared/_AMESLayout.cshtml";
+}
+
+
+
+@section Scripts{
+
+}
\ No newline at end of file
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS015C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS015C.cshtml
new file mode 100644
index 00000000..3e4fca71
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS015C.cshtml
@@ -0,0 +1,119 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionCode
+
+
+@{ ViewData["Title"] = "WHS015C";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS015U.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS015U.cshtml
new file mode 100644
index 00000000..9c75928a
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS015U.cshtml
@@ -0,0 +1,140 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionCode
+
+
+@{ ViewData["Title"] = "WHS015U";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS016.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS016.cshtml
new file mode 100644
index 00000000..ff4a3041
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS016.cshtml
@@ -0,0 +1,256 @@
+@{
+ ViewData["Title"] = "異常工時原因資料維護";
+ Layout = "~/Views/Shared/_AMESLayout.cshtml";
+}
+
+
+
+@section Scripts{
+
+}
\ No newline at end of file
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS016C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS016C.cshtml
new file mode 100644
index 00000000..c1b124d0
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS016C.cshtml
@@ -0,0 +1,168 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionReason
+
+
+@{ ViewData["Title"] = "WHS016C";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS016U.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS016U.cshtml
new file mode 100644
index 00000000..54bbad53
--- /dev/null
+++ b/AMESCoreStudio.Web/Views/WHS/WHS016U.cshtml
@@ -0,0 +1,162 @@
+@model AMESCoreStudio.WebApi.Models.AMES.ExceptionReason
+
+
+@{ ViewData["Title"] = "WHS016U";
+ Layout = "~/Views/Shared/_FormLayout.cshtml"; }
+
+
+
+
+
+
+@section Scripts {
+ @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
+ await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+
+
+
+
+}
+
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionClassesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionClassesController.cs
new file mode 100644
index 00000000..cbb6634f
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionClassesController.cs
@@ -0,0 +1,175 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using AMESCoreStudio.WebApi.Models.AMES;
+using AMESCoreStudio.CommonTools.Result;
+
+namespace AMESCoreStudio.WebApi.Controllers.AMES
+{
+ ///
+ /// 異常工時類別資料檔
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class ExceptionClassesController : ControllerBase
+ {
+ private readonly AMESContext _context;
+
+ ///
+ /// 建構式
+ ///
+ ///
+ public ExceptionClassesController(AMESContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// 查詢異常工時類別資料檔
+ ///
+ ///
+ // GET: api/
+ [HttpGet]
+ public async Task>> GetExceptionClasses()
+ {
+ IQueryable q = _context.ExceptionClasses;
+ q = q.OrderBy(p => p.ExceptionClassNo);
+ var ExceptionClasses = await q.ToListAsync();
+ return ExceptionClasses;
+ }
+
+
+ ///
+ /// 異常工時類別資料檔byID
+ ///
+ /// ItemID
+ ///
+ [HttpGet("{id}")]
+ public async Task> GetExceptionClasse(string id)
+ {
+ IQueryable q = _context.ExceptionClasses;
+ var result = await q.Where(p => p.ExceptionClassNo == id).ToListAsync();
+ return result;
+ }
+
+
+ ///
+ /// 異常工時類別資料檔 by GROUP ID
+ ///
+ /// ItemID
+ ///
+ [HttpGet("Query/{id}")]
+ public async Task> GetExceptionClassesByGroup(string id)
+ {
+ IQueryable q = _context.ExceptionClasses;
+ var result = await q.Where(p => p.ExceptionGroupNo == id).ToListAsync();
+ return result;
+ }
+
+
+ ///
+ /// 新增異常工時類別資料檔
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> PostExceptionClasses([FromBody] ExceptionClass ExceptionClass)
+ {
+ ResultModel result = new ResultModel();
+ Helper helper = new Helper(_context);
+ if (ExceptionClassExists(ExceptionClass.ExceptionClassNo))
+ {
+ result.Success = false;
+ result.Msg = "代號重複";
+ return result;
+ }
+
+ _context.ExceptionClasses.Add(ExceptionClass);
+ try
+ {
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ }
+ catch (Exception ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ }
+ return result;
+ }
+
+
+ ///
+ /// 修改異常工時類別資料檔
+ ///
+ ///
+ [HttpPut("{id}")]
+ public async Task> PutBarcodeItems(string id, [FromBody] ExceptionClass ExceptionClass)
+ {
+ ResultModel result = new ResultModel();
+ if (id != ExceptionClass.ExceptionClassNo)
+ {
+ result.Success = false;
+ result.Msg = "類別代碼錯誤";
+ return result;
+ }
+
+ _context.Entry(ExceptionClass).State = EntityState.Modified;
+
+ try
+ {
+
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ return result;
+ //throw;
+
+ }
+ }
+
+ ///
+ /// 刪除異常工時類別
+ ///
+ ///
+ ///
+ // DELETE: api/StandardWorkTimes/5
+ [HttpDelete("{id}")]
+ public async Task> DeleteExceptionClass(string id)
+ {
+ ResultModel result = new ResultModel();
+
+ var ExceptionClass = await _context.ExceptionClasses.FindAsync(id);
+ if (ExceptionClass == null)
+ {
+ result.Success = false;
+ result.Msg = "料號不存在";
+ return result;
+ }
+
+ _context.ExceptionClasses.Remove(ExceptionClass);
+ await _context.SaveChangesAsync();
+
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+ }
+
+ private bool ExceptionClassExists(string id)
+ {
+ return _context.ExceptionClasses.Any(e => e.ExceptionClassNo == id);
+ }
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionCodesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionCodesController.cs
new file mode 100644
index 00000000..8970f4b2
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionCodesController.cs
@@ -0,0 +1,173 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using AMESCoreStudio.WebApi.Models.AMES;
+using AMESCoreStudio.CommonTools.Result;
+
+namespace AMESCoreStudio.WebApi.Controllers.AMES
+{
+ ///
+ /// 異常工時代碼資料檔
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class ExceptionCodesController : ControllerBase
+ {
+ private readonly AMESContext _context;
+
+ ///
+ /// 建構式
+ ///
+ ///
+ public ExceptionCodesController(AMESContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// 查詢異常工時代碼資料檔
+ ///
+ ///
+ // GET: api/
+ [HttpGet]
+ public async Task>> GetExceptionCodes()
+ {
+ IQueryable q = _context.ExceptionCodes;
+ q = q.OrderBy(p => p.ExceptionNo);
+ var ExceptionCodes = await q.ToListAsync();
+ return ExceptionCodes;
+ }
+
+
+ ///
+ /// 異常工時代碼資料檔
+ ///
+ /// ItemID
+ ///
+ [HttpGet("{id}")]
+ public async Task> GetExceptionCode(string id)
+ {
+ IQueryable q = _context.ExceptionCodes;
+ var result = await q.Where(p => p.ExceptionNo == id).ToListAsync();
+ return result;
+ }
+
+ ///
+ /// 異常工時代碼資料檔
+ ///
+ /// ItemID
+ ///
+ [HttpGet("Query/{id}")]
+ public async Task> GetExceptionCodesByClass(string id)
+ {
+ IQueryable q = _context.ExceptionCodes;
+ var result = await q.Where(p => p.ExceptionClassNo == id).ToListAsync();
+ return result;
+ }
+
+ ///
+ /// 新增異常工時代碼資料檔
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> PostExceptionCodes([FromBody] ExceptionCode ExceptionCode)
+ {
+ ResultModel result = new ResultModel();
+ Helper helper = new Helper(_context);
+ if (ExceptionCodeExists(ExceptionCode.ExceptionNo))
+ {
+ result.Success = false;
+ result.Msg = "代號重複";
+ return result;
+ }
+
+ _context.ExceptionCodes.Add(ExceptionCode);
+ try
+ {
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ }
+ catch (Exception ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ }
+ return result;
+ }
+
+
+ ///
+ /// 修改異常工時代碼資料檔
+ ///
+ ///
+ [HttpPut("{id}")]
+ public async Task> PutBarcodeItems(string id, [FromBody] ExceptionCode ExceptionCode)
+ {
+ ResultModel result = new ResultModel();
+ if (id != ExceptionCode.ExceptionNo)
+ {
+ result.Success = false;
+ result.Msg = "代碼錯誤";
+ return result;
+ }
+
+ _context.Entry(ExceptionCode).State = EntityState.Modified;
+
+ try
+ {
+
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ return result;
+ //throw;
+
+ }
+ }
+
+ ///
+ /// 刪除異常工時代碼
+ ///
+ ///
+ ///
+ // DELETE: api/StandardWorkTimes/5
+ [HttpDelete("{id}")]
+ public async Task> DeleteExceptionCode(string id)
+ {
+ ResultModel result = new ResultModel();
+
+ var ExceptionCode = await _context.ExceptionCodes.FindAsync(id);
+ if (ExceptionCode == null)
+ {
+ result.Success = false;
+ result.Msg = "代碼不存在";
+ return result;
+ }
+
+ _context.ExceptionCodes.Remove(ExceptionCode);
+ await _context.SaveChangesAsync();
+
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+ }
+
+ private bool ExceptionCodeExists(string id)
+ {
+ return _context.ExceptionCodes.Any(e => e.ExceptionNo == id);
+ }
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionReasonsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionReasonsController.cs
new file mode 100644
index 00000000..8d590442
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Controllers/AMES/ExceptionReasonsController.cs
@@ -0,0 +1,174 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+using AMESCoreStudio.WebApi.Models.AMES;
+using AMESCoreStudio.CommonTools.Result;
+
+namespace AMESCoreStudio.WebApi.Controllers.AMES
+{
+ ///
+ /// 異常工時原因資料檔
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class ExceptionReasonsController : ControllerBase
+ {
+ private readonly AMESContext _context;
+
+ ///
+ /// 建構式
+ ///
+ ///
+ public ExceptionReasonsController(AMESContext context)
+ {
+ _context = context;
+ }
+
+ ///
+ /// 查詢異常工時原因資料檔
+ ///
+ ///
+ // GET: api/
+ [HttpGet]
+ public async Task>> GetExceptionReasons()
+ {
+ IQueryable q = _context.ExceptionReasons;
+ q = q.OrderBy(p => p.ReasonNo);
+ var ExceptionReasons = await q.ToListAsync();
+ return ExceptionReasons;
+ }
+
+
+ ///
+ /// 異常工時原因資料檔
+ ///
+ /// ItemID
+ ///
+ [HttpGet("{id}")]
+ public async Task> GetExceptionReasons(string id)
+ {
+ IQueryable q = _context.ExceptionReasons;
+ var result = await q.Where(p => p.ReasonNo == id).ToListAsync();
+ return result;
+ }
+
+
+ ///
+ /// 異常工時原因資料檔
+ ///
+ /// ItemID
+ ///
+ [HttpGet("Query/{id}")]
+ public async Task> GetExceptionReasonsByQuery(string id)
+ {
+ IQueryable q = _context.ExceptionReasons;
+ var result = await q.Where(p => p.ExceptionNo == id).ToListAsync();
+ return result;
+ }
+
+ ///
+ /// 新增異常工時原因資料檔
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> PostExceptionReasons([FromBody] ExceptionReason ExceptionReason)
+ {
+ ResultModel result = new ResultModel();
+ Helper helper = new Helper(_context);
+ if (ExceptionReasonExists(ExceptionReason.ReasonNo))
+ {
+ result.Success = false;
+ result.Msg = "代號重複";
+ return result;
+ }
+
+ _context.ExceptionReasons.Add(ExceptionReason);
+ try
+ {
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ }
+ catch (Exception ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ }
+ return result;
+ }
+
+
+ ///
+ /// 修改異常工時原因資料檔
+ ///
+ ///
+ [HttpPut("{id}")]
+ public async Task> PutBarcodeItems(string id, [FromBody] ExceptionReason ExceptionReason)
+ {
+ ResultModel result = new ResultModel();
+ if (id != ExceptionReason.ReasonNo)
+ {
+ result.Success = false;
+ result.Msg = "代碼錯誤";
+ return result;
+ }
+
+ _context.Entry(ExceptionReason).State = EntityState.Modified;
+
+ try
+ {
+
+ await _context.SaveChangesAsync();
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+
+ }
+ catch (DbUpdateConcurrencyException ex)
+ {
+ result.Success = false;
+ result.Msg = ex.Message;
+ return result;
+ //throw;
+
+ }
+ }
+
+ ///
+ /// 刪除異常工時原因
+ ///
+ ///
+ ///
+ // DELETE: api/StandardWorkTimes/5
+ [HttpDelete("{id}")]
+ public async Task> DeleteExceptionReason(string id)
+ {
+ ResultModel result = new ResultModel();
+
+ var ExceptionReason = await _context.ExceptionReasons.FindAsync(id);
+ if (ExceptionReason == null)
+ {
+ result.Success = false;
+ result.Msg = "代碼不存在";
+ return result;
+ }
+
+ _context.ExceptionReasons.Remove(ExceptionReason);
+ await _context.SaveChangesAsync();
+
+ result.Success = true;
+ result.Msg = "OK";
+ return result;
+ }
+
+ private bool ExceptionReasonExists(string id)
+ {
+ return _context.ExceptionReasons.Any(e => e.ReasonNo == id);
+ }
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Models/AMES/ExceptionClass.cs b/AMESCoreStudio.WebApi/Models/AMES/ExceptionClass.cs
new file mode 100644
index 00000000..e326bd84
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Models/AMES/ExceptionClass.cs
@@ -0,0 +1,80 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Runtime.Serialization;
+
+namespace AMESCoreStudio.WebApi.Models.AMES
+{
+ ///
+ /// 异常工時类别资料表
+ ///
+ [Table("EXCEPTION_CLASS", Schema = "JHAMES")]
+ [DataContract]
+ public class ExceptionClass
+ {
+ ///
+ /// 異常工時類別代碼
+ ///
+ [Key]
+ [Column("EXCEPTION_CLASS_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常類別代碼")]
+ [StringLength(6, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ExceptionClassNo { get; set; }
+
+
+ ///
+ /// 異常類別名稱
+ ///
+ [Column("EXCEPTION_CLASS_NAME")]
+ [DataMember]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常類別名稱")]
+ [StringLength(50, ErrorMessage = "{0},不能大于{1}")]
+ public string ExceptionClassName { get; set; }
+
+ ///
+ /// 異常群組代碼
+ ///
+ [Column("EXCEPTION_GROUP_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常群組代碼")]
+ [StringLength(1, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ExceptionGroupNo { get; set; }
+
+
+ ///
+ /// 建立UserID
+ ///
+ [Column("CREATE_USERID")]
+ [Required]
+ [DataMember]
+ public int CreateUserID { get; set; }
+
+ ///
+ /// 建立日期
+ ///
+ [Required]
+ [Column("CREATE_DATE")]
+ [DataMember]
+ public DateTime CreateDate { get; set; }
+
+ ///
+ /// 更新UserID
+ ///
+ [Column("UPDATE_USERID")]
+ [DataMember]
+ public int UpdateUserID { get; set; }
+
+ ///
+ /// 更新日期
+ ///
+ [Column("UPDATE_DATE")]
+ [DataMember]
+ public DateTime UpdateDate { get; set; }
+
+
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Models/AMES/ExceptionCode.cs b/AMESCoreStudio.WebApi/Models/AMES/ExceptionCode.cs
new file mode 100644
index 00000000..53ac46fa
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Models/AMES/ExceptionCode.cs
@@ -0,0 +1,106 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Runtime.Serialization;
+
+namespace AMESCoreStudio.WebApi.Models.AMES
+{
+ ///
+ /// 異常工時代碼資料檔
+ ///
+ [Table("EXCEPTION_CODE", Schema = "JHAMES")]
+ [DataContract]
+ public class ExceptionCode
+ {
+ ///
+ /// 異常工時代碼代碼
+ ///
+ [Key]
+ [Column("EXCEPTION_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常群組代碼")]
+ [StringLength(12, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ExceptionNo { get; set; }
+
+ ///
+ /// 異常工時群組代碼
+ ///
+ [Column("EXCEPTION_CLASS_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常群組代碼")]
+ [StringLength(6, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ExceptionClassNo { get; set; }
+
+
+ ///
+ /// 異常工時描述
+ ///
+ [Column("EXCEPTION_DESC_CH")]
+ [DataMember]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常工時描述(中文)")]
+ [StringLength(100, ErrorMessage = "{0},不能大于{1}")]
+ public string ExceptionDescCH { get; set; }
+
+ ///
+ /// 異常工時描述
+ ///
+ [Column("EXCEPTION_DESC_EN")]
+ [DataMember]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常工時描述(英文)")]
+ [StringLength(100, ErrorMessage = "{0},不能大于{1}")]
+ public string ExceptionDescEN { get; set; }
+
+ ///
+ /// 備註
+ ///
+ [Column("MEMO")]
+ [DataMember]
+ [Display(Name = "備註")]
+ public string Memo { get; set; }
+
+ ///
+ /// 狀態
+ ///
+ [Column("STATUS")]
+ [DataMember]
+ [Display(Name = "狀態")]
+ public string Status { get; set; }
+
+
+ ///
+ /// 建立UserID
+ ///
+ [Column("CREATE_USERID")]
+ [Required]
+ [DataMember]
+ public int CreateUserID { get; set; }
+
+ ///
+ /// 建立日期
+ ///
+ [Required]
+ [Column("CREATE_DATE")]
+ [DataMember]
+ public DateTime CreateDate { get; set; }
+
+ ///
+ /// 更新UserID
+ ///
+ [Column("UPDATE_USERID")]
+ [DataMember]
+ public int UpdateUserID { get; set; }
+
+ ///
+ /// 更新日期
+ ///
+ [Column("UPDATE_DATE")]
+ [DataMember]
+ public DateTime UpdateDate { get; set; }
+
+
+ }
+}
diff --git a/AMESCoreStudio.WebApi/Models/AMES/ExceptionReason.cs b/AMESCoreStudio.WebApi/Models/AMES/ExceptionReason.cs
new file mode 100644
index 00000000..8b637c9a
--- /dev/null
+++ b/AMESCoreStudio.WebApi/Models/AMES/ExceptionReason.cs
@@ -0,0 +1,104 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Runtime.Serialization;
+
+namespace AMESCoreStudio.WebApi.Models.AMES
+{
+ ///
+ /// 异常代码资料表
+ ///
+ [Table("EXCEPTION_REASON", Schema = "JHAMES")]
+ [DataContract]
+ public class ExceptionReason
+ {
+
+ ///
+ /// 異常原因代碼
+ ///
+ [Key]
+ [Column("REASON_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常原因代碼")]
+ [StringLength(12, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ReasonNo { get; set; }
+
+ ///
+ /// 異常類別代碼
+ ///
+ [Column("EXCEPTION_NO")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常類別代碼")]
+ [StringLength(12, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ExceptionNo { get; set; }
+
+ ///
+ /// 異常原因描述
+ ///
+ [Column("REASON_DESC_CH")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常原因描述")]
+ [StringLength(100, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ReasonDescCH { get; set; }
+
+ ///
+ /// 異常原因英文描述
+ ///
+ [Column("REASON_DESC_EN")]
+ [Required(ErrorMessage = "{0},不能空白")]
+ [Display(Name = "異常原因英文描述")]
+ [StringLength(100, ErrorMessage = "{0},不能大于{1}")]
+ [DataMember]
+ public string ReasonDescEn { get; set; }
+
+ ///
+ /// 備註
+ ///
+ [Column("MEMO")]
+ [DataMember]
+ [Display(Name = "備註")]
+ public string Memo { get; set; }
+
+ ///
+ /// 狀態
+ ///
+ [Column("STATUS")]
+ [DataMember]
+ [Display(Name = "狀態")]
+ public string Status { get; set; }
+
+
+ ///
+ /// 建立UserID
+ ///
+ [Column("CREATE_USERID")]
+ [Required]
+ [DataMember]
+ public int CreateUserID { get; set; }
+
+ ///
+ /// 建立日期
+ ///
+ [Required]
+ [Column("CREATE_DATE")]
+ [DataMember]
+ public DateTime CreateDate { get; set; }
+
+ ///
+ /// 更新UserID
+ ///
+ [Column("UPDATE_USERID")]
+ [DataMember]
+ public int UpdateUserID { get; set; }
+
+ ///
+ /// 更新日期
+ ///
+ [Column("UPDATE_DATE")]
+ [DataMember]
+ public DateTime UpdateDate { get; set; }
+ }
+}