@@ -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 }
0 commit comments