Compare commits
5 Commits
Feature/ad
...
Feature/Re
| Author | SHA1 | Date | |
|---|---|---|---|
| f5d95b21b0 | |||
| 1f7785581c | |||
| d44a9224be | |||
| 13a2cd78cd | |||
| 91fc560355 |
@@ -1340,6 +1340,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
|
||||
.InstitutionWorkshopInitialId);
|
||||
if (workshopDetails.Employers.Any(x => x.EmployerId == employer.id))
|
||||
{
|
||||
throw new BadRequestException("این کارفرما قبلا در این کارگاه ثبت شده است");
|
||||
}
|
||||
workshopDetails.AddEmployer(employer.id);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1387,12 +1391,14 @@ public class EmployerApplication : IEmployerApplication
|
||||
|
||||
// Get workshop details
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
await _institutionContractRepository
|
||||
.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
if (workshopDetails == null)
|
||||
return operation.Failed("جزئیات کارگاه موسسه یافت نشد");
|
||||
|
||||
// Find and remove the employer from workshop details
|
||||
var employerDetail = workshopDetails.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
var employerDetail = workshopDetails
|
||||
.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
if (employerDetail == null)
|
||||
return operation.Failed("کارفرما در لیست کارگاه یافت نشد");
|
||||
|
||||
@@ -1400,10 +1406,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
workshopDetails.Employers.Remove(employerDetail);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
// Delete the employer
|
||||
_EmployerRepository.Remove(employerId);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
command.ValueAddedTax, [],command.LawId);
|
||||
command.ValueAddedTax, [], command.LawId);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -1046,7 +1046,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.Workshops.Count.ToString(),
|
||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
command.TaxAmount, workshopDetails,command.LawId);
|
||||
command.TaxAmount, workshopDetails, command.LawId);
|
||||
|
||||
|
||||
FinancialStatment financialStatement;
|
||||
@@ -1139,11 +1139,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return opration.Succcedded();
|
||||
@@ -1153,7 +1153,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList()
|
||||
{
|
||||
@@ -1249,8 +1249,31 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (institutionContract.VerifyCode != code)
|
||||
return op.Failed("کد وارد شده صحیح نمی باشد");
|
||||
|
||||
var transaction = await _institutionContractRepository.BeginTransactionAsync();
|
||||
institutionContract.SetPendingWorkflow();
|
||||
|
||||
var phone = institutionContract.ContactInfoList.FirstOrDefault(x =>
|
||||
x.SendSms && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه");
|
||||
if (phone !=null)
|
||||
{
|
||||
var userPass = contractingParty.IsLegal == "حقیقی"
|
||||
? contractingParty.Nationalcode
|
||||
: contractingParty.NationalId;
|
||||
var createAcc = new RegisterAccount
|
||||
{
|
||||
Fullname = contractingParty.LName,
|
||||
Username = userPass,
|
||||
Password = userPass,
|
||||
Mobile = phone.PhoneNumber,
|
||||
NationalCode = userPass
|
||||
};
|
||||
var res = _accountApplication.RegisterClient(createAcc);
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
}
|
||||
|
||||
await transaction.CommitAsync();
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -1274,7 +1297,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
RollCallInPerson = services.RollCallInPerson
|
||||
},
|
||||
WorkshopName = details.WorkshopName,
|
||||
ArchiveCode =newArchiveCode
|
||||
ArchiveCode = newArchiveCode
|
||||
};
|
||||
return res;
|
||||
}
|
||||
@@ -1290,12 +1313,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return await _institutionContractRepository.GetExtensionWorkshops(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request)
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
|
||||
InstitutionContractExtensionPlanRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionInstitutionPlan(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request)
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||
InstitutionContractExtensionPaymentRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionPaymentMethod(request);
|
||||
}
|
||||
@@ -1350,8 +1375,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (request.IsAuth)
|
||||
{
|
||||
legalContractingParty.LegalAuthentication(request.FName,request.LName,request.FatherName,
|
||||
request.IdNumber,null,null,request.BirthDateFa,request.Gender,request.PhoneNumber);
|
||||
legalContractingParty.LegalAuthentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
@@ -1396,7 +1421,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (request.IsAuth)
|
||||
{
|
||||
personalContractingParty.Authentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null,null, request.BirthDateFa, request.Gender,request.PhoneNumber);
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
@@ -1513,4 +1538,4 @@ public class WorkshopsAndEmployeeViewModel
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
@@ -592,7 +592,7 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
var legalTypeValue = legalType == LegalType.Real ? "حقیقی" : "حقوقی";
|
||||
query = query.Where(x => x.IsLegal == legalTypeValue);
|
||||
}
|
||||
|
||||
|
||||
var viewModelQuery = query.Select(x => new EmployerSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -1078,7 +1078,12 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
PlaceOfIssue = employer.PlaceOfIssue,
|
||||
DateOfIssue = employer.DateOfIssue.ToFarsi(),
|
||||
FatherName = employer.FatherName,
|
||||
Gender = employer.Gender == "مرد" ? Gender.Male : Gender.Female,
|
||||
Gender = employer.Gender switch
|
||||
{
|
||||
null => Gender.None,
|
||||
"مرد" => Gender.Male,
|
||||
_ => Gender.Female
|
||||
},
|
||||
GovernmentSystemInfo = governmentSystemInfo,
|
||||
IsAuth = employer.IsAuth,
|
||||
PhoneNumber = employer.Phone,
|
||||
@@ -1110,7 +1115,6 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
CeoIdNumber = employer.IdNumber,
|
||||
IdNumberSeri = employer.IdNumberSeri,
|
||||
TelephoneNumber = employer.IdNumber
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1123,7 +1127,6 @@ public class EmployerRepository : RepositoryBase<long, Employer>, IEmployerRepos
|
||||
InstitutionWorkshopInitialId = contractWorkshopInitial.id,
|
||||
RealEmployer = realEmployer,
|
||||
LegalEmployer = legalEmployer,
|
||||
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1820,7 +1820,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
public async Task<InstitutionContract> GetByPublicIdAsync(Guid id)
|
||||
{
|
||||
return await _context.InstitutionContractSet.FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
return await _context.InstitutionContractSet.Include(x=>x.ContactInfoList).FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId)
|
||||
|
||||
Reference in New Issue
Block a user