fix นำเข้าข้อมูลสรรหาแล้วแจ้ง error (สอบคัดเลือกอื่นๆ) #9

This commit is contained in:
harid 2026-03-24 15:44:51 +07:00
parent caa0bccd79
commit 022b68b496
5 changed files with 3228 additions and 9 deletions

View file

@ -1365,7 +1365,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
District = workSheet?.Cells[row, 54]?.GetValue<string>() ?? "",
Amphur = workSheet?.Cells[row, 55]?.GetValue<string>() ?? "",
Province = workSheet?.Cells[row, 56]?.GetValue<string>() ?? "",
ZipCode = workSheet?.Cells[row, 57]?.GetValue<string>() ?? "",
ZipCode = (workSheet?.Cells[row, 57]?.GetValue<string>() ?? "").Trim(),
Telephone = workSheet?.Cells[row, 58]?.GetValue<string>() ?? "",
Mobile = "",
Address1 = $"{(workSheet?.Cells[row, 61]?.GetValue<string>() ?? "")} {(workSheet?.Cells[row, 62]?.GetValue<string>() ?? "")}",
@ -1375,7 +1375,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
District1 = workSheet?.Cells[row, 66]?.GetValue<string>() ?? "",
Amphur1 = workSheet?.Cells[row, 67]?.GetValue<string>() ?? "",
Province1 = workSheet?.Cells[row, 68]?.GetValue<string>() ?? "",
ZipCode1 = workSheet?.Cells[row, 69]?.GetValue<string>() ?? "",
ZipCode1 = (workSheet?.Cells[row, 69]?.GetValue<string>() ?? "").Trim(),
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator",
@ -1399,7 +1399,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
TermBranch = workSheet?.Cells[row, 113]?.GetValue<string>() ?? "",
TellerId = workSheet?.Cells[row, 114]?.GetValue<string>() ?? "",
CreditDebit = workSheet?.Cells[row, 115]?.GetValue<string>() ?? "",
PaymentType = workSheet?.Cells[row, 116]?.GetValue<string>(),
PaymentType = workSheet?.Cells[row, 116]?.GetValue<string>() ?? "",
ChequeNo = workSheet?.Cells[row, 117]?.GetValue<string>() ?? "",
Amount = (decimal)workSheet?.Cells[row, 118]?.GetValue<decimal>(),
ChqueBankCode = workSheet?.Cells[row, 119]?.GetValue<string>() ?? "",

View file

@ -1296,13 +1296,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
b.Property<string>("ZipCode")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("varchar(5)");
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property<string>("ZipCode1")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("varchar(5)");
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.HasKey("Id");

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,66 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Recurit.Exam.Service.Migrations
{
/// <inheritdoc />
public partial class update_DisableAddress : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode1",
table: "DisableAddresses",
type: "varchar(10)",
maxLength: 10,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(5)",
oldMaxLength: 5)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "DisableAddresses",
type: "varchar(10)",
maxLength: 10,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(5)",
oldMaxLength: 5)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode1",
table: "DisableAddresses",
type: "varchar(5)",
maxLength: 5,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ZipCode",
table: "DisableAddresses",
type: "varchar(5)",
maxLength: 5,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(10)",
oldMaxLength: 10)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -25,7 +25,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
[MaxLength(200)]
public string Province { get; set; }//
[MaxLength(5)]
[MaxLength(10)]
public string ZipCode { get; set; }//
[MaxLength(200)]
@ -55,7 +55,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Models.Disables
[MaxLength(200)]
public string Province1 { get; set; }//
[MaxLength(5)]
[MaxLength(10)]
public string ZipCode1 { get; set; }//
public Disable Disable { get; set; }