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 { ...@@ -42,16 +42,15 @@ namespace SocialMinistryDataExchange.Model.DB.Center {
} }
catch(Exception ex){ catch(Exception ex){
// TODO log exception // 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) { private List<SMResponce> FormatResponce(List<SMResponceTemp> records) {
List<SMResponce> responce = new(); List<SMResponce> responce = new();
if (records.Count > 0) { foreach (SMResponceTemp record in records) {
// записи найдены var SMRecord = new SMResponce();
foreach (SMResponceTemp record in records) { if (record.Личность != Guid.Empty) { // записи найдены ??? null ???
var SMRecord = new SMResponce();
SMRecord.rowguid_eais = record.rowguid_eais; SMRecord.rowguid_eais = record.rowguid_eais;
SMRecord.TerritoryName = record.ТерриторияShortname; SMRecord.TerritoryName = record.ТерриторияShortname;
SMRecord.PersonFamilyName = record.Фамилия; SMRecord.PersonFamilyName = record.Фамилия;
...@@ -69,14 +68,23 @@ namespace SocialMinistryDataExchange.Model.DB.Center { ...@@ -69,14 +68,23 @@ namespace SocialMinistryDataExchange.Model.DB.Center {
SMRecord.PersonSnils = record.Снилс; SMRecord.PersonSnils = record.Снилс;
SMRecord.rowguid_contingent = record.Личность.ToString(); SMRecord.rowguid_contingent = record.Личность.ToString();
SMRecord.Status = record.ПриказОтчисления == null ? record.ПриказЗачисления == null ? "3" : "1" : "2";
SMRecord.StatusDate = SMRecord.Status switch {
responce.Add(SMRecord); "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; return responce;
} }
......
...@@ -17,7 +17,7 @@ namespace SocialMinistryDataExchange.Model { ...@@ -17,7 +17,7 @@ namespace SocialMinistryDataExchange.Model {
public string PersonSnils { get; set; } public string PersonSnils { get; set; }
public string rowguid_contingent { get; set; } public string rowguid_contingent { get; set; }
public string Status { get; set; } public string Status { get; set; }
public DateTime StatusDate { get; set; } public DateTime? StatusDate { get; set; }
public string FounderType { get; set; } public string FounderType { get; set; }
public string OrganizationType { get; set; } public string OrganizationType { get; set; }
public string EducationProgram { 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