public void SetAsDefaultOption(List <dtoCallSection <dtoCallField> > sections, long idOption, Boolean isDefault) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { CallForPaperType type = View.CallType; long idCall = View.IdCall; Int32 idCommunity = View.IdCommunity; CallService.SaveSections(idCall, sections); Boolean saved = CallService.SetAsDefaultOption(idOption, isDefault); if (!saved) { View.DisplayError(EditorErrors.SetAsDefaultOption); } else { if (View.CallType == CallForPaperType.CallForBids) { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleCallForPaper.ActionType.SetAsDefaultOption); } else { View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleRequestForMembership.ActionType.SetAsDefaultOption); } View.ReloadEditor(RootObject.CallSubmissionEditorOptionRemoved(idOption, type, idCall, idCommunity, View.PreloadView)); } } }
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); } } }