create contractingpartytemp
This commit is contained in:
@@ -45,6 +45,8 @@ public class PersonalContractingParty : EntityBase
|
||||
|
||||
public int BlockTimes {get; private set; }
|
||||
|
||||
#region NewProps
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
@@ -70,6 +72,9 @@ public class PersonalContractingParty : EntityBase
|
||||
/// </summary>
|
||||
public bool IsAuthenticated { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public List<Employer> Employers { get; private set; }
|
||||
public Representative Representative { get; set; }
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public class ContractingPartyTemp : EntityBase
|
||||
{
|
||||
public ContractingPartyTemp(string fName, string lName, string nationalCode, string idNumber, string phone, string fatherName, string state, string city, string address, string idNumberSeri, string idNumberSerial, string gender, DateTime dateOfBirth)
|
||||
public ContractingPartyTemp(string fName, string lName, string nationalCode, string idNumber, string phone, string fatherName, string state, string city, string address, string idNumberSeri, string idNumberSerial, Gender gender, DateTime dateOfBirth)
|
||||
{
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
@@ -39,7 +40,7 @@ public class ContractingPartyTemp : EntityBase
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public string Gender { get; private set; }
|
||||
public Gender Gender { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
@@ -61,25 +62,30 @@ public class ContractingPartyTemp : EntityBase
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; private set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IContractingPartyTemp :IRepository<long, ContractingPartyTemp>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IContractingPartyTempRepository :IRepository<long, ContractingPartyTemp>
|
||||
{
|
||||
(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode);
|
||||
}
|
||||
@@ -44,6 +44,7 @@ public class PersonalContractingPartyViewModel
|
||||
public string IsActiveString { get; set; }
|
||||
public string IsBlock { get; set; }
|
||||
public int BlockTimes { get; set; }
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public List<EmployerViewModel> EmployerList { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class ContractingPartyTempViewModel : CreateContractingPartyTemp
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Drawing.Interop;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
|
||||
|
||||
public class CreateContractingPartyTemp
|
||||
{
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///تاریخ تولد
|
||||
/// </summary>
|
||||
public DateTime DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره همراه
|
||||
/// </summary>
|
||||
public string Phone { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public interface ITemporaryClientRegistrationApplication
|
||||
{
|
||||
OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrationApplication
|
||||
{
|
||||
private readonly IContractingPartyTempRepository _contractingPartyTempRepository;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
|
||||
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository)
|
||||
{
|
||||
_contractingPartyTempRepository = contractingPartyTempRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
}
|
||||
|
||||
public OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command)
|
||||
{
|
||||
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class ContractingPartyTempMapping : IEntityTypeConfiguration<ContractingPartyTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ContractingPartyTemp> builder)
|
||||
{
|
||||
builder.ToTable("ContractingPartyTemp");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.FName).HasMaxLength(25).IsRequired();
|
||||
builder.Property(x => x.LName).HasMaxLength(25).IsRequired();
|
||||
builder.Property(x => x.NationalCode).HasMaxLength(10).IsRequired();
|
||||
builder.Property(x => x.IdNumber).HasMaxLength(10).IsRequired(false);
|
||||
builder.Property(x => x.Phone).HasMaxLength(12);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(25);
|
||||
builder.Property(x => x.State).HasMaxLength(35);
|
||||
builder.Property(x => x.City).HasMaxLength(35);
|
||||
builder.Property(x => x.Address).HasMaxLength(500);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(5);
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
builder.Property(x => x.DateOfBirth);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Linq;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ContractingPartyTempRepository : RepositoryBase<long, ContractingPartyTemp>, IContractingPartyTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public ContractingPartyTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
//(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
|
||||
//{
|
||||
// //return _context.PersonalContractingParties.Select(x=>new PersonalContractingPartyViewModel
|
||||
// //{
|
||||
// // id = x.id,
|
||||
// // IsAuthenticated = x.IsAuthenticated,
|
||||
// // Nationalcode = x.Nationalcode,
|
||||
// // IdNumber = x.IdNumber,
|
||||
|
||||
|
||||
// //}).FirstOrDefault(x => x.Nationalcode == nationalcode);
|
||||
|
||||
// return new();
|
||||
//}
|
||||
public (long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user