private void LoadSubmission(dtoBaseForPaper call, dtoSubmissionRevision subRev, int idUser, Boolean allowAdmin)
        {
            if (!allowAdmin)
            {
                switch (call.Type)
                {
                case CallForPaperType.CallForBids:
                    dtoCall dtoC = ServiceCall.GetDtoCall(call.Id);
                    View.LoadCallInfo(dtoC);
                    break;

                case CallForPaperType.RequestForMembership:
                    dtoRequest dtoR = ServiceRequest.GetDtoRequest(call.Id);
                    View.LoadCallInfo(dtoR);
                    break;
                }
                View.LoadAttachments(ServiceCall.GetAvailableCallAttachments(call.Id, subRev.Type.Id));
            }
            View.IdSubmitterType = (subRev == null) ? 0 : subRev.Type.Id;
            String owner       = "";
            String submittedBy = "";

            if (subRev.Owner == null || subRev.Owner.TypeID == (int)UserTypeStandard.Guest)
            {
                owner = View.AnonymousOwnerName;
            }
            else
            {
                owner = subRev.Owner.SurnameAndName;
            }

            if (subRev.SubmittedBy == null || subRev.SubmittedBy.TypeID == (int)UserTypeStandard.Guest)
            {
                submittedBy = View.AnonymousOwnerName;
            }
            else
            {
                submittedBy = subRev.SubmittedBy.SurnameAndName;
            }

            if (subRev.Deleted != BaseStatusDeleted.None)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, SubmissionStatus.deleted);
            }
            else if (!subRev.SubmittedOn.HasValue)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status);
            }
            else if (subRev.IdPerson == subRev.IdSubmittedBy)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status, subRev.SubmittedOn.Value);
            }
            else
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status, subRev.SubmittedOn.Value, submittedBy);
            }

            LoadSections(call, subRev, allowAdmin);
        }
Exemple #2
0
        private void LoadSubmission(dtoBaseForPaper call, dtoSubmissionRevision subRev, int idUser, Boolean allowAdmin)
        {
            if (!allowAdmin)
            {
                switch (call.Type)
                {
                case CallForPaperType.CallForBids:
                    dtoCall dtoC = ServiceCall.GetDtoCall(call.Id);
                    View.LoadCallInfo(dtoC);
                    break;

                case CallForPaperType.RequestForMembership:
                    dtoRequest dtoR = ServiceRequest.GetDtoRequest(call.Id);
                    View.LoadCallInfo(dtoR);
                    break;
                }
                View.LoadAttachments(ServiceCall.GetAvailableCallAttachments(call.Id, subRev.Type.Id));
            }
            View.IdSubmitterType = (subRev == null) ? 0 : subRev.Type.Id;
            String owner       = "";
            String submittedBy = "";

            if (subRev.Owner == null || subRev.Owner.TypeID == (int)UserTypeStandard.Guest)
            {
                owner = View.AnonymousOwnerName;
            }
            else
            {
                owner = subRev.Owner.SurnameAndName;
            }

            if (subRev.SubmittedBy == null || subRev.SubmittedBy.TypeID == (int)UserTypeStandard.Guest)
            {
                submittedBy = View.AnonymousOwnerName;
            }
            else
            {
                submittedBy = subRev.SubmittedBy.SurnameAndName;
            }

            if (subRev.Deleted != BaseStatusDeleted.None)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, SubmissionStatus.deleted);
            }
            else if (!subRev.SubmittedOn.HasValue)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status);
            }
            else if (subRev.IdPerson == subRev.IdSubmittedBy)
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status, subRev.SubmittedOn.Value);
            }
            else
            {
                View.LoadSubmissionInfo(subRev.Type.Name, owner, subRev.Status, subRev.SubmittedOn.Value, submittedBy);
            }

            LoadSections(call, subRev, allowAdmin);


            //Gestione firme
            if (!call.AttachSign)
            {
                View.HideSignSubmission();
            }
            else
            {
                ModuleLink mLink = ServiceCall.GetSignModuleLink(call.Id, (View.IdRevision > 0) ? View.IdRevision : View.PreloadedIdRevision);

                if (mLink != null)
                {
                    View.InitializeDownloadSign(mLink);
                }
                else
                {
                    if (UserContext.CurrentUserID == subRev.IdSubmittedBy)
                    {
                        //dtoSubmissionRevision subRev = Service.GetSubmissionWithRevisions(idSubmission, true);

                        View.InitSignSubmission((call.Community != null) ? call.Community.Id : 0);
                    }
                    else
                    {
                        View.ShowSignNotSubmitted();
                    }
                }
            }
        }