add uid authorize in crearte client
This commit is contained in:
@@ -32,20 +32,22 @@ public class UidService : IUidService
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName.ToPersian();
|
||||
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception)
|
||||
catch
|
||||
{
|
||||
|
||||
return null;
|
||||
@@ -63,19 +65,12 @@ public class UidService : IUidService
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
}
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -20,14 +20,14 @@ public class Employee : EntityBase
|
||||
{
|
||||
public Employee(string fName, string lName, string fatherName,
|
||||
DateTime dateOfBirth, DateTime dateOfIssue, string placeOfIssue,
|
||||
string nationalCode, string idNumber, string gender, string nationality,
|
||||
string nationalCode, string idNumber, string gender, string nationality, string idNumberSerial , string idNumberSeri ,
|
||||
string phone = null, string address = null, string state = null, string city = null,
|
||||
string maritalStatus = null, string militaryService = null, string levelOfEducation = null, string fieldOfStudy = null,
|
||||
string bankCardNumber = null, string bankBranch = null, string insuranceCode = null, string insuranceHistoryByYear = null,
|
||||
string insuranceHistoryByMonth = null, string numberOfChildren = null, string officePhone = null,
|
||||
string mclsUserName = null, string mclsPassword = null,
|
||||
string eserviceUserName = null, string eservicePassword = null,
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null)
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null )
|
||||
{
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
@@ -146,6 +146,15 @@ public class Employee : EntityBase
|
||||
/// آیا پرسنل احراز هویت شده است
|
||||
/// </summary>
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public class EmployeeAuthorizeTemp:EntityBase
|
||||
{
|
||||
public EmployeeAuthorizeTemp(Gender gender, string fName, string lName, string fatherName, DateTime birthDate, string nationalCode, string idNumber, string idNumberSerial, string idNumberSeri)
|
||||
{
|
||||
Gender = gender;
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
FatherName = fatherName;
|
||||
BirthDate = birthDate;
|
||||
NationalCode = nationalCode;
|
||||
IdNumber = idNumber;
|
||||
IdNumberSerial = idNumberSerial;
|
||||
IdNumberSeri = idNumberSeri;
|
||||
}
|
||||
|
||||
public Gender Gender { get; private set; }
|
||||
public string FName { get; private set; }
|
||||
public string LName { get; private set; }
|
||||
public string FatherName { get; private set; }
|
||||
public DateTime BirthDate { get; private set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public interface IEmployeeAuthorizeTempRepository:IRepository<long,EmployeeAuthorizeTemp>
|
||||
{
|
||||
Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode);
|
||||
}
|
||||
@@ -94,4 +94,14 @@ public class CreateEmployee
|
||||
public long WorkshopId { get; set; }
|
||||
public long? PersonelCode { get; set; }
|
||||
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
public class EmployeeDataFromApiViewModel
|
||||
{
|
||||
public Gender Gender { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string LName { get; set; }
|
||||
public string FatherName { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -75,6 +75,8 @@ public interface IEmployeeApplication
|
||||
|
||||
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
|
||||
|
||||
Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -29,6 +29,7 @@ using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -58,8 +59,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository) : base(context)
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
@@ -77,6 +79,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
@@ -201,10 +204,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality, command.IdNumberSerial, command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
@@ -212,7 +215,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
command.InsuranceHistoryByMonth, command.NumberOfChildren, command.OfficePhone, command.MclsUserName, command.MclsPassword, command.EserviceUserName, command.EservicePassword,
|
||||
command.TaxOfficeUserName, command.TaxOfficepassword, command.SanaUserName, command.SanaPassword);
|
||||
|
||||
|
||||
if (command.IsAuthorized)
|
||||
{
|
||||
employeeData.Authorized();
|
||||
}
|
||||
_EmployeeRepository.Create(employeeData);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
@@ -1248,10 +1254,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی");
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
|
||||
newEmployee.Authorized();
|
||||
await _EmployeeRepository.CreateAsync(newEmployee);
|
||||
await _context.SaveChangesAsync();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
|
||||
{
|
||||
@@ -1513,5 +1519,105 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return await _EmployeeRepository.WorkedEmployeesInWorkshopSelectList(workshopId);
|
||||
}
|
||||
|
||||
public async Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var op = new OperationResult<EmployeeDataFromApiViewModel>();
|
||||
var birthDateGr = birthDate.ToGeorgianDateTime();
|
||||
|
||||
if (_EmployeeRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employee = _EmployeeRepository.GetByNationalCode(nationalCode);
|
||||
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
Gender.Female => "زن",
|
||||
Gender.Male => "مرد",
|
||||
_ => throw new AggregateException()
|
||||
};
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, birthDateGr,
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
|
||||
gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
|
||||
employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
|
||||
employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
|
||||
employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
|
||||
employee.Authorized();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
EmployeeDataFromApiViewModel data;
|
||||
if (_employeeAuthorizeTempRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employeeAuthorizeTemp = await _employeeAuthorizeTempRepository.GetByNationalCode(nationalCode);
|
||||
if (employeeAuthorizeTemp.BirthDate.ToFarsi() != birthDate)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = employeeAuthorizeTemp.BirthDate.ToFarsi(),
|
||||
NationalCode = employeeAuthorizeTemp.NationalCode,
|
||||
IdNumber = employeeAuthorizeTemp.IdNumber,
|
||||
FName = employeeAuthorizeTemp.FName,
|
||||
FatherName = employeeAuthorizeTemp.FatherName,
|
||||
Gender = employeeAuthorizeTemp.Gender,
|
||||
LName = employeeAuthorizeTemp.LName,
|
||||
};
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = identityInfo.BirthDate,
|
||||
NationalCode = identityInfo.NationalId,
|
||||
IdNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber,
|
||||
FatherName = basicInfo.FatherName,
|
||||
FName = basicInfo.FirstName,
|
||||
Gender = basicInfo.GenderEnum,
|
||||
LName = basicInfo.LastName,
|
||||
IdNumberSeri = identityInfo.ShenasnameSeri,
|
||||
IdNumberSerial = identityInfo.ShenasnameSerial
|
||||
};
|
||||
|
||||
var newAuthorizeTemp = new EmployeeAuthorizeTemp(data.Gender, data.FName, data.LName, data.FatherName, birthDateGr, data.NationalCode, data.IdNumber, data.IdNumberSerial, data.IdNumberSeri);
|
||||
await _employeeAuthorizeTempRepository.CreateAsync(newAuthorizeTemp);
|
||||
await _employeeAuthorizeTempRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -23,6 +23,7 @@ using Company.Domain.DateSalaryAgg;
|
||||
using Company.Domain.DateSalaryItemAgg;
|
||||
using Company.Domain.EmployeeAccountAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.EmployeeBankInformationAgg;
|
||||
using Company.Domain.EmployeeChildrenAgg;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
@@ -174,6 +175,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class EmployeeAuthorizeTempMapping:IEntityTypeConfiguration<EmployeeAuthorizeTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<EmployeeAuthorizeTemp> builder)
|
||||
{
|
||||
builder.ToTable("EmployeeAuthorizeTemps");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.NationalCode).HasMaxLength(15);
|
||||
builder.Property(x => x.IdNumber).HasMaxLength(15);
|
||||
builder.Property(x => x.FName).HasMaxLength(100);
|
||||
builder.Property(x => x.LName).HasMaxLength(100);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(100);
|
||||
builder.Property(x => x.Gender).HasConversion<string>().HasMaxLength(15);
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.HasIndex(x => x.NationalCode).IsUnique();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,17 @@ public class EmployeeMapping : IEntityTypeConfiguration<Employee>
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.HasMany(x => x.EmployeeBankInformationList).WithOne(x => x.Employee)
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addemployeeAuthorizeTempandaddserialNumber : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeAuthorizeTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Gender = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
FName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
FatherName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
NationalCode = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumber = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumberSerial = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
IdNumberSeri = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeAuthorizeTemps", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeAuthorizeTemps_NationalCode",
|
||||
table: "EmployeeAuthorizeTemps",
|
||||
column: "NationalCode",
|
||||
unique: true,
|
||||
filter: "[NationalCode] IS NOT NULL");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeAuthorizeTemps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1495,6 +1495,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1591,6 +1599,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class EmployeeAuthorizeTempRepository:RepositoryBase<long,EmployeeAuthorizeTemp>, IEmployeeAuthorizeTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public EmployeeAuthorizeTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode)
|
||||
{
|
||||
return await _context.EmployeeAuthorizeTemps.FirstOrDefaultAsync(x =>
|
||||
x.NationalCode == nationalCode);
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,command.IdNumberSerial,command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
|
||||
@@ -205,6 +205,7 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -423,6 +424,9 @@ public class PersonalBootstrapper
|
||||
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1591,5 +1591,15 @@ public class IndexModel : PageModel
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
public async Task<IActionResult> OnPostEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var result = await _employeeApplication.GetEmployeeDataFromApi(nationalCode, birthDate);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
data = result.Data
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,13 @@
|
||||
.modal .modal-dialog .modal-content{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.disable {
|
||||
filter: grayscale(100%);
|
||||
pointer-events: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@media(min-width: 1650px) {
|
||||
.modal-dialog {
|
||||
margin: auto;
|
||||
@@ -74,7 +81,7 @@
|
||||
}
|
||||
|
||||
.form {
|
||||
position: absolute;
|
||||
/*position: absolute;*/
|
||||
font-size: 1.2rem;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -135,17 +142,31 @@
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
.formInit {
|
||||
margin-top: 30px;
|
||||
width: 96%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.formInit .formSection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
height: 45vh;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
/*left: 1200px;*/
|
||||
margin-top: 30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form2, .listForm2 {
|
||||
left: 1200px;
|
||||
/*left: 1200px;*/
|
||||
margin-top: 30px;
|
||||
}
|
||||
.form3, .listForm3 {
|
||||
right: 1200px;
|
||||
/*right: 1200px;*/
|
||||
padding: 0 10px;
|
||||
margin: 0;
|
||||
margin-top: 30px;
|
||||
@@ -188,13 +209,15 @@
|
||||
padding: 7px;
|
||||
text-align: center;
|
||||
margin: 0 3px 0 3px;
|
||||
width: 33.33%;
|
||||
/*width: 33.33%;*/
|
||||
width: 25%;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
position: absolute;
|
||||
width: 33.33%;
|
||||
/*width: 33.33%;*/
|
||||
width: 25%;
|
||||
background: linear-gradient(90deg, rgba(15,149,0,1) 0%, rgba(53,189,37,1) 18%, rgba(68,207,52,1) 47%, rgba(73,214,57,1) 82%, rgba(15,149,0,1) 100%);
|
||||
height: 103%;
|
||||
right: -1px;
|
||||
|
||||
Reference in New Issue
Block a user