public void RemoveOption(List <dtoCallSection <dtoCallField> > sections, long idOption) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { long pIdOption = 0; long pIdSection = 0; long pIdField = 0; CallForPaperType type = View.CallType; long idCall = View.IdCall; Int32 idCommunity = View.IdCommunity; try { CallService.SaveSections(idCall, sections); if (CallService.VirtualDeleteFieldOption(idOption, true, ref pIdSection, ref pIdField, ref pIdOption)) { if (View.CallType == CallForPaperType.CallForBids) { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleCallForPaper.ActionType.VirtualDeleteFieldOption); } else { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleRequestForMembership.ActionType.VirtualDeleteFieldOption); } if (pIdOption != 0) { View.ReloadEditor(RootObject.CallSubmissionEditorOptionRemoved(pIdOption, type, idCall, idCommunity, View.PreloadView)); } else if (pIdField != 0) { View.ReloadEditor(RootObject.CallSubmissionEditorFieldRemoved(pIdField, type, idCall, idCommunity, View.PreloadView)); } else { View.ReloadEditor(RootObject.CallSubmissionEditorSectionRemoved(pIdSection, type, idCall, idCommunity, View.PreloadView)); } } else { View.DisplayError(EditorErrors.RemovingOption); } } catch (SubmissionLinked exSubmission) { View.DisplayError(EditorErrors.RemovingOption); } catch (Exception ex) { View.DisplayError(EditorErrors.RemovingOption); } } }
public void CloneField(List <dtoCallSection <dtoCallField> > sections, long idField) { long pIdSection = 0; long pIdField = 0; CallForPaperType type = View.CallType; long idCall = View.IdCall; Int32 idCommunity = View.IdCommunity; try { CallService.SaveSections(idCall, sections, View.TagCurrent); if (CallService.CloneField(idField, ref pIdSection, ref pIdField)) { if (View.CallType == CallForPaperType.CallForBids) { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleCallForPaper.ActionType.VirtualDeleteCallField); } else { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleRequestForMembership.ActionType.VirtualDeleteRequestField); } if (pIdField != 0) { View.ReloadEditor(RootObject.CallSubmissionEditorFieldRemoved(pIdField, type, idCall, idCommunity, View.PreloadView)); } else { View.ReloadEditor(RootObject.CallSubmissionEditorSectionRemoved(pIdSection, type, idCall, idCommunity, View.PreloadView)); } } else { View.DisplayError(EditorErrors.CloningField); } } catch (SubmissionLinked exSubmission) { View.DisplayError(EditorErrors.CloningField); } catch (Exception ex) { View.DisplayError(EditorErrors.CloningField); } }