Commit 405898ef by Alex Nasyr

status "not found" added

parent 982c961b
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
......@@ -42,16 +42,15 @@ namespace SocialMinistryDataExchange.Model.DB.Center {
}
catch(Exception ex){
// TODO log exception
return Task.FromResult(FormatResponce(new List<SMResponceTemp>()));
return Task.FromResult(FormatResponce(new List<SMResponceTemp>() { new SMResponceTemp() { rowguid_eais = doc.rowguid_eais, СерияДокумента = doc.document_seria, НомерДокумента = doc.document_number } }));
}
}
private List<SMResponce> FormatResponce(List<SMResponceTemp> records) {
List<SMResponce> responce = new();
if (records.Count > 0) {
// записи найдены
foreach (SMResponceTemp record in records) {
var SMRecord = new SMResponce();
foreach (SMResponceTemp record in records) {
var SMRecord = new SMResponce();
if (record.Личность != Guid.Empty) { // записи найдены ??? null ???
SMRecord.rowguid_eais = record.rowguid_eais;
SMRecord.TerritoryName = record.ТерриторияShortname;
SMRecord.PersonFamilyName = record.Фамилия;
......@@ -69,14 +68,23 @@ namespace SocialMinistryDataExchange.Model.DB.Center {
SMRecord.PersonSnils = record.Снилс;
SMRecord.rowguid_contingent = record.Личность.ToString();
responce.Add(SMRecord);
SMRecord.Status = record.ПриказОтчисления == null ? record.ПриказЗачисления == null ? "3" : "1" : "2";
SMRecord.StatusDate = SMRecord.Status switch {
"1" => record.НачальнаяДата,
"2" => record.КонечнаяДата,
_ => DateTime.Now,
};
}
else {
// записи не найдены
SMRecord.rowguid_eais = record.rowguid_eais;
SMRecord.PersonDocumentSeria = record.СерияДокумента;
SMRecord.PersonDocumentNumber = record.НомерДокумента;
SMRecord.Status = "3";
}
responce.Add(SMRecord);
}
else {
// записи не найдены
}
return responce;
}
......
......@@ -17,7 +17,7 @@ namespace SocialMinistryDataExchange.Model {
public string PersonSnils { get; set; }
public string rowguid_contingent { get; set; }
public string Status { get; set; }
public DateTime StatusDate { get; set; }
public DateTime? StatusDate { get; set; }
public string FounderType { get; set; }
public string OrganizationType { get; set; }
public string EducationProgram { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment