protected void RefreshLogbookData()
        {
            mvLayouts.ActiveViewIndex = (int)PrintOptions1.Options.Layout;
            pnlResults.Visible        = true;
            lblCoverDate.Text         = String.Format(CultureInfo.CurrentCulture, Resources.LocalizedText.PrintViewCoverSheetDateTemplate, DateTime.Now);

            PrintingOptions po = PrintOptions1.Options;

            // Set any global font appropriately.
            pnlResults.Style["font-size"] = po.Size == PrintingOptions.FontSize.Normal ? "9pt" : String.Format(CultureInfo.InvariantCulture, po.Size == PrintingOptions.FontSize.Small ? "7pt" : "11pt");

            // Make sure that any PDF and section information is up-to-date, and that the PrintOptions property is set up correctly
            po.Sections    = printingSections;
            po.PDFSettings = pdfOptions;
            PrintOptions   = po;

            // Make sure copy link is up-to-date
            lnkPermalink.NavigateUrl = PermaLink(po, mfbSearchForm1.Restriction);

            mvLayouts.Visible       = po.Sections.IncludeFlights;
            pnlEndorsements.Visible = po.Sections.Endorsements != PrintingSections.EndorsementsLevel.None;
            rptImages.Visible       = po.Sections.Endorsements == PrintingSections.EndorsementsLevel.DigitalAndPhotos;
            pnlTotals.Visible       = po.Sections.IncludeTotals;
            pnlCover.Visible        = po.Sections.IncludeCoverPage;

            IList <LogbookEntryDisplay> lstFlights = LogbookEntryDisplay.GetFlightsForQuery(LogbookEntry.QueryCommand(mfbSearchForm1.Restriction, fAsc: true), CurrentUser.UserName, string.Empty, SortDirection.Ascending, CurrentUser.UsesHHMM, CurrentUser.UsesUTCDateOfFlight);
            PrintLayout pl = LogbookPrintedPage.LayoutLogbook(CurrentUser, lstFlights, ActiveTemplate, po, SuppressFooter);

            Master.PrintingCSS = pl.CSSPath.ToAbsoluteURL(Request).ToString();
        }
Exemple #2
0
 private void gridPrintLayout_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Util.isColumnMatch(sender, e, col_gridPrintLayout_delete))
     {
         PrintLayout.delete((Guid)Util.getClickedRowValue(sender, e, col_gridPrintLayout_Id.Index));
         populateData();
     }
 }
Exemple #3
0
    protected void RefreshLogbookData()
    {
        mvLayouts.ActiveViewIndex = (int)PrintOptions1.Options.Layout;
        pnlResults.Visible        = true;

        IList <LogbookEntryDisplay> lstFlights = LogbookEntryDisplay.GetFlightsForQuery(LogbookEntry.QueryCommand(mfbSearchForm1.Restriction, fAsc: true), CurrentUser.UserName, string.Empty, SortDirection.Ascending, CurrentUser.UsesHHMM, CurrentUser.UsesUTCDateOfFlight);
        PrintLayout pl = LogbookPrintedPage.LayoutLogbook(CurrentUser, lstFlights, ActiveTemplate, PrintOptions1.Options, SuppressFooter);

        Master.PrintingCSS = pl.CSSPath.ToAbsoluteURL(Request).ToString();
    }
    protected void AdjustForLayoutCapabilities(PrintingOptions po)
    {
        if (po == null)
        {
            throw new ArgumentNullException(nameof(po));
        }
        PrintLayout pl = PrintLayout.LayoutForType(po.Layout);

        pnlIncludeImages.Visible = pl.SupportsImages;
        if (!pl.SupportsImages)
        {
            ckIncludeImages.Checked = m_options.IncludeImages = false;
        }
        pnlOptionalColumns.Visible = pl.SupportsOptionalColumns;
    }
Exemple #5
0
        private void btnSavePrinterSettings_Click(object sender, EventArgs e)
        {
            if (isInputValid())
            {
                Settings.PrintAreaWidth = in_PrintAreaWidth.ValueInt;
                Settings.PrintQty       = in_PrintQty.ValueInt;

                foreach (DataGridViewRow row in gridPrintLayout.Rows)
                {
                    PrintLayout.update(DBConnection.ActiveSqlConnection,
                                       Util.wrapNullable <Guid>(row, col_gridPrintLayout_Id.Name),
                                       Util.wrapNullable <bool>(row, col_gridPrintLayout_Hide.Name),
                                       Util.wrapNullable <string>(row, col_gridPrintLayout_Text.Name),
                                       Util.wrapNullable <int>(row, col_gridPrintLayout_FontSize.Name),
                                       Util.wrapNullable <int>(row, col_gridPrintLayout_TextAlign_enumid.Name));
                }

                populateData();
                Util.displayMessageBoxSuccess("Saved");
            }
        }
Exemple #6
0
    protected void RefreshLogbookData()
    {
        MyFlightbook.Profile pf = MyFlightbook.Profile.GetUser(Page.User.Identity.Name);
        PrintingOptions      printingOptions = PrintOptions1.Options;

        mvLayouts.ActiveViewIndex = (int)printingOptions.Layout;
        List <LogbookEntryDisplay> lstFlights = LogbookEntryDisplay.GetFlightsForQuery(LogbookEntry.QueryCommand(mfbSearchForm1.Restriction, fAsc: true), pf.UserName, string.Empty, SortDirection.Ascending, pf.UsesHHMM, pf.UsesUTCDateOfFlight);

        IPrintingTemplate pt = ActiveTemplate;

        PrintLayout pl = PrintLayout.LayoutForType(printingOptions.Layout, CurrentUser);
        bool        fCanIncludeImages = pl.SupportsImages;

        List <int> lstPropsToExclude = new List <int>(printingOptions.ExcludedPropertyIDs);
        string     szPropSeparator   = printingOptions.PropertySeparatorText;

        // set up properties per flight, and compute rough lineheight
        foreach (LogbookEntryDisplay led in lstFlights)
        {
            // Fix up properties according to the printing options
            List <CustomFlightProperty> lstProps = new List <CustomFlightProperty>(led.CustomProperties);
            lstProps.RemoveAll(cfp => lstPropsToExclude.Contains(cfp.PropTypeID));

            led.CustomProperties    = lstProps.ToArray();
            led.CustPropertyDisplay = CustomFlightProperty.PropListDisplay(lstProps, pf.UsesHHMM, szPropSeparator);

            if (printingOptions.IncludeImages)
            {
                led.PopulateImages(true);
            }

            led.RowHeight = pl.RowHeight(led);
        }

        Master.PrintingCSS = pl.CSSPath.ToAbsoluteURL(Request).ToString();

        pt.BindPages(LogbookPrintedPage.Paginate(lstFlights, printingOptions.FlightsPerPage, printingOptions.OptionalColumns), CurrentUser, printingOptions.IncludeImages, !SuppressFooter, printingOptions.OptionalColumns);

        pnlResults.Visible = true;
    }
Exemple #7
0
        private void populateData()
        {
            itxt_ServerName.ValueText   = DBConnection.ServerName;
            itxt_DatabaseName.ValueText = DBConnection.DatabaseName;

            if (DBConnection.hasDBConnection)
            {
                txtHeaderText.Text       = Settings.HeaderText;
                txtRollingText.Text      = Settings.RollingText;
                lblRollingTextSpeed.Text = Settings.RollingTextSpeed.ToString();
                lblRefreshInterval.Text  = (Settings.RefreshInterval / 1000).ToString();
                lblAdInterval.Text       = Settings.AdInterval.ToString();
                txtAdsFolder.Text        = Settings.AdFolder;

                gridPrintLayout.DataSource = PrintLayout.get(null);
                in_PrintAreaWidth.Value    = Settings.PrintAreaWidth;
                in_PrintQty.Value          = Settings.PrintQty;

                txtSoundFolder.Text             = Settings.SoundFolder;
                txtTransitionSoundFilepath.Text = Settings.TransitionSoundFile;
                chkCounter.Checked           = Settings.PlayCounter;
                chkNotificationSound.Checked = Settings.PlayNotificationSound;
            }
        }
Exemple #8
0
    protected void RefreshLogbookData()
    {
        MyFlightbook.Profile pf = MyFlightbook.Profile.GetUser(Page.User.Identity.Name);
        PrintingOptions      printingOptions = PrintOptions1.Options;

        mvLayouts.ActiveViewIndex = (int)printingOptions.Layout;
        List <LogbookEntryDisplay> lstFlights = LogbookEntryDisplay.GetFlightsForQuery(LogbookEntry.QueryCommand(mfbSearchForm1.Restriction, fAsc: true), pf.UserName, string.Empty, SortDirection.Ascending, pf.UsesHHMM, pf.UsesUTCDateOfFlight);

        IPrintingTemplate pt = ActiveTemplate;

        PrintLayout pl = PrintLayout.LayoutForType(printingOptions.Layout, CurrentUser);
        bool        fCanIncludeImages = pl.SupportsImages;

        // Exclude both excluded properties and properties that have been moved to their own columns
        HashSet <int> lstPropsToExclude    = new HashSet <int>(printingOptions.ExcludedPropertyIDs);
        HashSet <int> lstPropsInOwnColumns = new HashSet <int>();

        foreach (OptionalColumn oc in printingOptions.OptionalColumns)
        {
            if (oc.ColumnType == OptionalColumnType.CustomProp)
            {
                lstPropsInOwnColumns.Add(oc.IDPropType);
            }
        }
        string szPropSeparator = printingOptions.PropertySeparatorText;

        // set up properties per flight, and compute rough lineheight
        foreach (LogbookEntryDisplay led in lstFlights)
        {
            // Fix up properties according to the printing options
            List <CustomFlightProperty> lstProps = new List <CustomFlightProperty>(led.CustomProperties);

            // And fix up model as well.
            switch (printingOptions.DisplayMode)
            {
            case PrintingOptions.ModelDisplayMode.Full:
                break;

            case PrintingOptions.ModelDisplayMode.Short:
                led.ModelDisplay = led.ShortModelName;
                break;

            case PrintingOptions.ModelDisplayMode.ICAO:
                led.ModelDisplay = led.FamilyName;
                break;
            }


            // Remove from the total property set all explicitly excluded properties...
            lstProps.RemoveAll(cfp => lstPropsToExclude.Contains(cfp.PropTypeID));

            // ...and then additionally exclude from the display any that's in its own column to avoid redundancy.
            lstProps.RemoveAll(cfp => lstPropsInOwnColumns.Contains(cfp.PropTypeID));
            led.CustPropertyDisplay = CustomFlightProperty.PropListDisplay(lstProps, pf.UsesHHMM, szPropSeparator);

            if (printingOptions.IncludeImages)
            {
                led.PopulateImages(true);
            }

            if (!printingOptions.IncludeSignatures)
            {
                led.CFISignatureState = LogbookEntryBase.SignatureState.None;
            }
            led.RowHeight = pl.RowHeight(led);
        }

        Master.PrintingCSS = pl.CSSPath.ToAbsoluteURL(Request).ToString();

        pt.BindPages(LogbookPrintedPage.Paginate(lstFlights, printingOptions), CurrentUser, printingOptions, !SuppressFooter);

        pnlResults.Visible = true;
    }
Exemple #9
0
 private void btnAddPrintLine_Click(object sender, EventArgs e)
 {
     PrintLayout.add();
     populateData();
 }