277 lines
9.2 KiB
C#
277 lines
9.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Security.Cryptography;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.Domain;
|
|
using Company.Domain.InstitutionContractContactInfoAgg;
|
|
using CompanyManagment.App.Contracts.InstitutionContract;
|
|
|
|
namespace Company.Domain.InstitutionContractAgg;
|
|
|
|
public class InstitutionContract : EntityBase
|
|
{
|
|
public InstitutionContract(string contractNo, long representativeId, string representativeName,
|
|
long contractingPartyId,
|
|
string contractingPartyName, DateTime contractDateGr, string contractDateFa, string state, string city,
|
|
string address, DateTime contractStartGr, string contractStartFa, DateTime contractEndGr,
|
|
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
|
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
|
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax)
|
|
{
|
|
ContractNo = contractNo;
|
|
RepresentativeId = representativeId;
|
|
RepresentativeName = representativeName;
|
|
ContractingPartyId = contractingPartyId;
|
|
ContractingPartyName = contractingPartyName;
|
|
ContractDateGr = contractDateGr;
|
|
ContractDateFa = contractDateFa;
|
|
State = state;
|
|
City = city;
|
|
Address = address;
|
|
//ContactInfoId = contactInfoId;
|
|
ContractStartGr = contractStartGr;
|
|
ContractStartFa = contractStartFa;
|
|
ContractEndGr = contractEndGr;
|
|
ContractEndFa = contractEndFa;
|
|
ContractAmount = contractAmount;
|
|
DailyCompenseation = dailyCompenseation;
|
|
Obligation = obligation;
|
|
TotalAmount = totalAmount;
|
|
ExtensionNo = extensionNo;
|
|
WorkshopManualCount = workshopManualCount;
|
|
EmployeeManualCount = employeeManualCount;
|
|
Description = description;
|
|
OfficialCompany = officialCompany;
|
|
|
|
IsActiveString = "true";
|
|
Signature = "0";
|
|
TypeOfContract = typeOfcontract;
|
|
HasValueAddedTax = hasValueAddedTax;
|
|
ValueAddedTax = valueAddedTax;
|
|
Status = InstitutionContractStatus.Incomplete;
|
|
ContactInfoList = [];
|
|
WorkshopDetails = [];
|
|
Installments = [];
|
|
}
|
|
|
|
public string ContractNo { get; private set; }
|
|
|
|
public long RepresentativeId { get; private set; }
|
|
public string RepresentativeName { get; private set; }
|
|
public long ContractingPartyId { get; private set; }
|
|
public string ContractingPartyName { get; private set; }
|
|
public DateTime ContractDateGr { get; private set; }
|
|
public string ContractDateFa { get; private set; }
|
|
public string State { get; private set; }
|
|
public string City { get; private set; }
|
|
|
|
public string Address { get; private set; }
|
|
|
|
//public long ContactInfoId { get; private set; }
|
|
public DateTime ContractStartGr { get; private set; }
|
|
public string ContractStartFa { get; private set; }
|
|
public DateTime ContractEndGr { get; private set; }
|
|
public string ContractEndFa { get; private set; }
|
|
|
|
// مبلغ قرارداد
|
|
public double ContractAmount { get; private set; }
|
|
|
|
//خسارت روزانه
|
|
public double DailyCompenseation { get; private set; }
|
|
|
|
//وجه التزام
|
|
public double Obligation { get; private set; }
|
|
|
|
// مبلغ کل قرارداد
|
|
public double TotalAmount { get; private set; }
|
|
public string WorkshopManualCount { get; private set; }
|
|
public string EmployeeManualCount { get; private set; }
|
|
public string IsActiveString { get; private set; }
|
|
public int ExtensionNo { get; private set; }
|
|
public string Description { get; private set; }
|
|
public string Signature { get; private set; }
|
|
public string OfficialCompany { get; private set; }
|
|
public string TypeOfContract { get; private set; }
|
|
public string HasValueAddedTax { get; set; }
|
|
public double ValueAddedTax { get; set; }
|
|
public InstitutionContractStatus Status { get; private set; }
|
|
|
|
public List<InstitutionContractWorkshopDetail> WorkshopDetails { get; set; }
|
|
|
|
public List<InstitutionContractContactInfo> ContactInfoList { get; set; }
|
|
|
|
public List<InstitutionContractInstallment> Installments { get; set; }
|
|
|
|
public InstitutionContract()
|
|
{
|
|
ContactInfoList = [];
|
|
WorkshopDetails = [];
|
|
Installments = [];
|
|
}
|
|
|
|
public void Edit(DateTime contractDateGr, string contractDateFa, string state, string city, string address,
|
|
DateTime contractStartGr, string contractStartFa, DateTime contractEndGr, string contractEndFa,
|
|
double contractAmount, double dailyCompenseation, double obligation, double totalAmount,
|
|
string workshopManualCount, string employeeManualCount, string description, string officialCompany,
|
|
string typeOfcontract, double valueAddedTax, string hasValueAddedTax)
|
|
{
|
|
ContractDateGr = contractDateGr;
|
|
ContractDateFa = contractDateFa;
|
|
State = state;
|
|
City = city;
|
|
Address = address;
|
|
|
|
ContractStartGr = contractStartGr;
|
|
ContractStartFa = contractStartFa;
|
|
ContractEndGr = contractEndGr;
|
|
ContractEndFa = contractEndFa;
|
|
ContractAmount = contractAmount;
|
|
DailyCompenseation = dailyCompenseation;
|
|
Obligation = obligation;
|
|
TotalAmount = totalAmount;
|
|
WorkshopManualCount = workshopManualCount;
|
|
EmployeeManualCount = employeeManualCount;
|
|
Description = description;
|
|
OfficialCompany = officialCompany;
|
|
TypeOfContract = typeOfcontract;
|
|
|
|
HasValueAddedTax = hasValueAddedTax;
|
|
ValueAddedTax = valueAddedTax;
|
|
}
|
|
|
|
public void Active()
|
|
{
|
|
this.IsActiveString = "true";
|
|
}
|
|
|
|
public void DeActive()
|
|
{
|
|
this.IsActiveString = "false";
|
|
}
|
|
|
|
public void DeActiveBlue()
|
|
{
|
|
this.IsActiveString = "blue";
|
|
}
|
|
|
|
public void Sign()
|
|
{
|
|
this.Signature = "1";
|
|
}
|
|
|
|
public void UnSign()
|
|
{
|
|
this.Signature = "0";
|
|
}
|
|
|
|
public void Complete()
|
|
{
|
|
Status = InstitutionContractStatus.Completed;
|
|
}
|
|
|
|
public void SetWorkshopDetails(List<InstitutionContractWorkshopDetail> commandWorkshops)
|
|
{
|
|
WorkshopDetails = commandWorkshops;
|
|
}
|
|
|
|
public void SetInstallments(List<InstitutionContractInstallment> installments)
|
|
{
|
|
Installments = installments;
|
|
}
|
|
}
|
|
|
|
public class InstitutionContractWorkshopDetail:EntityBase
|
|
{
|
|
public InstitutionContractWorkshopDetail( string workshopName, bool hasRollCallPlan,
|
|
bool hasCustomizeCheckoutPlan, bool hasContractPlan,int personnelCount)
|
|
{
|
|
WorkshopName = workshopName;
|
|
HasRollCallPlan = hasRollCallPlan;
|
|
HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
|
|
HasContractPlan = hasContractPlan;
|
|
PersonnelCount = personnelCount;
|
|
}
|
|
|
|
/// <summary>
|
|
/// شناسه کارگاه
|
|
/// </summary>
|
|
public long? WorkshopId { get; private set; }
|
|
|
|
/// <summary>
|
|
/// نام کارگاه
|
|
/// </summary>
|
|
public string WorkshopName { get; private set; }
|
|
|
|
/// <summary>
|
|
/// پلن حضور و غیاب
|
|
/// </summary>
|
|
public bool HasRollCallPlan { get; private set; }
|
|
|
|
/// <summary>
|
|
/// پلن فیش غیر رسمی
|
|
/// </summary>
|
|
public bool HasCustomizeCheckoutPlan { get; private set; }
|
|
|
|
/// <summary>
|
|
/// پلن قرارداد و تصفیه
|
|
/// </summary>
|
|
public bool HasContractPlan { get; private set; }
|
|
|
|
public int PersonnelCount { get; private set; }
|
|
|
|
/// <summary>
|
|
/// شناسه قرارداد نهاد مرتبط
|
|
/// </summary>
|
|
public long InstitutionContractId { get; private set; }
|
|
|
|
private InstitutionContractWorkshopDetail()
|
|
{
|
|
}
|
|
|
|
public void Edit(bool hasAttendancePlan, bool hasUnofficialPayslipPlan, bool hasContractSettlementPlan)
|
|
{
|
|
HasRollCallPlan = hasAttendancePlan;
|
|
HasCustomizeCheckoutPlan = hasUnofficialPayslipPlan;
|
|
HasContractPlan = hasContractSettlementPlan;
|
|
}
|
|
|
|
public void SetWorkshopId(long workshopId)
|
|
{
|
|
WorkshopId = workshopId;
|
|
}
|
|
}
|
|
|
|
public enum InstitutionContractStatus
|
|
{
|
|
/// <summary>
|
|
/// ناتمام - قرارداد هنوز تکمیل نشده و نیاز به انجام کارهای بیشتر دارد
|
|
/// </summary>
|
|
Incomplete = 0,
|
|
|
|
/// <summary>
|
|
/// تکمیل شده - قرارداد به طور کامل انجام شده و نهایی شده است
|
|
/// </summary>
|
|
Completed = 1
|
|
}
|
|
|
|
public class InstitutionContractInstallment
|
|
{
|
|
public InstitutionContractInstallment(DateTime installmentDateGr, double amount,
|
|
string description)
|
|
{
|
|
InstallmentDateGr = installmentDateGr;
|
|
InstallmentDateFa = installmentDateGr.ToFarsi();
|
|
Amount = amount;
|
|
Description = description;
|
|
}
|
|
|
|
public long Id { get; private set; }
|
|
public DateTime InstallmentDateGr { get; private set; }
|
|
public string InstallmentDateFa { get; private set; }
|
|
public double Amount { get; private set; }
|
|
public string Description { get; private set; }
|
|
|
|
public long InstitutionContractId { get; private set; }
|
|
|
|
public InstitutionContract InstitutionContract { get; private set; }
|
|
} |