public void InitView(Int32 idUser, String owner, long idCall, long idSubmission, long idRevision, CallForPaperType callType, List <lm.Comol.Core.DomainModel.Helpers.Export.ExportFileType> loadTypes) { View.CallType = callType; View.IdRevision = idRevision; View.IdSubmission = idSubmission; View.SubmissionOwner = owner; dtoRevision revision = ServiceCall.GetRevision(idSubmission, idRevision, false); if (revision == null) { View.DisplayNone(); } else { LoadFiles(revision, idSubmission, loadTypes); SetSkinDetails(idUser, idCall); } }
public void Initialize(long idCall, long submissionTypeId, long idRevision, long idSubmission) { if (idCall <= 0) { return; } View.IdCall = idCall; if (!CanPrint) { return; } BaseForPaper call = CurrentManager.Get <BaseForPaper>(idCall); if (call == null) { return; } int comId = call.Community.Id; int usrId = UserContext.CurrentUserID; //Manager Bando //Individuo eventuale sottomissione, revisione, bando, tipo di bando... View.CallName = call.Name; View.CallType = call.Type; View.IdSubmission = idSubmission; View.IdRevision = idRevision; SubmitterType type = null; if (idSubmission > 0 && idRevision > 0) { dtoSubmissionRevision subRev = CallService.GetSubmissionWithRevisions(idSubmission, true); if (subRev != null && subRev.Type != null && subRev.Revisions != null && subRev.Revisions.Any()) { dtoRevision rev = subRev.Revisions.FirstOrDefault(r => r.Id == idRevision); if (rev != null) { View.IdRevision = idRevision; } else { View.IdRevision = 0; } View.IdSubmission = subRev.Id; type = CurrentManager.Get <SubmitterType>(subRev.Type.Id); } else { View.IdSubmission = 0; View.IdRevision = 0; } } if (type == null) { type = call.SubmittersType.FirstOrDefault(st => st.Id == submissionTypeId); if (type == null) { type = call.SubmittersType.OrderBy(st => st.DisplayOrder).FirstOrDefault(); } } View.SubmissionType = type; }
public void ExportToPdf( Boolean webOnlyRender, long idSubmission, long idRevision, String baseFilePath, String baseDocTemplateImagePath, String clientFileName, Dictionary <SubmissionTranslations, string> translations, System.Web.HttpResponse webResponse, System.Web.HttpCookie cookie, lm.Comol.Core.DomainModel.DocTemplateVers.Domain.DTO.ServiceExport.DTO_Template template) { Int64 IdCall = ServiceCall.CallIdGetFromSubmission(idSubmission); CallPrintSettings sets = new CallPrintSettings(); if (IdCall > 0) { sets = ServiceCall.PrintSettingsGetFromCall(IdCall); template = ServiceCall.DocTemplateUpdate(template, sets.TemplateId, sets.VersionId, baseDocTemplateImagePath); // baseFilePath); } int currentComId = UserContext.CurrentCommunityID; Subscription subs = CurrentManager.GetActiveSubscription(UserContext.CurrentUserID, currentComId); Person currentUser = CurrentManager.GetPerson(UserContext.CurrentUserID); string userType = ""; userType = CurrentManager.GetTranslatedProfileType(currentUser.TypeID, UserContext.Language.Id); CommonPlaceHolderData phData = new CommonPlaceHolderData { Person = currentUser, Community = CurrentManager.GetLiteCommunity(currentComId), InstanceName = "", OrganizationName = CurrentManager.GetOrganizationName(UserContext.CurrentCommunityOrganizationID), Subscription = subs, UserType = userType } ; //iTextSharp5.text.Document exportFile = ServiceCall.ExportSubmissionToPDF(webOnlyRender, idSubmission, idRevision, baseFilePath, clientFileName, translations, webResponse, cookie, template); iTextSharp5.text.Document exportFile = ServiceCall.ExportSubmissionToPDF( webOnlyRender, idSubmission, idRevision, baseDocTemplateImagePath, clientFileName, translations, webResponse, cookie, template, sets, phData); //baseFilePath dtoRevision revision = ServiceCall.GetRevision(idSubmission, idRevision, false); if (revision == null) { View.DisplayNone(); } else { LoadFiles(revision, idSubmission, View.AvailableTypes); } //return exportFile; }