113 lines
3.2 KiB
C#
113 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.Domain;
|
|
|
|
namespace Company.Domain.EmployeeComputeOptionsAgg
|
|
{
|
|
public class EmployeeComputeOptions : EntityBase
|
|
{
|
|
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions,
|
|
bool createContract, bool signContract, bool createCheckout, bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
|
{
|
|
WorkshopId = workshopId;
|
|
EmployeeId = employeeId;
|
|
ComputeOptions = computeOptions;
|
|
BonusesOptions = bonusesOptions;
|
|
YearsOptions = yearsOptions;
|
|
ContractTerm = contractTerm;
|
|
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
|
|
|
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
|
}
|
|
|
|
|
|
|
|
public long WorkshopId { get; private set; }
|
|
public long EmployeeId { get; private set; }
|
|
|
|
//نحوه محاسبه مزد مرخصی
|
|
public string ComputeOptions { get; private set; }
|
|
//نحوه محاسبه عیدی
|
|
public string BonusesOptions { get; private set; }
|
|
//نحوه محاسبه سنوات
|
|
public string YearsOptions { get; private set; }
|
|
|
|
/// <summary>
|
|
/// ایجاد قرارداد
|
|
/// </summary>
|
|
public bool CreateContract { get; private set; }
|
|
|
|
/// <summary>
|
|
/// امضای قرارداد
|
|
/// </summary>
|
|
public bool SignContract { get; private set; }
|
|
/// <summary>
|
|
/// ایجاد تصفیه
|
|
/// </summary>
|
|
public bool CreateCheckout { get; private set; }
|
|
/// <summary>
|
|
/// امضای تصفیه
|
|
/// </summary>
|
|
public bool SignCheckout { get; private set; }
|
|
|
|
/// <summary>
|
|
/// مدت قرارداد
|
|
/// </summary>
|
|
public string ContractTerm { get; private set; }
|
|
|
|
/// <summary>
|
|
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
|
/// این آیتم
|
|
/// True
|
|
/// است
|
|
/// </summary>
|
|
public IsActive CutContractEndOfYear { get; private set; }
|
|
|
|
|
|
|
|
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
|
|
bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
|
{
|
|
ComputeOptions = computeOptions;
|
|
BonusesOptions = bonusesOptions;
|
|
YearsOptions = yearsOptions;
|
|
|
|
ContractTerm = contractTerm;
|
|
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
|
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
|
}
|
|
|
|
|
|
|
|
private void SetContractAndCheckoutOptions(bool createContract, bool signContract, bool createCheckout,
|
|
bool signCheckout)
|
|
{
|
|
CreateContract = createContract;
|
|
if (createContract)
|
|
{
|
|
SignContract = signContract;
|
|
CreateCheckout = createCheckout;
|
|
if (createCheckout)
|
|
{
|
|
SignCheckout = signCheckout;
|
|
}
|
|
else
|
|
{
|
|
SignCheckout = false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SignContract = false;
|
|
CreateCheckout = false;
|
|
SignCheckout = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|