TemporaryClientRegistration - InstitutionContractTemp
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework_b.Domain;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IInstitutionContractTempRepository : IRepository<long, InstitutionContractTemp>
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت قرارداد موقت
|
||||
/// با توجه به آیدی طرف حساب
|
||||
/// یا آیدی قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="contractingPartyId"></param>
|
||||
/// <returns></returns>
|
||||
Task<InstitutionContractTempViewModel> GetInstitutionContractTemp(long id,long contractingPartyTempId);
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public class InstitutionContractTemp : EntityBase
|
||||
{
|
||||
public InstitutionContractTemp(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
ContractingPartyTempId = contractingPartyTempId;
|
||||
PaymentModel = paymentModel;
|
||||
PeriodModel = periodModel;
|
||||
TotalPayment = totalPayment;
|
||||
ContractStartGr = contractStartGr;
|
||||
ContractEndGr = contractEndGr;
|
||||
OfficialCompany = officialCompany;
|
||||
ValueAddedTax = valueAddedTax;
|
||||
VerifyCode = verifyCode;
|
||||
RegistrationStatus = registrationStatus;
|
||||
MessageId = messageId;
|
||||
SendVerifyCodeTime = sendVerifyCodeTime;
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدل پرداخت
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ کل قرارداد
|
||||
/// </summary>
|
||||
public double TotalPayment { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شرع قراداد
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartGr { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قراداد شمسی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پرداخت بصورت رسمی با غیر رسمی
|
||||
/// </summary>
|
||||
public string OfficialCompany { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ مالیات بر ارزش افزوده
|
||||
/// </summary>
|
||||
public double ValueAddedTax { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد شش رقمی ثبت قرارداد
|
||||
/// </summary>
|
||||
public string VerifyCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت ثبت نام
|
||||
/// -
|
||||
/// BeforeSendVerifyCode قبل از ارسال کد
|
||||
/// -
|
||||
/// VerifyCodeSent کد ارسال شده
|
||||
/// -
|
||||
/// Completed ثبت نام تکمیل شده
|
||||
/// </summary>
|
||||
public string RegistrationStatus { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی پیامک ارسال شده
|
||||
/// </summary>
|
||||
public int MessageId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ثبت زمان ارسال کد
|
||||
/// </summary>
|
||||
public DateTime? SendVerifyCodeTime { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// زمان پایان مهلت ارسال کد
|
||||
/// </summary>
|
||||
public DateTime? VerifyCodeEndTime{ get; private set; }
|
||||
|
||||
|
||||
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
ContractingPartyTempId = contractingPartyTempId;
|
||||
PaymentModel = paymentModel;
|
||||
PeriodModel = periodModel;
|
||||
TotalPayment = totalPayment;
|
||||
ContractStartGr = contractStartGr;
|
||||
ContractEndGr = contractEndGr;
|
||||
OfficialCompany = officialCompany;
|
||||
ValueAddedTax = valueAddedTax;
|
||||
VerifyCode = verifyCode;
|
||||
RegistrationStatus = registrationStatus;
|
||||
MessageId = messageId;
|
||||
SendVerifyCodeTime = sendVerifyCodeTime;
|
||||
VerifyCodeEndTime = verifyCodeEndTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class CreateInstitutionContractTemp
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدل پرداخت
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصورت ماهیانه
|
||||
/// </summary>
|
||||
public string PaymentModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// </summary>
|
||||
public string PeriodModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ کل قرارداد
|
||||
/// </summary>
|
||||
public double TotalPayment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شرع قراداد
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قراداد شمسی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// پرداخت بصورت رسمی با غیر رسمی
|
||||
/// </summary>
|
||||
public string OfficialCompany { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ مالیات بر ارزش افزوده
|
||||
/// </summary>
|
||||
public double ValueAddedTax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد شش رقمی ثبت قرارداد
|
||||
/// </summary>
|
||||
public string VerifyCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت ثبت نام
|
||||
/// -
|
||||
/// BeforeSendVerifyCode قبل از ارسال کد
|
||||
/// -
|
||||
/// VerifyCodeSent کد ارسال شده
|
||||
/// -
|
||||
/// Completed ثبت نام تکمیل شده
|
||||
/// </summary>
|
||||
public string RegistrationStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی پیامک ارسال شده
|
||||
/// </summary>
|
||||
public int MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ثبت زمان ارسال کد
|
||||
/// </summary>
|
||||
public DateTime? SendVerifyCodeTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// زمان پایان مهلت ارسال کد
|
||||
/// </summary>
|
||||
public DateTime? VerifyCodeEndTime { get; set; }
|
||||
}
|
||||
@@ -56,4 +56,11 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class InstitutionContractTempViewModel : CreateInstitutionContractTemp
|
||||
{
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -21,9 +21,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
private readonly IWorkshopTempRepository _workshopTempRepository;
|
||||
private readonly IPlanPercentageRepository _planPercentageRepository;
|
||||
private readonly IWorkshopServicesTempRepository _workshopServicesTempRepository;
|
||||
private readonly IInstitutionContractTempRepository _institutionContractTempRepository;
|
||||
|
||||
|
||||
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService, IWorkshopTempRepository workshopTempRepository, IPlanPercentageRepository planPercentageRepository, IWorkshopServicesTempRepository workshopServicesTempRepository)
|
||||
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService, IWorkshopTempRepository workshopTempRepository, IPlanPercentageRepository planPercentageRepository, IWorkshopServicesTempRepository workshopServicesTempRepository, IInstitutionContractTempRepository institutionContractTempRepository)
|
||||
{
|
||||
_contractingPartyTempRepository = contractingPartyTempRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
@@ -31,6 +31,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_workshopTempRepository = workshopTempRepository;
|
||||
_planPercentageRepository = planPercentageRepository;
|
||||
_workshopServicesTempRepository = workshopServicesTempRepository;
|
||||
_institutionContractTempRepository = institutionContractTempRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -390,4 +391,20 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var contractingPartyTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
|
||||
if(contractingPartyTemp == null)
|
||||
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -195,6 +195,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<ContractingPartyTemp> ContractingPartyTemps { get; set; }
|
||||
public DbSet<WorkshopTemp> WorkshopTemps { get; set; }
|
||||
public DbSet<WorkshopServicesTemp> WorkshopServicesTemps { get; set; }
|
||||
public DbSet<InstitutionContractTemp> InstitutionContractTemps { get; set; }
|
||||
#endregion
|
||||
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
|
||||
public DbSet<CustomizeCheckoutTemp> CustomizeCheckoutTemps { get; set; }
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class InstitutionContractTempMapping : IEntityTypeConfiguration<InstitutionContractTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<InstitutionContractTemp> builder)
|
||||
{
|
||||
builder.ToTable("InstitutionContractTemps");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.RegistrationStatus).HasMaxLength(30);
|
||||
builder.Property(x => x.PaymentModel).HasMaxLength(30);
|
||||
builder.Property(x => x.PeriodModel).HasMaxLength(3);
|
||||
builder.Property(x => x.OfficialCompany).HasMaxLength(30);
|
||||
builder.Property(x => x.VerifyCode).HasMaxLength(6);
|
||||
builder.Property(x => x.ContractStartGr);
|
||||
builder.Property(x => x.ContractEndGr);
|
||||
builder.Property(x => x.SendVerifyCodeTime).IsRequired(false);
|
||||
builder.Property(x => x.VerifyCodeEndTime).IsRequired(false);
|
||||
builder.Property(x => x.TotalPayment);
|
||||
builder.Property(x => x.ValueAddedTax);
|
||||
builder.Property(x => x.ContractingPartyTempId);
|
||||
builder.Property(x => x.MessageId);
|
||||
|
||||
}
|
||||
}
|
||||
9353
CompanyManagment.EFCore/Migrations/20250414150631_InstitutionContractTemp.Designer.cs
generated
Normal file
9353
CompanyManagment.EFCore/Migrations/20250414150631_InstitutionContractTemp.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InstitutionContractTemp : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InstitutionContractTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ContractingPartyTempId = table.Column<long>(type: "bigint", nullable: false),
|
||||
PaymentModel = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
|
||||
PeriodModel = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true),
|
||||
TotalPayment = table.Column<double>(type: "float", nullable: false),
|
||||
ContractStartGr = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ContractEndGr = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
OfficialCompany = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
|
||||
ValueAddedTax = table.Column<double>(type: "float", nullable: false),
|
||||
VerifyCode = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true),
|
||||
RegistrationStatus = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
|
||||
MessageId = table.Column<int>(type: "int", nullable: false),
|
||||
SendVerifyCodeTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
VerifyCodeEndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InstitutionContractTemps", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "InstitutionContractTemps");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4917,6 +4917,66 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("ContractEndGr")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("ContractStartGr")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("ContractingPartyTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("MessageId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("OfficialCompany")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("PaymentModel")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("PeriodModel")
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("nvarchar(3)");
|
||||
|
||||
b.Property<string>("RegistrationStatus")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<DateTime?>("SendVerifyCodeTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("TotalPayment")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("ValueAddedTax")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("VerifyCode")
|
||||
.HasMaxLength(6)
|
||||
.HasColumnType("nvarchar(6)");
|
||||
|
||||
b.Property<DateTime?>("VerifyCodeEndTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("InstitutionContractTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class InstitutionContractTempRepository : RepositoryBase<long, InstitutionContractTemp>, IInstitutionContractTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public InstitutionContractTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دریافت قرارداد موقت
|
||||
/// با توجه به آیدی طرف حساب
|
||||
/// یا آیدی قرارداد
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="contractingPartyId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<InstitutionContractTempViewModel> GetInstitutionContractTemp(long id, long contractingPartyTempId)
|
||||
{
|
||||
return await _context.InstitutionContractTemps
|
||||
.Where(x => x.id == id || x.ContractingPartyTempId == contractingPartyTempId)
|
||||
.Select(x => new InstitutionContractTempViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractingPartyTempId = x.ContractingPartyTempId,
|
||||
RegistrationStatus = x.RegistrationStatus,
|
||||
PaymentModel = x.PaymentModel,
|
||||
PeriodModel = x.PeriodModel,
|
||||
TotalPayment = x.TotalPayment,
|
||||
ContractStartGr = x.ContractStartGr,
|
||||
ContractEndGr = x.ContractEndGr,
|
||||
OfficialCompany = x.OfficialCompany,
|
||||
ValueAddedTax = x.ValueAddedTax,
|
||||
VerifyCode = x.VerifyCode,
|
||||
SendVerifyCodeTime = x.SendVerifyCodeTime,
|
||||
VerifyCodeEndTime = x.VerifyCodeEndTime,
|
||||
MessageId = x.MessageId
|
||||
}).FirstOrDefaultAsync();
|
||||
}
|
||||
}
|
||||
@@ -455,6 +455,8 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<IWorkshopTempRepository, WorkshopTempRepository>();
|
||||
services.AddTransient<IWorkshopServicesTempRepository, WorkshopServicesTempRepository>();
|
||||
|
||||
services.AddTransient<IInstitutionContractTempRepository, InstitutionContractTempRepository>();
|
||||
|
||||
#endregion
|
||||
services.AddTransient<IRollCallDomainService, RollCallDomainService>();
|
||||
|
||||
|
||||
@@ -77,74 +77,76 @@ namespace ServiceHost.Pages
|
||||
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
//اصلاحات محاسبه عیدی در فیش حقوقی
|
||||
// _computeOptions.GetAllByWorkshopId(170);
|
||||
//اصلاحات محاصبه پایه سنوات در فیش حقوقی
|
||||
//_yearlySalaryRepository.TestDayliFeeCompute();
|
||||
bool ex = false;
|
||||
//while (!ex)
|
||||
//{
|
||||
// Console.WriteLine("enter National code ... ");
|
||||
// var nationalCode = Console.ReadLine();
|
||||
// Console.WriteLine("enter DateOfBirth ... ");
|
||||
// var dateOfBirth = Console.ReadLine();
|
||||
// Console.WriteLine("enter phoneNumber ... ");
|
||||
// var phone = Console.ReadLine();
|
||||
// var res = _clientRegistrationApplication.CreateContractingPartyTemp(nationalCode, dateOfBirth, phone).GetAwaiter().GetResult();
|
||||
// if (res.IsSuccedded)
|
||||
// {
|
||||
// var updateAddress =
|
||||
// _clientRegistrationApplication.UpdateAddress(res.Data.Id, "gilan", "rasht", "hajiabad").GetAwaiter().GetResult();
|
||||
// if (updateAddress.IsSuccedded)
|
||||
// {
|
||||
// var workshopSelected = _clientRegistrationApplication.GetWorkshopTemp(res.Data.Id).GetAwaiter().GetResult();
|
||||
// if (workshopSelected.Count > 0)
|
||||
// {
|
||||
// var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id).GetAwaiter().GetResult();
|
||||
// Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble);
|
||||
// Console.WriteLine("sumOfWorkshopPayment : " + result.TotalPaymentDouble);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var workshops = new List<WorkshopTempViewModel>();
|
||||
// workshops.Add(new WorkshopTempViewModel
|
||||
// {
|
||||
// ContractAndCheckout = true,
|
||||
// ContractingPartyTempId = res.Data.Id,
|
||||
// CountPerson = 10,
|
||||
// CustomizeCheckout = true,
|
||||
// Insurance = true,
|
||||
// RollCall = true,
|
||||
// WorkshopName = "dadmehr",
|
||||
while (!ex)
|
||||
{
|
||||
Console.WriteLine("enter National code ... ");
|
||||
var nationalCode = Console.ReadLine();
|
||||
Console.WriteLine("enter DateOfBirth ... ");
|
||||
var dateOfBirth = Console.ReadLine();
|
||||
Console.WriteLine("enter phoneNumber ... ");
|
||||
var phone = Console.ReadLine();
|
||||
var res = _clientRegistrationApplication.CreateContractingPartyTemp(nationalCode, dateOfBirth, phone).GetAwaiter().GetResult();
|
||||
if (res.IsSuccedded)
|
||||
{
|
||||
var updateAddress =
|
||||
_clientRegistrationApplication.UpdateAddress(res.Data.Id, "gilan", "rasht", "hajiabad").GetAwaiter().GetResult();
|
||||
if (updateAddress.IsSuccedded)
|
||||
{
|
||||
var workshopSelected = _clientRegistrationApplication.GetWorkshopTemp(res.Data.Id).GetAwaiter().GetResult();
|
||||
if (workshopSelected.Count > 0)
|
||||
{
|
||||
var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id,"12","OneTime").GetAwaiter().GetResult();
|
||||
Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble);
|
||||
Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble);
|
||||
}
|
||||
else
|
||||
{
|
||||
var workshops = new List<WorkshopTempViewModel>();
|
||||
workshops.Add(new WorkshopTempViewModel
|
||||
{
|
||||
ContractAndCheckout = true,
|
||||
ContractingPartyTempId = res.Data.Id,
|
||||
CountPerson = 10,
|
||||
CustomizeCheckout = true,
|
||||
Insurance = true,
|
||||
RollCall = true,
|
||||
WorkshopName = "dadmehr",
|
||||
|
||||
// });
|
||||
// workshops.Add(new WorkshopTempViewModel
|
||||
// {
|
||||
// ContractAndCheckout = true,
|
||||
// ContractingPartyTempId = res.Data.Id,
|
||||
// CountPerson = 20,
|
||||
// CustomizeCheckout = true,
|
||||
// Insurance = true,
|
||||
// RollCall = true,
|
||||
// WorkshopName = "kababMahdi",
|
||||
});
|
||||
workshops.Add(new WorkshopTempViewModel
|
||||
{
|
||||
ContractAndCheckout = true,
|
||||
ContractingPartyTempId = res.Data.Id,
|
||||
CountPerson = 20,
|
||||
CustomizeCheckout = true,
|
||||
Insurance = true,
|
||||
RollCall = true,
|
||||
WorkshopName = "kababMahdi",
|
||||
|
||||
// });
|
||||
// var creteWorkshops = _clientRegistrationApplication.CreateOrUpdateWorkshopTemp(workshops)
|
||||
// .GetAwaiter().GetResult();
|
||||
});
|
||||
var creteWorkshops = _clientRegistrationApplication.CreateOrUpdateWorkshopTemp(workshops)
|
||||
.GetAwaiter().GetResult();
|
||||
|
||||
// if (creteWorkshops.IsSuccedded)
|
||||
// {
|
||||
// var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id).GetAwaiter().GetResult();
|
||||
// Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble);
|
||||
// Console.WriteLine("sumOfWorkshopPayment : " + result.TotalPaymentDouble);
|
||||
// }
|
||||
// }
|
||||
if (creteWorkshops.IsSuccedded)
|
||||
{
|
||||
var result = _clientRegistrationApplication.GetTotalPaymentAndWorkshopList(res.Data.Id).GetAwaiter().GetResult();
|
||||
Console.WriteLine("sumOfWorkshopPayment : " + result.SumOfWorkshopsPaymentDouble);
|
||||
Console.WriteLine("TotalPaymentDouble : " + result.TotalPaymentDouble);
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("do you want to exit ... ");
|
||||
// var exitCheck = Console.ReadLine();
|
||||
// if (exitCheck == "yes")
|
||||
// ex = true;
|
||||
//}
|
||||
}
|
||||
}
|
||||
Console.WriteLine("do you want to exit ... ");
|
||||
var exitCheck = Console.ReadLine();
|
||||
if (exitCheck == "yes")
|
||||
ex = true;
|
||||
}
|
||||
|
||||
// while (!ex)
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user