Skip to content

Commit e928849

Browse files
committed
Updating:
- Microting.eForm to 3.0.20 - MicrotingApi.BasePn to 1.1.28 Changing entityselect and entitysearch to use the new sdk methods.
1 parent d2422d2 commit e928849

File tree

4 files changed

+68
-24
lines changed

4 files changed

+68
-24
lines changed

eFormAPI/eFormAPI/Controllers/EntitySearchController.cs

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,19 @@ public OperationResult CreateEntityGroup(AdvEntitySearchableGroupEditModel editM
4747
var groupCreate = core.EntityGroupCreate(Constants.FieldTypes.EntitySearch, editModel.Name);
4848
if (editModel.AdvEntitySearchableItemModels.Any())
4949
{
50-
var entityGroup = core.EntityGroupRead(groupCreate.EntityGroupMUId);
50+
var entityGroup = core.EntityGroupRead(groupCreate.MicrotingUUID);
5151
var nextItemUid = entityGroup.EntityGroupItemLst.Count;
5252
foreach (var entityItem in editModel.AdvEntitySearchableItemModels)
5353
{
54-
entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
55-
entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
54+
core.EntitySearchItemCreate(entityGroup.Id.ToString(), entityItem.Name, entityItem.Description, nextItemUid.ToString());
55+
56+
//entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
57+
// entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
5658
nextItemUid++;
5759
}
58-
core.EntityGroupUpdate(entityGroup);
60+
//core.EntityGroupUpdate(entityGroup);
5961
}
60-
return new OperationResult(true, LocaleHelper.GetString("ParamCreatedSuccessfully", groupCreate.EntityGroupMUId));
62+
return new OperationResult(true, LocaleHelper.GetString("ParamCreatedSuccessfully", groupCreate.MicrotingUUID));
6163
}
6264
catch (Exception)
6365
{
@@ -73,9 +75,29 @@ public OperationResult UpdateEntityGroup(AdvEntitySearchableGroupEditModel editM
7375
{
7476
var core = _coreHelper.GetCore();
7577
var entityGroup = core.EntityGroupRead(editModel.GroupUid);
76-
entityGroup.EntityGroupItemLst = editModel.AdvEntitySearchableItemModels;
77-
entityGroup.Name = editModel.Name;
78-
core.EntityGroupUpdate(entityGroup);
78+
//entityGroup.EntityGroupItemLst = editModel.AdvEntitySearchableItemModels;
79+
//entityGroup.Name = editModel.Name;
80+
//core.EntityGroupUpdate(entityGroup);
81+
if (editModel.AdvEntitySearchableItemModels.Any())
82+
{
83+
//var entityGroup = core.EntityGroupRead(groupCreate.MicrotingUUID);
84+
var nextItemUid = entityGroup.EntityGroupItemLst.Count;
85+
foreach (var entityItem in editModel.AdvEntitySearchableItemModels)
86+
{
87+
if (entityItem.MicrotingUUID != null)
88+
{
89+
core.EntityItemUpdate(entityItem.Id, entityItem.Name, entityItem.Description, entityItem.EntityItemUId, entityItem.DisplayIndex);
90+
}
91+
else
92+
{
93+
core.EntitySearchItemCreate(entityGroup.Id.ToString(), entityItem.Name, entityItem.Description, nextItemUid.ToString());
94+
}
95+
//entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
96+
// entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
97+
nextItemUid++;
98+
}
99+
//core.EntityGroupUpdate(entityGroup);
100+
}
79101
return new OperationResult(true, LocaleHelper.GetString("ParamUpdatedSuccessfully", editModel.GroupUid));
80102
}
81103
catch (Exception)
@@ -119,7 +141,7 @@ public OperationDataResult<List<CommonDictionaryTextModel>> GetEntityGroupDictio
119141
{
120142
mappedEntityGroupDict.Add(new CommonDictionaryTextModel()
121143
{
122-
Id = entityGroupItem.MicrotingUId,
144+
Id = entityGroupItem.MicrotingUUID,
123145
Text = entityGroupItem.Name
124146
});
125147
}

eFormAPI/eFormAPI/Controllers/EntitySelectController.cs

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,18 @@ public OperationResult CreateEntityGroup(AdvEntitySelectableGroupEditModel editM
4747
var groupCreate = core.EntityGroupCreate(Constants.FieldTypes.EntitySelect, editModel.Name);
4848
if (editModel.AdvEntitySelectableItemModels.Any())
4949
{
50-
var entityGroup = core.EntityGroupRead(groupCreate.EntityGroupMUId);
50+
var entityGroup = core.EntityGroupRead(groupCreate.MicrotingUUID);
5151
var nextItemUid = entityGroup.EntityGroupItemLst.Count;
5252
foreach (var entityItem in editModel.AdvEntitySelectableItemModels)
5353
{
54-
entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
55-
entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
54+
core.EntitySelectItemCreate(entityGroup.Id.ToString(), entityItem.Name, entityItem.DisplayIndex, nextItemUid.ToString());
55+
//entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
56+
// entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
5657
nextItemUid++;
5758
}
58-
core.EntityGroupUpdate(entityGroup);
59+
//core.EntityGroupUpdate(entityGroup);
5960
}
60-
return new OperationResult(true, LocaleHelper.GetString("ParamCreatedSuccessfully", groupCreate.EntityGroupMUId));
61+
return new OperationResult(true, LocaleHelper.GetString("ParamCreatedSuccessfully", groupCreate.MicrotingUUID));
6162
}
6263
catch (Exception)
6364
{
@@ -73,9 +74,30 @@ public OperationResult UpdateEntityGroup(AdvEntitySelectableGroupEditModel editM
7374
{
7475
var core = _coreHelper.GetCore();
7576
var entityGroup = core.EntityGroupRead(editModel.GroupUid);
76-
entityGroup.EntityGroupItemLst = editModel.AdvEntitySelectableItemModels;
77-
entityGroup.Name = editModel.Name;
78-
core.EntityGroupUpdate(entityGroup);
77+
78+
//entityGroup.EntityGroupItemLst = editModel.AdvEntitySelectableItemModels;
79+
//entityGroup.Name = editModel.Name;
80+
//core.EntityGroupUpdate(entityGroup);
81+
if (editModel.AdvEntitySelectableItemModels.Any())
82+
{
83+
//var entityGroup = core.EntityGroupRead(groupCreate.MicrotingUUID);
84+
var nextItemUid = entityGroup.EntityGroupItemLst.Count;
85+
foreach (var entityItem in editModel.AdvEntitySelectableItemModels)
86+
{
87+
if (entityItem.MicrotingUUID != null)
88+
{
89+
core.EntityItemUpdate(entityItem.Id, entityItem.Name, entityItem.Description, entityItem.EntityItemUId, entityItem.DisplayIndex);
90+
}
91+
else
92+
{
93+
core.EntitySelectItemCreate(entityGroup.Id.ToString(), entityItem.Name, entityItem.DisplayIndex, nextItemUid.ToString());
94+
}
95+
//entityGroup.EntityGroupItemLst.Add(new EntityItem(entityItem.Name,
96+
// entityItem.Description, nextItemUid.ToString(), Constants.WorkflowStates.Created));
97+
nextItemUid++;
98+
}
99+
//core.EntityGroupUpdate(entityGroup);
100+
}
79101
return new OperationResult(true, LocaleHelper.GetString("ParamUpdatedSuccessfully", editModel.GroupUid));
80102
}
81103
catch (Exception)
@@ -118,7 +140,7 @@ public OperationDataResult<List<CommonDictionaryTextModel>> GetEntityGroupDictio
118140
{
119141
mappedEntityGroupDict.Add(new CommonDictionaryTextModel()
120142
{
121-
Id = entityGroupItem.MicrotingUId,
143+
Id = entityGroupItem.MicrotingUUID,
122144
Text = entityGroupItem.Name
123145
});
124146
}

eFormAPI/eFormAPI/eFormAPI.Web.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@
130130
<Reference Include="Microsoft.Owin.Security.OAuth, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
131131
<HintPath>..\packages\Microsoft.Owin.Security.OAuth.3.1.0\lib\net45\Microsoft.Owin.Security.OAuth.dll</HintPath>
132132
</Reference>
133-
<Reference Include="Microting.eForm, Version=3.0.11.0, Culture=neutral, processorArchitecture=MSIL">
134-
<HintPath>..\packages\Microting.eForm.3.0.11\lib\net45\Microting.eForm.dll</HintPath>
133+
<Reference Include="Microting.eForm, Version=3.0.20.0, Culture=neutral, processorArchitecture=MSIL">
134+
<HintPath>..\packages\Microting.eForm.3.0.20\lib\net45\Microting.eForm.dll</HintPath>
135135
</Reference>
136-
<Reference Include="Microting.eFormApi.BasePn, Version=1.1.23.0, Culture=neutral, processorArchitecture=MSIL">
137-
<HintPath>..\packages\Microting.eFormApi.BasePn.1.1.23\lib\net461\Microting.eFormApi.BasePn.dll</HintPath>
136+
<Reference Include="Microting.eFormApi.BasePn, Version=1.1.28.0, Culture=neutral, processorArchitecture=MSIL">
137+
<HintPath>..\packages\Microting.eFormApi.BasePn.1.1.28\lib\net461\Microting.eFormApi.BasePn.dll</HintPath>
138138
</Reference>
139139
<Reference Include="MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
140140
<HintPath>..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll</HintPath>

eFormAPI/eFormAPI/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<package id="Microsoft.Owin.Security.Cookies" version="3.1.0" targetFramework="net46" />
3737
<package id="Microsoft.Owin.Security.OAuth" version="3.1.0" targetFramework="net46" />
3838
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" />
39-
<package id="Microting.eForm" version="3.0.11" targetFramework="net461" />
40-
<package id="Microting.eFormApi.BasePn" version="1.1.23" targetFramework="net461" />
39+
<package id="Microting.eForm" version="3.0.20" targetFramework="net461" />
40+
<package id="Microting.eFormApi.BasePn" version="1.1.28" targetFramework="net461" />
4141
<package id="Modernizr" version="2.8.3" targetFramework="net46" />
4242
<package id="MySql.Data" version="6.9.12" targetFramework="net461" />
4343
<package id="MySql.Data.Entity" version="6.9.12" targetFramework="net461" />

0 commit comments

Comments
 (0)