Files
Backend-Api/Company.Domain/EmployeeAgg/Employee.cs
2025-03-08 21:49:34 +03:30

234 lines
8.6 KiB
C#

using System;
using System.Collections.Generic;
using _0_Framework.Domain;
using Company.Domain.ClientEmployeeWorkshopAgg;
using Company.Domain.ContractAgg;
using Company.Domain.CustomizeCheckoutAgg;
using Company.Domain.EmployeeBankInformationAgg;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeDocumentsAdminSelectionAgg;
using Company.Domain.EmployeeDocumentsAgg;
using Company.Domain.EmployeeInsuranceRecordAgg;
using Company.Domain.InsuranceEmployeeInfoAgg;
using Company.Domain.LeftWorkAgg;
using Company.Domain.LeftWorkInsuranceAgg;
using Company.Domain.PersonnelCodeAgg;
namespace Company.Domain.EmployeeAgg;
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 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)
{
FName = fName;
LName = lName;
FatherName = fatherName;
DateOfBirth = dateOfBirth;
DateOfIssue = dateOfIssue;
PlaceOfIssue = placeOfIssue;
NationalCode = nationalCode;
IdNumber = idNumber;
Gender = gender;
Nationality = nationality;
Phone = phone;
Address = address;
State = state;
City = city;
IsActive = true;
IsActiveString = "true";
MaritalStatus = maritalStatus;
MilitaryService = militaryService;
LevelOfEducation = levelOfEducation;
FieldOfStudy = fieldOfStudy;
BankCardNumber = bankCardNumber;
BankBranch = bankBranch;
InsuranceCode = insuranceCode;
InsuranceHistoryByYear = insuranceHistoryByYear;
InsuranceHistoryByMonth = insuranceHistoryByMonth;
NumberOfChildren = numberOfChildren;
OfficePhone = officePhone;
MclsUserName = mclsUserName;
MclsPassword = mclsPassword;
EserviceUserName = eserviceUserName;
EservicePassword = eservicePassword;
TaxOfficeUserName = taxOfficeUserName;
TaxOfficepassword = taxOfficepassword;
SanaUserName = sanaUserName;
SanaPassword = sanaPassword;
}
public string FName { get; private set; }
public string LName { get; private set; }
public string FatherName { get; private set; }
public DateTime DateOfBirth { get; private set; }
public DateTime DateOfIssue { get; private set; }
public string PlaceOfIssue { get; private set; }
public string NationalCode { get; private set; }
public string IdNumber { get; private set; }
public string Gender { get; private set; }
public string Nationality { get; private set; }
public string Phone { get; private set; }
public string Address { get; private set; }
public string City { get; private set; }
public string State { get; private set; }
public bool IsActive { get; private set; }
public string IsActiveString { get; set; }
public string MaritalStatus { get; private set; }
public string MilitaryService { get; private set; }
public string LevelOfEducation { get; private set; }
public string FieldOfStudy { get; private set; }
public string BankCardNumber { get; private set; }
public string BankBranch { get; private set; }
public string InsuranceCode { get; private set; }
public string InsuranceHistoryByYear { get; private set; }
public string InsuranceHistoryByMonth { get; private set; }
public string NumberOfChildren { get; private set; }
public string OfficePhone { get; private set; }
public string MclsUserName { get; private set; }
public string MclsPassword { get; private set; }
public string EserviceUserName { get; private set; }
public string EservicePassword { get; private set; }
public string TaxOfficeUserName { get; private set; }
public string TaxOfficepassword { get; private set; }
public string SanaUserName { get; private set; }
public string SanaPassword { get; private set; }
public InsuranceEmployeeInfo InsuranceEmployeeInfo { get; set; }
public List<ClientEmployeeWorkshop> ClientEmployeeWorkshopList { get; set; }
public List<EmployeeChildren> EmployeeChildrenList { get; private set; }
public List<Contract> Contracts { get; private set; }
public List<LeftWork> LeftWorks { get; set; }
public List<LeftWorkInsurance> LeftWorkInsurances { get; set; }
public List<EmployeeInsuranceRecord> EmployeeInsuranceRecords { get; private set; }
public List<PersonnelCodeDomain> PersonnelCodeList { get; set; }
public List<CustomizeCheckout> CustomizeCheckouts { get; set; }
public string FullName => $"{FName} {LName}";
#region Pooya
public List<EmployeeDocuments> EmployeeDocuments { get; set; }
public EmployeeDocumentsAdminSelection EmployeeDocumentsAdminSelection { get; set; }
public List<EmployeeBankInformation> EmployeeBankInformationList { get; set; }
#endregion
#region Mahan
/// <summary>
/// آیا پرسنل احراز هویت شده است
/// </summary>
public bool IsAuthorized { get; set; }
#endregion
//public List<Checkout> Checkouts { get; set; }
public Employee()
{
EmployeeChildrenList = new List<EmployeeChildren>();
Contracts = new List<Contract>();
LeftWorks = new List<LeftWork>();
LeftWorkInsurances = new List<LeftWorkInsurance>();
PersonnelCodeList = new List<PersonnelCodeDomain>();
ClientEmployeeWorkshopList =new List<ClientEmployeeWorkshop>();
CustomizeCheckouts = new List<CustomizeCheckout>();
//Checkouts = new List<Checkout>();
}
public void Edit(string fName, string lName, string fatherName,
DateTime dateOfBirth, DateTime dateOfIssue, string placeOfIssue,
string nationalCode, string idNumber, string gender, string nationality,
string phone, string address, string state, string citi,
string maritalStatus, string militaryService, string levelOfEducation, string fieldOfStudy,
string bankCardNumber, string bankBranch, string insuranceCode, string insuranceHistoryByYear,
string insuranceHistoryByMonth, string numberOfChildren, string officePhone,
string mclsUserName, string mclsPassword, string eserviceUserName, string eservicePassword, string taxOfficeUserName, string taxOfficepassword, string sanaUserName, string sanaPassword)
{
FName = fName;
LName = lName;
FatherName = fatherName;
DateOfBirth = dateOfBirth;
DateOfIssue = dateOfIssue;
PlaceOfIssue = placeOfIssue;
NationalCode = nationalCode;
IdNumber = idNumber;
Gender = gender;
Nationality = nationality;
Phone = phone;
Address = address;
State = state;
City = citi;
MaritalStatus = maritalStatus;
MilitaryService = militaryService;
LevelOfEducation = levelOfEducation;
FieldOfStudy = fieldOfStudy;
BankCardNumber = bankCardNumber;
BankBranch = bankBranch;
InsuranceCode = insuranceCode;
InsuranceHistoryByYear = insuranceHistoryByYear;
InsuranceHistoryByMonth = insuranceHistoryByMonth;
NumberOfChildren = numberOfChildren;
OfficePhone = OfficePhone;
MclsUserName = mclsUserName;
MclsPassword = mclsPassword;
EserviceUserName = eserviceUserName;
EservicePassword = eservicePassword;
TaxOfficeUserName = taxOfficeUserName;
TaxOfficepassword = taxOfficepassword;
SanaUserName = sanaUserName;
SanaPassword = sanaPassword;
}
public void Active()
{
this.IsActive = true;
this.IsActiveString = "true";
}
public void DeActive()
{
this.IsActive = false;
this.IsActiveString = "false";
}
#region Mahan
public void Authorized()
{
IsAuthorized = true;
}
#endregion
}