public CallPrintSettings PrintSettingsGetFromCall(Int64 callId) { //CallForPaper call = Manager.Get<CallForPaper>(callId); //if (call == null) // return new CallPrintSettings(); ////ToDo: X TEST!!!! //IList<CallPrintSettings> pslist = Manager.GetAll<CallPrintSettings>(); //pslist = pslist.Where(s => s.CallId == callId).ToList(); CallPrintSettings ps = Manager.GetAll <CallPrintSettings>( p => p.CallId == callId ) .Skip(0).Take(1).FirstOrDefault(); //pslist.FirstOrDefault(); //CallPrintSettings ps = Manager.GetAll<CallPrintSettings>(); //s => s.CallId == callId).Skip(0).Take(1).ToList().FirstOrDefault(); if (ps == null) { ps = new CallPrintSettings(); } return(ps); }
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 } ; dtoRevision revision = ServiceCall.GetRevision(idSubmission, idRevision, false); if (revision == null) { View.DisplayNone(); } else { LoadFiles(revision, idSubmission, View.AvailableTypes); } //return exportFile; }
public CallPrintSettings PrintSettingsGet(Int64 settingsId) { CallPrintSettings ps = Manager.Get <CallPrintSettings>(settingsId); if (ps == null) { ps = new CallPrintSettings(); } return(ps); }
public Int64 PrintSettingsSet(CallPrintSettings settings) { if (!Manager.IsInTransaction()) { Manager.BeginTransaction(); } CallPrintSettings ps = PrintSettingsGetFromCall(settings.CallId); litePerson person = Manager.GetLitePerson(UC.CurrentUserID); if (ps == null || ps.Id <= 0) { ps = new CallPrintSettings(); ps.CreateMetaInfo(person, UC.IpAddress, UC.ProxyIpAddress); } else { ps.UpdateMetaInfo(person, UC.IpAddress, UC.ProxyIpAddress); } ps.TemplateId = settings.TemplateId; ps.CallId = settings.CallId; ps.FieldContent = settings.FieldContent; ps.FieldDescription = settings.FieldDescription; ps.FieldTitle = settings.FieldTitle; ps.Layout = settings.Layout; ps.SectionDescription = settings.SectionDescription; ps.SectionTitle = settings.SectionTitle; ps.ShowMandatory = settings.ShowMandatory; ps.UnselectFields = settings.UnselectFields; ps.VersionId = settings.VersionId; ps.DraftWaterMark = settings.DraftWaterMark; ps.AllowPrintDraft = settings.AllowPrintDraft; try { Manager.SaveOrUpdate <CallPrintSettings>(ps); Manager.Commit(); } catch (Exception ex) { if (Manager.IsInTransaction()) { Manager.RollBack(); } return(-1); } return(ps.Id); }
public void SaveSetting() { CallPrintSettings sets = new CallPrintSettings(); View.UpdateSettings(ref sets); long SetId = Service.PrintSettingsSet(sets); if (SetId <= 0) { //save error } else { sets = Service.PrintSettingsGet(SetId); View.Initialize(sets, Service.ServiceModuleID()); } }
public void InitView(Int64 callId) { CallPrintSettings sets = Service.PrintSettingsGetFromCall(callId); View.Initialize(sets, Service.ServiceModuleID()); }
/// <summary> /// Esporta una sottomissione FITTIZIA/VUOTA! come bozza /// Al momento NON E' Prevista la stampa di una sottomissione/revisione in bozza!!! /// </summary> /// <param name="idCall">ID call</param> /// <param name="baseDocTemplateImagePath">Path immagini doctemplate (da configurazione)</param> /// <param name="clientFileName">Nome file esportato</param> /// <param name="translations">Translation: dictionary per la traduzione di termini</param> /// <param name="webResponse">Web response</param> /// <param name="cookie">Cookie</param> /// <param name="template">Template default (fake)</param> /// <param name="idSubmitterType">Id submitter Type: dipende dal bando. SE = 0, il primo disponibile. Per sviluppi futuri, al momento lasciato il primo che trova...</param> public void ExportDraftToPdf( 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) { long idCall = View.IdCall; long idSubmitterType = (View.SubmissionType != null) ? View.SubmissionType.Id : 0; //Pagine "normali" CallPrintSettings sets = new CallPrintSettings(); if (idCall > 0) { sets = CallService.PrintSettingsGetFromCall(idCall); //Solo pagina di EDIT! View.UpdateSettings(ref sets); template = CallService.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 = ""; if (currentUser == null) { currentUser = CurrentManager.GetUnknownUser(); } 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 ?? new Subscription(), UserType = userType }; long revisionId = View.IdRevision; if (revisionId <= 0) { iTextSharp5.text.Document exportFile = CallService.ExportCallDraftToPDF( idCall, clientFileName, translations, webResponse, cookie, template, sets, phData, idSubmitterType); } else { iTextSharp5.text.Document exportFile = CallService.ExportSubmissionDraftToPDF( true, View.IdSubmission, View.IdRevision, baseDocTemplateImagePath, clientFileName, translations, webResponse, cookie, template, sets, phData); } }