Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Marat Pavlov
/
AlexAdapter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7fc149d8
authored
Mar 24, 2022
by
AlexNasyr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
requestt class "from SM" added
parent
0ebf45b7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
11 deletions
SocialMinistryDataExchange/Controllers/apiController.cs
SocialMinistryDataExchange/Model/DB/Center/Контингент_center_Context.cs → SocialMinistryDataExchange/Model/DB/Center/Contingent_center_Context.cs
SocialMinistryDataExchange/Model/SMRepository.cs
SocialMinistryDataExchange/Model/SMRequest.cs
SocialMinistryDataExchange/Startup.cs
SocialMinistryDataExchange/Controllers/apiController.cs
View file @
7fc149d8
...
...
@@ -31,7 +31,7 @@ namespace SocialMinistryDataExchange.Controllers {
[
HttpGet
]
[
Route
(
"[controller]/getpersonFixDoc"
)]
public
async
Task
<
List
<
SMResponce
>>
GetPersonFixDoc
()
{
var
result
=
await
_repository
.
GetPersonByDoc
(
JsonSerializer
.
Serialize
(
new
SMRequest
()
{
rowguid_eais
=
"223322"
,
document_seria
=
"V-II"
,
document_number
=
"123456"
}));
var
result
=
await
_repository
.
GetPersonByDoc
(
JsonSerializer
.
Serialize
(
new
SM
Person
Request
()
{
rowguid_eais
=
"223322"
,
document_seria
=
"V-II"
,
document_number
=
"123456"
}));
return
result
;
}
// запрос по серии/номеру документа личности
...
...
@@ -39,7 +39,7 @@ namespace SocialMinistryDataExchange.Controllers {
[
HttpGet
]
[
Route
(
"[controller]/getpersonByDoc/{Rowguid}/{Seria}/{Number}"
)]
public
async
Task
<
List
<
SMResponce
>>
GetPersonFixDoc
(
string
Rowguid
,
string
Seria
,
string
Number
)
{
var
result
=
await
_repository
.
GetPersonByDoc
(
JsonSerializer
.
Serialize
(
new
SMRequest
()
{
rowguid_eais
=
Rowguid
,
document_seria
=
Seria
,
document_number
=
Number
}));
var
result
=
await
_repository
.
GetPersonByDoc
(
JsonSerializer
.
Serialize
(
new
SM
Person
Request
()
{
rowguid_eais
=
Rowguid
,
document_seria
=
Seria
,
document_number
=
Number
}));
return
result
;
}
...
...
@@ -51,5 +51,11 @@ namespace SocialMinistryDataExchange.Controllers {
var
result
=
await
_repository
.
GetPersonDefenceDemandByID
(
PersonID
);
return
result
;
}
[
HttpGet
]
[
Route
(
"[controller]/getSMPersonNewDataRequest"
)]
public
async
Task
<
SMPersonNewDataRequest
>
GetSMPersonNewDataRequest
()
{
return
new
SMPersonNewDataRequest
();
}
}
}
SocialMinistryDataExchange/Model/DB/Center/
Контингент
_center_Context.cs
→
SocialMinistryDataExchange/Model/DB/Center/
Contingent
_center_Context.cs
View file @
7fc149d8
using
Microsoft.EntityFrameworkCore
;
...
...
@@ -8,11 +8,11 @@ using System.Threading.Tasks;
#
nullable
disable
namespace
SocialMinistryDataExchange.Model.DB.Center
{
public
partial
class
Контингент
_center_Context
:
DbContext
,
IContingentContext
{
public
partial
class
Contingent
_center_Context
:
DbContext
,
IContingentContext
{
public
Контингент
_center_Context
()
{
public
Contingent
_center_Context
()
{
}
public
Контингент
_center_Context
(
DbContextOptions
<
Контингент
_center_Context
>
options
)
public
Contingent_center_Context
(
DbContextOptions
<
Contingent
_center_Context
>
options
)
:
base
(
options
)
{
}
...
...
SocialMinistryDataExchange/Model/SMRepository.cs
View file @
7fc149d8
...
...
@@ -22,7 +22,7 @@ namespace SocialMinistryDataExchange.Model {
}
public
Task
<
List
<
SMResponce
>>
GetPersonByDoc
(
string
document
)
{
var
doc
=
JsonSerializer
.
Deserialize
<
SMRequest
>(
document
);
var
doc
=
JsonSerializer
.
Deserialize
<
SM
Person
Request
>(
document
);
try
{
var
records
=
(
from
pd
in
_contingentContext
.
ДокументЛичности
s
where
pd
.
СерияДокумента
==
doc
.
document_seria
&&
pd
.
НомерДокумента
==
doc
.
document_number
...
...
SocialMinistryDataExchange/Model/SMRequest.cs
View file @
7fc149d8
namespace
SocialMinistryDataExchange.Model
{
public
class
SMRequest
{
using
System
;
namespace
SocialMinistryDataExchange.Model
{
public
class
SMPersonRequest
{
public
string
rowguid_eais
{
get
;
set
;
}
public
string
document_seria
{
get
;
set
;
}
public
string
document_number
{
get
;
set
;
}
}
public
class
SMPersonNewDataRequest
{
public
string
MsgID
{
get
;
set
;
}
public
DateTime
MsgDataTime
{
get
;
set
;
}
public
Person
Person
{
get
;
set
;
}
public
string
PersonStatus
{
get
;
set
;
}
public
DateTime
PersonStatusStartDate
{
get
;
set
;
}
public
DateTime
PersonStatusEndDate
{
get
;
set
;
}
public
Person
[]
Relatives
{
get
;
set
;
}
public
int
FamilyPersonsCount
{
get
;
set
;
}
public
double
AvgIncome
{
get
;
set
;
}
public
double
MinIncome
{
get
;
set
;
}
public
string
Territory
{
get
;
set
;
}
}
public
class
Person
{
public
string
rowguid_eais
{
get
;
set
;
}
public
string
?
rowguid_contingent
{
get
;
set
;
}
public
string
PersonFamilyName
{
get
;
set
;
}
public
string
PersonName
{
get
;
set
;
}
public
string
PersonSurname
{
get
;
set
;
}
public
DateTime
PersonBirthday
{
get
;
set
;
}
public
string
PersonDocumentType
{
get
;
set
;
}
public
string
PersonDocumentSeria
{
get
;
set
;
}
public
string
PersonDocumentNumber
{
get
;
set
;
}
public
DateTime
PersonDocumentDate
{
get
;
set
;
}
public
string
?
PersonSnils
{
get
;
set
;
}
public
string
?
PersonAddress
{
get
;
set
;
}
public
string
?
DependentPerson
{
get
;
set
;
}
public
string
?
DependenceType
{
get
;
set
;
}
public
int
?
DependenceCode
{
get
;
set
;
}
}
}
SocialMinistryDataExchange/Startup.cs
View file @
7fc149d8
...
...
@@ -25,8 +25,8 @@ namespace SocialMinistryDataExchange {
services
.
AddSwaggerGen
(
c
=>
{
c
.
SwaggerDoc
(
"v1"
,
new
OpenApiInfo
{
Title
=
"SocialMinistryDataExchange"
,
Version
=
"v1"
});
});
services
.
AddDbContext
<
Êîíòèíãåíò
_center_Context
>(
options
=>
options
.
UseSqlServer
(
ConnectionString
));
services
.
AddTransient
<
IContingentContext
,
Êîíòèíãåíò
_center_Context
>();
services
.
AddDbContext
<
Contingent
_center_Context
>(
options
=>
options
.
UseSqlServer
(
ConnectionString
));
services
.
AddTransient
<
IContingentContext
,
Contingent
_center_Context
>();
services
.
AddTransient
<
ISMRepository
,
SMRepository
>();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment