SHOW:
|
|
- or go back to the newest paste.
1 | using System; | |
2 | using System.Collections.Generic; | |
3 | using EleWise.ELMA.ComponentModel; | |
4 | using EleWise.ELMA.CRM.Models; | |
5 | using Yambr.Dadata.Models; | |
6 | using Yambr.Dadata.Services; | |
7 | using Yambr.Dadata.Services.Impl; | |
8 | ||
9 | namespace Yambr.ELMA.MindMap.Services | |
10 | { | |
11 | [Service] | |
12 | public class NewContractorSuggestionsService : IContractorSuggestionService | |
13 | { | |
14 | private readonly ContractorSuggestionService _contractorSuggestionService; | |
15 | ||
16 | ||
17 | public void FillContractorLegal(EleWise.ELMA.CRM.Models.IContractorLegal contractorLegal, SuggestPartyResponse.Suggestion suggestion) | |
18 | { | |
19 | ((IContractorSuggestionService)_contractorSuggestionService).FillContractorLegal(contractorLegal, suggestion); | |
20 | if (suggestion.data.name != null) | |
21 | contractorLegal.Name = suggestion.data.name.short ?? suggestion.data.name.full; | |
22 | /*TODO вот тут код перекидывающий доп. поля*/ | |
23 | } | |
24 | ||
25 | public NewContractorSuggestionsService(ContractorSuggestionService contractorSuggestionService) | |
26 | { | |
27 | _contractorSuggestionService = contractorSuggestionService; | |
28 | } | |
29 | ||
30 | #region From Default | |
31 | ||
32 | public IContractorIndividual CreateContractor(SuggestFioResponse.Suggestion suggestion) | |
33 | { | |
34 | return ((IContractorSuggestionService)_contractorSuggestionService).CreateContractor(suggestion); | |
35 | } | |
36 | ||
37 | public IContractor CreateContractor(SuggestPartyResponse.Suggestion suggestion) | |
38 | { | |
39 | return ((IContractorSuggestionService)_contractorSuggestionService).CreateContractor(suggestion); | |
40 | } | |
41 | ||
42 | public IContractorIndividual FillContractor(IContractorIndividual contractorIndividual, SuggestFioResponse.Suggestion suggestion) | |
43 | { | |
44 | return ((IContractorSuggestionService)_contractorSuggestionService).FillContractor(contractorIndividual, suggestion); | |
45 | } | |
46 | ||
47 | public void FillContractor(IContractor contractor, SuggestPartyResponse.Suggestion suggestion) | |
48 | { | |
49 | ((IContractorSuggestionService)_contractorSuggestionService).FillContractor(contractor, suggestion); | |
50 | } | |
51 | ||
52 | public void FillContractorIndividual(IContractorIndividual contractorIndividual, SuggestPartyResponse.Suggestion suggestion) | |
53 | { | |
54 | ((IContractorSuggestionService)_contractorSuggestionService).FillContractorIndividual(contractorIndividual, suggestion); | |
55 | } | |
56 | ||
57 | ||
58 | ||
59 | public void FillLegalAddress(IContractor contractor, SuggestAddressResponse.Suggestion suggestion) | |
60 | { | |
61 | ((IContractorSuggestionService)_contractorSuggestionService).FillLegalAddress(contractor, suggestion); | |
62 | } | |
63 | ||
64 | public IContractor FindContractorByDetermenisticGuid(Guid uidEgrul) | |
65 | { | |
66 | return ((IContractorSuggestionService)_contractorSuggestionService).FindContractorByDetermenisticGuid(uidEgrul); | |
67 | } | |
68 | ||
69 | public IContractor FindContractorBySuggestion(SuggestPartyResponse.Suggestion suggestion) | |
70 | { | |
71 | return ((IContractorSuggestionService)_contractorSuggestionService).FindContractorBySuggestion(suggestion); | |
72 | } | |
73 | ||
74 | public IEnumerable<IContractor> FindContractorsByDetermenisticGuid(Guid uidEgrul) | |
75 | { | |
76 | return ((IContractorSuggestionService)_contractorSuggestionService).FindContractorsByDetermenisticGuid(uidEgrul); | |
77 | } | |
78 | ||
79 | public IEnumerable<IContractor> FindContractorsByDetermenisticGuid(Guid uidEgrul, IContractor excludeContractor) | |
80 | { | |
81 | return ((IContractorSuggestionService)_contractorSuggestionService).FindContractorsByDetermenisticGuid(uidEgrul, excludeContractor); | |
82 | } | |
83 | ||
84 | public Guid GetContractorDetermenisticGuid(PartyData partyData) | |
85 | { | |
86 | return _contractorSuggestionService.GetContractorDetermenisticGuid(partyData); | |
87 | } | |
88 | ||
89 | public Guid GetContractorDetermenisticGuid(IContractor contractor) | |
90 | { | |
91 | return ((IContractorSuggestionService)_contractorSuggestionService).GetContractorDetermenisticGuid(contractor); | |
92 | } | |
93 | ||
94 | public Guid GetContractorDetermenisticGuid(SuggestPartyResponse.Suggestion suggestion) | |
95 | { | |
96 | return _contractorSuggestionService.GetContractorDetermenisticGuid(suggestion); | |
97 | } | |
98 | ||
99 | public Guid GetContractorIndividualDetermenisticGuid(IContractorIndividual contractorIndividual) | |
100 | { | |
101 | return ((IContractorSuggestionService)_contractorSuggestionService).GetContractorIndividualDetermenisticGuid(contractorIndividual); | |
102 | } | |
103 | ||
104 | public Guid GetContractorIndividualDetermenisticGuid(PartyData partyData) | |
105 | { | |
106 | return _contractorSuggestionService.GetContractorIndividualDetermenisticGuid(partyData); | |
107 | } | |
108 | ||
109 | public Guid GetContractorLegalDetermenisticGuid(IContractorLegal contractorLegal) | |
110 | { | |
111 | return ((IContractorSuggestionService)_contractorSuggestionService).GetContractorLegalDetermenisticGuid(contractorLegal); | |
112 | } | |
113 | ||
114 | public Guid GetContractorLegalDetermenisticGuid(PartyData partyData) | |
115 | { | |
116 | return _contractorSuggestionService.GetContractorLegalDetermenisticGuid(partyData); | |
117 | } | |
118 | ||
119 | public string GetDescription(PartyData partyData) | |
120 | { | |
121 | return _contractorSuggestionService.GetDescription(partyData); | |
122 | } | |
123 | ||
124 | public Guid GetDeterministicGuidBranch(string fullname, string inn, string ogrn) | |
125 | { | |
126 | return _contractorSuggestionService.GetDeterministicGuidBranch(fullname, inn, ogrn); | |
127 | } | |
128 | ||
129 | public Guid GetDeterministicGuidIndividual(string inn) | |
130 | { | |
131 | return _contractorSuggestionService.GetDeterministicGuidIndividual(inn); | |
132 | } | |
133 | ||
134 | public Guid GetDeterministicGuidMain(string inn, string ogrn) | |
135 | { | |
136 | return _contractorSuggestionService.GetDeterministicGuidMain(inn, ogrn); | |
137 | } | |
138 | ||
139 | public SuggestPartyResponse.Suggestion SelectSuggestion(IEnumerable<SuggestPartyResponse.Suggestion> suggestions) | |
140 | { | |
141 | return _contractorSuggestionService.SelectSuggestion(suggestions); | |
142 | } | |
143 | ||
144 | public SuggestPartyResponse.Suggestion SelectSuggestion(SuggestPartyResponse suggestPartyResponse) | |
145 | { | |
146 | return _contractorSuggestionService.SelectSuggestion(suggestPartyResponse); | |
147 | } | |
148 | ||
149 | public IContractor UpdateContractor(SuggestPartyResponse.Suggestion suggestion) | |
150 | { | |
151 | return ((IContractorSuggestionService)_contractorSuggestionService).UpdateContractor(suggestion); | |
152 | } | |
153 | ||
154 | public IContractor UpdateOrCreateContractor(SuggestPartyResponse.Suggestion suggestion) | |
155 | { | |
156 | return ((IContractorSuggestionService)_contractorSuggestionService).UpdateOrCreateContractor(suggestion); | |
157 | } | |
158 | ||
159 | #endregion | |
160 | } | |
161 | } |