Beispiel #1
0
 public void SaveDisclaimerType(List <dtoCallSection <dtoCallField> > sections, long idField, DisclaimerType dType)
 {
     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.SaveDisclaimerType(idField, dType);
         if (!saved)
         {
             View.DisplayError(EditorErrors.EditingDisclaimerType);
         }
         else
         {
             if (View.CallType == CallForPaperType.CallForBids)
             {
                 View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleCallForPaper.ActionType.EditDisclaimerType);
             }
             else
             {
                 View.SendUserAction(idCommunity, View.IdCallModule, idCall, ModuleRequestForMembership.ActionType.EditDisclaimerType);
             }
             View.ReloadEditor(RootObject.CallSubmissionEditorFieldRemoved(idField, type, idCall, idCommunity, View.PreloadView));
         }
     }
 }
Beispiel #2
0
        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);
                }
            }
        }
Beispiel #3
0
        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);
            }
        }