finish employee unauthorized
This commit is contained in:
@@ -29,6 +29,7 @@ public class CreateEmployeeByClient
|
||||
public bool HasEmployeeDocument { get; set; }
|
||||
public bool HasRollCallService { get; set; }
|
||||
public bool CanceledAuthorize { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -996,9 +996,23 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
// return op.Failed("این پرسنل قبلا افزوده شده است و در انتظار تایید میباشد");
|
||||
//}
|
||||
|
||||
|
||||
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(command.NationalCode);
|
||||
|
||||
var workshop = _WorkShopRepository.GetDetails(command.WorkshopId);
|
||||
if (employee == null)
|
||||
|
||||
if (employee == null && command.CanceledAuthorize)
|
||||
{
|
||||
var birthDate = command.BirthDate.ToGeorgianDateTime();
|
||||
var dateOfIssue = new DateTime(1922, 1, 1);
|
||||
|
||||
employee = new Employee(command.FirstName, command.LastName, null, birthDate,
|
||||
dateOfIssue, null, command.NationalCode, null, command.Gender, "ایرانی", null, null);
|
||||
_EmployeeRepository.Create(employee);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
}
|
||||
if (employee == null)
|
||||
{
|
||||
return op.Failed("خطای سیستمی. لطفا دوباره تلاش کنید . درصورت تکرار این مشکل با تیم پشتیبان تماس بگیرید");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user