Beispiel #1
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);
                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);
            }
        }