예제 #1
0
        public Boolean AddTemplate(dtoSubmitterTemplateMail template, List <dtoSubmitterTemplateMail> templates)
        {
            Boolean result = false;

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                SubmitterTemplateMail sTemplate = CallService.AddSubmitterTemplate(View.IdCall, template);
                if (sTemplate != null)
                {
                    View.AllowAdd = View.AllowSave && View.Availablesubmitters.Count > 1;
                    template.Id   = sTemplate.Id;
                    templates.Add(template);
                    if (View.CallType == CallForPaperType.CallForBids)
                    {
                        View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleCallForPaper.ActionType.AddSubmitterTemplate);
                    }
                    else
                    {
                        View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleRequestForMembership.ActionType.AddSubmitterTemplate);
                    }
                    DisplayMessage(View.IdCall, true);
                    View.LoadWizardSteps(View.IdCall, View.CallType, View.IdCommunity, CallService.GetAvailableSteps(View.IdCall, WizardCallStep.SubmitterTemplateMail, View.CallType));
                }
                View.LoadTemplates(templates);
            }
            return(result);
        }
예제 #2
0
        public void SaveTemplate(dtoSubmitterTemplateMail template, List <dtoSubmitterTemplateMail> templates)
        {
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                List <long> editing = View.InEditing;
                if (template != null && template.Id == 0)
                {
                    SubmitterTemplateMail sTemplate = CallService.AddSubmitterTemplate(View.IdCall, template);
                    if (sTemplate != null)
                    {
                        template.Id = sTemplate.Id;
                        templates.Add(template);
                        editing.Add(sTemplate.Id);
                    }
                }

                if (!CallService.SaveSubmitterTemplate(template))
                {
                    View.InEditing = editing;
                    View.LoadTemplates(templates);
                    View.DisplayError(EditorErrors.SavingTemplateSettings);
                }
                else
                {
                    editing.Remove(template.Id);
                    View.InEditing = editing;
                    View.LoadTemplates(templates);
                    DisplayMessage(View.IdCall, false);
                    if (View.CallType == CallForPaperType.CallForBids)
                    {
                        View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleCallForPaper.ActionType.SaveSubmittersTemplate);
                    }
                    else
                    {
                        View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleRequestForMembership.ActionType.SaveSubmittersTemplate);
                    }
                }
                View.LoadWizardSteps(View.IdCall, View.CallType, View.IdCommunity, CallService.GetAvailableSteps(View.IdCall, WizardCallStep.SubmitterTemplateMail, View.CallType));
            }
        }