Browse Source
"QASRVConnection": "Data Source=QASRV-N;Initial Catalog=isozone_db;user id=esop_user;password=avalue@esopuser;Encrypt=False;",PTD
7 changed files with 235 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.CommonTools.Result; |
||||
|
using AMESCoreStudio.WebApi.Models.QASRV; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.QASRV |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 標準SOP路徑
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class DocEsopViewController : ControllerBase |
||||
|
{ |
||||
|
|
||||
|
private readonly QASRVContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public DocEsopViewController(QASRVContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
///// <summary>
|
||||
|
///// Get標準SOP路徑
|
||||
|
///// </summary>
|
||||
|
///// <returns></returns>
|
||||
|
//[HttpGet]
|
||||
|
//public async Task<ActionResult<IEnumerable<DocEsopView>>> GetDocEsopView()
|
||||
|
//{
|
||||
|
// IQueryable<DocEsopView> q = _context.DocEsopViews;
|
||||
|
// return await q.Take(100).ToListAsync();
|
||||
|
//}
|
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.CommonTools.Result; |
||||
|
using AMESCoreStudio.WebApi.Models.QASRV; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.QASRV |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 標準SOP路徑
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class RuleController : ControllerBase |
||||
|
{ |
||||
|
|
||||
|
private readonly QASRVContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public RuleController(QASRVContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Get標準SOP路徑
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<Rule>>> GetRule() |
||||
|
{ |
||||
|
IQueryable<Rule> q = _context.Rules; |
||||
|
return await q.Take(100).ToListAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.QASRV |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 安勤標準SOP路徑
|
||||
|
/// </summary>
|
||||
|
[Table("doc_esop_view")] |
||||
|
[Keyless] |
||||
|
public partial class DocEsopView |
||||
|
{ |
||||
|
[DataMember] |
||||
|
[Column("document_name")] |
||||
|
public string document_name { get; set; } |
||||
|
|
||||
|
[Column("document_no")] |
||||
|
[DataMember] |
||||
|
public string document_no { get; set; } |
||||
|
|
||||
|
[Column("document_version")] |
||||
|
[DataMember] |
||||
|
public string document_version { get; set; } |
||||
|
|
||||
|
[Column("file_path")] |
||||
|
[DataMember] |
||||
|
public string file_path { get; set; } |
||||
|
|
||||
|
[Column("maintain_by")] |
||||
|
[DataMember] |
||||
|
public string maintain_by { get; set; } |
||||
|
|
||||
|
[Column("issue_date")] |
||||
|
[DataMember] |
||||
|
public string issue_date { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.QASRV |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 安勤標準SOP路徑
|
||||
|
/// </summary>
|
||||
|
[Table("ROLE")] |
||||
|
[Keyless] |
||||
|
public partial class Rule |
||||
|
{ |
||||
|
[DataMember] |
||||
|
[Column("ROLE_NAME")] |
||||
|
public string ROLE_NAME { get; set; } |
||||
|
|
||||
|
[Column("ROLE_DESC")] |
||||
|
[DataMember] |
||||
|
public string ROLE_DESC { get; set; } |
||||
|
|
||||
|
[Column("CREATE_USERID")] |
||||
|
[DataMember] |
||||
|
public int CREATE_USERID { get; set; } |
||||
|
|
||||
|
[Column("CREATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime CREATE_DATE { get; set; } |
||||
|
|
||||
|
[Column("UPDATE_DATE")] |
||||
|
[DataMember] |
||||
|
public DateTime UPDATE_DATE { get; set; } |
||||
|
|
||||
|
[Column("SYS_TYPE")] |
||||
|
[DataMember] |
||||
|
public string SYS_TYPE { get; set; } |
||||
|
|
||||
|
[Column("ROLE_ID")] |
||||
|
[DataMember] |
||||
|
public int ROLE_ID { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
using AMESCoreStudio.WebApi.Models.QASRV; |
||||
|
using AMESCoreStudio.WebApi.Models.SYS; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
|
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
public class QASRVContext : DbContext |
||||
|
{ |
||||
|
|
||||
|
public QASRVContext(DbContextOptions<QASRVContext> options) |
||||
|
: base(options) |
||||
|
{ |
||||
|
//Configuration.ProxyCreationEnabled = false;
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="modelBuilder"></param>
|
||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// DocEsopView
|
||||
|
/// </summary>
|
||||
|
public DbSet<DocEsopView> DocEsopViews { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// DocEsopView
|
||||
|
/// </summary>
|
||||
|
//public DbSet<Rule> Rules { get; set; }
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue