add feild isactive

This commit is contained in:
Kittapath 2023-05-12 23:11:09 +07:00
parent 86a6ab9514
commit 0b24cff812
5 changed files with 3254 additions and 4 deletions

View file

@ -718,12 +718,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
.FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId));
if (profileOrganization == null)
throw new Exception(GlobalMessages.OrganizationNotFound);
return Success(new List<dynamic>());
var ocId = _contextMetadata.Organizations.AsQueryable()
.FirstOrDefault(x => x.Id == profileOrganization.OrganizationId);
if (ocId == null)
throw new Exception(GlobalMessages.OrganizationNotFound);
return Success(new List<dynamic>());
criteria = GetAllIdByRoot(ocId.Id);
if (criteria.Any())
_periodExams = _periodExams.Where(x => x.CreatedUserId == UserId || criteria.Contains(x.OcId == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : x.OcId)).ToList();

View file

@ -59,6 +59,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -119,6 +124,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -204,6 +214,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("longtext")
.HasComment("อำเภอ");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -304,6 +319,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -472,6 +492,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(1)
.HasComment("ชื่อจริง");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("Knowledge")
.HasColumnType("longtext")
.HasComment("ความสามารถพิเศษ");
@ -775,6 +800,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DocumentId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -844,6 +874,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(1)
.HasComment("ระยะเวลาเริ่ม");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -960,6 +995,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("Isspecial")
.IsRequired()
.HasMaxLength(1)
@ -1106,6 +1146,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1236,6 +1281,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<DateTime>("ExpiredDate")
.HasColumnType("datetime(6)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<DateTime>("IssueDate")
.HasColumnType("datetime(6)");
@ -1302,6 +1352,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DocumentFileId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1377,6 +1432,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1462,6 +1522,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(1)
.HasComment("รายละเอียดการนำเข้า");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1522,6 +1587,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DisableId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1642,6 +1712,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DisableId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1775,6 +1850,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<int>("FullC")
.HasColumnType("int");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1867,6 +1947,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("ImportFileId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -1985,6 +2070,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnType("longtext")
.HasComment("วุฒิที่ได้รับ");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -2228,6 +2318,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DocumentId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -2290,6 +2385,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<Guid>("DocumentId")
.HasColumnType("char(36)");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)
@ -2349,6 +2449,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
.HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)")
.HasColumnOrder(106)
.HasComment("สถานะการใช้งาน");
b.Property<string>("LastUpdateFullName")
.IsRequired()
.HasMaxLength(200)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,291 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
/// <inheritdoc />
public partial class updatetablebaseaddIsActive : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ScoreImports",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "PositionExams",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "PeriodExamImages",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "PeriodExamDocuments",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Educations",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableScores",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Disables",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisablePayments",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableOccupations",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableImportHistories",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableEducations",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableDocuments",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableCertificates",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "DisableAddresses",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "CMSGovernments",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "CMSCandidates",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "CMSAgencys",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Careers",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Candidates",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "CandidateDocuments",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "BankExams",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 106);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "ScoreImports");
migrationBuilder.DropColumn(
name: "IsActive",
table: "PositionExams");
migrationBuilder.DropColumn(
name: "IsActive",
table: "PeriodExamImages");
migrationBuilder.DropColumn(
name: "IsActive",
table: "PeriodExamDocuments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Educations");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableScores");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Disables");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisablePayments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableOccupations");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableImportHistories");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableEducations");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableDocuments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableCertificates");
migrationBuilder.DropColumn(
name: "IsActive",
table: "DisableAddresses");
migrationBuilder.DropColumn(
name: "IsActive",
table: "CMSGovernments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "CMSCandidates");
migrationBuilder.DropColumn(
name: "IsActive",
table: "CMSAgencys");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Careers");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Candidates");
migrationBuilder.DropColumn(
name: "IsActive",
table: "CandidateDocuments");
migrationBuilder.DropColumn(
name: "IsActive",
table: "BankExams");
}
}
}

View file

@ -164,12 +164,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.FirstOrDefaultAsync(x => x.UserId == Guid.Parse(UserId));
if (profileOrganization == null)
throw new Exception(GlobalMessages.OrganizationNotFound);
return new List<PeriodExamCandidateResponseItem>();
var ocId = _contextMetadata.Organizations.AsQueryable()
.FirstOrDefault(x => x.Id == profileOrganization.OrganizationId);
if (ocId == null)
throw new Exception(GlobalMessages.OrganizationNotFound);
return new List<PeriodExamCandidateResponseItem>();
criteria = GetAllIdByRoot(ocId.Id);
if (criteria.Any())