136
Продолжение приложения 3
}
}
else
ImgWorker.Source = foto;
}
else
{
GWin.DataContext = null;
GMilitaries.DataContext = null;
GEducation.DataContext = null;
CbSex.SelectedIndex = -1;
CbMilitaryRank.SelectedIndex = -1;
CbFamilyStatus.SelectedIndex = -1;
CbProfession.SelectedIndex = -1;
ImgWorker.Source = foto;
}
}
private async Task<Model.WorkersPartial> GetWorkersPartial(int index)
{
Model.WorkersPartial res = null;
if (index > -1)
{
if (_dictionary.Count > 0)
res = _dictionary.Where(x => x.Key == index).Select(x =>
x.Value).FirstOrDefault();
if (res == null)
{
res = await _workersRepository.Items.Include(x =>
x.Dismissals).Where(x => x.SweatshopId == sweatshopId && x.Dismissals.Dismissing ==
"Принят")
.OrderBy(x => x.Id).Skip(index).Take(1).Select(x => new
Model.WorkersPartial
{
Id = x.Id,
DocumentId = x.DocumentId,
ProfessionId = x.ProfessionId,
NationalityId = x.NationalityId,
CitizenshipId = x.CitizenshipId,
DepartmentId = x.DepartmentId,
EducationId = x.EducationId,
MilitaryId = x.MilitaryId,
DismissingId = x.DismissingId,
SweatshopId = x.SweatshopId,
Surname = x.Surname,
Name = x.Name,
Patronymic = x.Patronymic,
Sex = x.Sex,
Age = x.Age,
FamilyStatus = x.FamilyStatus,
DateOfBirth = x.DateOfBirth,
DocumentNambe = x.DocumentNambe,
IIN = x.IIN,
DateOfIssue = x.DateOfIssue,
Address = x.Address,
Rank = x.Rank,
Proficiency = x.Proficiency,
Foto = x.Foto,
Phone = x.Phone,
MPhone = x.MPhone,
DeviceDate = x.DeviceDate,
TrialPeriod = x.TrialPeriod,
Experience = x.Experience,