fix นำเข้าข้อมูลสรรหาแข่งขันแล้วแจ้ง error #9

This commit is contained in:
harid 2026-03-24 15:29:10 +07:00
parent 8b37e4c94c
commit e1d869c932
5 changed files with 1682 additions and 9 deletions

View file

@ -1169,7 +1169,7 @@ namespace BMA.EHR.Recruit.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>() ?? "")}",
@ -1179,7 +1179,7 @@ namespace BMA.EHR.Recruit.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",
@ -1203,7 +1203,7 @@ namespace BMA.EHR.Recruit.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>() ?? "",

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.Recruit.Service.Migrations
{
/// <inheritdoc />
public partial class update_RecruitAddress : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "ZipCode1",
table: "RecruitAddresses",
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: "RecruitAddresses",
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: "RecruitAddresses",
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: "RecruitAddresses",
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

@ -350,13 +350,13 @@ namespace BMA.EHR.Recruit.Service.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");

View file

@ -25,7 +25,7 @@ namespace BMA.EHR.Recruit.Service.Models.Recruits
[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.Recruit.Service.Models.Recruits
[MaxLength(200)]
public string Province1 { get; set; }
[MaxLength(5)]
[MaxLength(10)]
public string ZipCode1 { get; set; }
public Recruit Recruit { get; set; }