Skip to content

Commit 1dfa00c

Browse files
committed
2 parents 0fd21a1 + 9d65c34 commit 1dfa00c

File tree

7 files changed

+52
-3
lines changed

7 files changed

+52
-3
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace eFormAPI.Common.Models
2+
{
3+
public class CommonDictionaryTextModel
4+
{
5+
public string Id { get; set; }
6+
public string Text { get; set; }
7+
}
8+
}

eFormAPI/eFormAPI.Common/eFormAPI.Common.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<HintPath>..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
7575
<Private>True</Private>
7676
</Reference>
77-
<Reference Include="Microting.eForm, Version=2.1.90.0, Culture=neutral, processorArchitecture=AMD64">
77+
<Reference Include="Microting.eForm, Version=2.1.90.0, Culture=neutral, PublicKeyToken=null">
7878
<HintPath>..\packages\Microting.eForm.2.1.90\lib\net45\Microting.eForm.dll</HintPath>
7979
</Reference>
8080
<Reference Include="MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
@@ -114,6 +114,7 @@
114114
<Compile Include="Models\Auth\ForgotPasswordModel.cs" />
115115
<Compile Include="Models\Auth\ResetPasswordModel.cs" />
116116
<Compile Include="Models\CommonDictionaryModel.cs" />
117+
<Compile Include="Models\CommonDictionaryTextModel.cs" />
117118
<Compile Include="Models\DisplayTemplateColumnsModel.cs" />
118119
<Compile Include="Models\Settings\Admin\AdminSettingsModel.cs" />
119120
<Compile Include="Models\Settings\Admin\HeaderSettingsModel.cs" />

eFormAPI/eFormAPI/Controllers/CasesController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Web.Http;
44
using eFormAPI.Common.API;
5+
using eFormAPI.Common.Models;
56
using eFormAPI.Common.Models.Cases.Request;
67
using eFormAPI.Web.Infrastructure.Helpers;
78
using eFormShared;

eFormAPI/eFormAPI/Controllers/EntitySearchController.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Web.Http;
45
using eFormAPI.Common.API;
6+
using eFormAPI.Common.Models;
57
using eFormAPI.Common.Models.SearchableList;
68
using eFormAPI.Web.Infrastructure.Helpers;
79
using eFormData;
@@ -96,6 +98,35 @@ public OperationDataResult<EntityGroup> GetEntityGroup(string entityGroupUid)
9698
}
9799
}
98100

101+
[HttpGet]
102+
[Route("api/searchable-groups/dict/{entityGroupUid}")]
103+
public OperationDataResult<List<CommonDictionaryTextModel>> GetEntityGroupDictionary(string entityGroupUid, string searchString)
104+
{
105+
try
106+
{
107+
var core = _coreHelper.GetCore();
108+
109+
var entityGroup = core.EntityGroupRead(entityGroupUid, null, searchString);
110+
111+
var mappedEntityGroupDict = new List<CommonDictionaryTextModel>();
112+
113+
foreach (var entityGroupItem in entityGroup.EntityGroupItemLst)
114+
{
115+
mappedEntityGroupDict.Add(new CommonDictionaryTextModel()
116+
{
117+
Id = entityGroupItem.EntityItemUId,
118+
Text = entityGroupItem.Name
119+
});
120+
}
121+
122+
return new OperationDataResult<List<CommonDictionaryTextModel>>(true, mappedEntityGroupDict);
123+
}
124+
catch (Exception ex)
125+
{
126+
return new OperationDataResult<List<CommonDictionaryTextModel>>(false, "Error when obtaining searchable list");
127+
}
128+
}
129+
99130
[HttpGet]
100131
[Route("api/searchable-groups/delete/{entityGroupUid}")]
101132
public OperationResult DeleteEntityGroup(string entityGroupUid)

eFormAPI/eFormAPI/Infrastructure/Helpers/CaseUpdateHelper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ public static List<string> GetFieldValuesByRequestField(CaseEditRequestField edi
9999
list.Add(val);
100100
}
101101
break;
102+
case "EntitySearch":
103+
var entitySearch = editRequestField?.FieldValues?.First();
104+
if (entitySearch?.Value != null && entitySearch?.FieldId != null)
105+
{
106+
string val = $"{entitySearch.FieldId}|{entitySearch.Value.ToString()}";
107+
list.Add(val);
108+
}
109+
break;
102110
case "MultiSelect":
103111
var multiFirst = editRequestField?.FieldValues?.First();
104112
if (multiFirst?.Value != null && multiFirst?.FieldId != null)

eFormAPI/eFormAPI/eFormAPI.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
128128
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
129129
</Reference>
130-
<Reference Include="Microting.eForm, Version=2.1.90.0, Culture=neutral, processorArchitecture=AMD64">
130+
<Reference Include="Microting.eForm, Version=2.1.90.0, Culture=neutral, PublicKeyToken=null">
131131
<HintPath>..\packages\Microting.eForm.2.1.90\lib\net45\Microting.eForm.dll</HintPath>
132132
</Reference>
133133
<Reference Include="MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">

eFormAPI/eFormAPI/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<package id="Microsoft.Owin.Security.Cookies" version="3.1.0" targetFramework="net46" />
3939
<package id="Microsoft.Owin.Security.OAuth" version="3.1.0" targetFramework="net46" />
4040
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" />
41-
<package id="Microting.eForm" version="2.1.90" targetFramework="net461" />
41+
<package id="Microting.eForm" version="2.1.90" targetFramework="net46" />
4242
<package id="Modernizr" version="2.8.3" targetFramework="net46" />
4343
<package id="MySql.Data" version="6.9.11" targetFramework="net46" />
4444
<package id="MySql.Data.Entity" version="6.9.11" targetFramework="net46" />

0 commit comments

Comments
 (0)