แก้ model profile

This commit is contained in:
Kittapath 2023-08-16 16:44:36 +07:00
parent 6a0d548f22
commit da20b8c64e
7 changed files with 112 additions and 6 deletions

View file

@ -248,10 +248,31 @@ namespace BMA.EHR.Application.Repositories.Commands
PositionLineId = placementProfile.PositionLine == null ? Guid.Empty : placementProfile.PositionLine.Id,
IsVerified = true,
IsProbation = true,
Physical = "",
Ability = "",
AvatarRef = "",
GovAgeAbsent = 0,
GovAgePlus = 0,
EntryStatus = "",
IsTransfer = false,
IsActive = true,
IsLeave = false,
VerifiedUser = "",
FirstNameOld = "",
LastNameOld = "",
CoupleLive = false,
FatherLive = false,
MotherLive = false,
Educations = new List<ProfileEducation>(),
Certificates = new List<ProfileCertificate>(),
Salaries = new List<ProfileSalary>()
Salaries = new List<ProfileSalary>(),
CreatedAt = DateTime.Now,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
};
// add profile education
@ -272,6 +293,13 @@ namespace BMA.EHR.Application.Repositories.Commands
FundName = edu.FundName,
Gpa = edu.Gpa,
Institute = edu.Institute,
IsActive = true,
CreatedAt = DateTime.Now,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
});
}
@ -285,6 +313,13 @@ namespace BMA.EHR.Application.Repositories.Commands
Issuer = cert.Issuer,
CertificateType = cert.CertificateType,
ExpireDate = cert.ExpireDate,
IsActive = true,
CreatedAt = DateTime.Now,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
});
}
@ -336,13 +371,14 @@ namespace BMA.EHR.Application.Repositories.Commands
PositionExecutiveId = placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutive! == null ? null : placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutive!.Id,
PositionExecutiveSideId = placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutiveSide! == null ? null : placementProfile.OrganizationPosition!.PositionMaster!.PositionExecutiveSide!.Id,
IsActive = true,
CreatedAt = DateTime.Now,
CreatedFullName = FullName,
CreatedUserId = UserId,
CreatedFullName = FullName ?? "System Administrator",
CreatedUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now,
LastUpdateFullName = FullName,
LastUpdateUserId = UserId,
LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateUserId = UserId ?? "",
};
//if (placementProfile.PositionPathSide! != null)
@ -366,6 +402,8 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Profile = profile,
OrganizationPosition = placementProfile.OrganizationPosition,
IsActive = true,
IsPublished = true,
};
_dbContext.Set<ProfilePosition>().Add(profilePosition);
@ -384,6 +422,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Subject = $"คุณได้รับคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
Body = $"คุณได้รับบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
ReceiverUserId = profile.Id,
Payload = "",
};
_dbContext.Set<Inbox>().Add(inbox);
@ -391,6 +430,8 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Body = $"คุณได้รับบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
ReceiverUserId = profile.Id,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
await _dbContext.SaveChangesAsync();
@ -407,6 +448,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Subject = $"คุณได้รับสำเนาคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
Body = $"คำสั่งบบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
ReceiverUserId = pf.Id,
Payload = "",
};
_dbContext.Set<Inbox>().Add(inbox);
@ -414,6 +456,8 @@ namespace BMA.EHR.Application.Repositories.Commands
{
Body = $"คำสั่งบบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}",
ReceiverUserId = pf.Id,
Type = "",
Payload = "",
};
_dbContext.Set<Notification>().Add(noti);
}