Пример #1
0
        /// <summary>
        /// constructor
        /// </summary>
        public TPartnerNewDialogWinForm(Form AParentForm) : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            #region CATALOGI18N

            // this code has been inserted by GenerateI18N, all changes in this region will be overwritten by GenerateI18N
            this.lblSitesAvailable.Text         = Catalog.GetString("S&ites Available") + ":";
            this.lblPartnerKey.Text             = Catalog.GetString("Partner &Key") + ":";
            this.lblPartnerClass.Text           = Catalog.GetString("Partner C&lass") + ":";
            this.Label1.Text                    = Catalog.GetString("&Acquisition Code") + ":";
            this.chkPrivatePartner.Text         = Catalog.GetString("&Private Partner") + ":";
            this.txtPartnerKey.LabelText        = Catalog.GetString("Partner Key");
            this.txtFamilyPartnerBox.ButtonText = Catalog.GetString("&Family...");
            this.btnOK.Text     = Catalog.GetString("&OK");
            this.btnCancel.Text = Catalog.GetString("&Cancel");
            this.Text           = Catalog.GetString("New Partner");
            #endregion

            FPetraUtilsObject = new TFrmPetraUtils(AParentForm, this, stbMain);
            this.FPetraUtilsObject.SetStatusBarText(this.btnOK, Catalog.GetString("Accept data and continue"));
            this.FPetraUtilsObject.SetStatusBarText(this.btnCancel, Catalog.GetString("Cancel data entry and close"));
            this.FPetraUtilsObject.SetStatusBarText(this.btnHelp, Catalog.GetString("Help"));
            this.FPetraUtilsObject.SetStatusBarText(this.cmbAcquisitionCode, Catalog.GetString("Please select an Acquisition Code"));
            this.FPetraUtilsObject.SetStatusBarText(this.grdInstalledSites, Catalog.GetString("Please select a Site"));
            this.FPetraUtilsObject.SetStatusBarText(this.cmbPartnerClass, Catalog.GetString("Please select a Partner Class"));
            this.FPetraUtilsObject.SetStatusBarText(this.txtPartnerKey,
                                                    Catalog.GetString("Please enter a Partner Key or Accept the default Partner Key"));
            this.FPetraUtilsObject.SetStatusBarText(this.txtFamilyPartnerBox,
                                                    Catalog.GetString("Please select a Family that the Person should belong to"));

            FFormSetupFinished = false;
        }
Пример #2
0
        /// <summary>
        /// constructor
        /// </summary>
        public TLoginForm() : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            #region CATALOGI18N

            // this code has been inserted by GenerateI18N, all changes in this region will be overwritten by GenerateI18N
            this.lblUserName.Text         = Catalog.GetString("&User ID") + ":";
            this.lblPassword.Text         = Catalog.GetString("&Password") + ":";
            this.btnLogin.Text            = Catalog.GetString(" &Login");
            this.btnCancel.Text           = Catalog.GetString(" &Quit");
            this.chkRememberUserName.Text = Catalog.GetString("&Remember the User ID");
            this.label1.Text          = Catalog.GetString("Initial Login: demo/demo or sysadmin/CHANGEME");
            this.lblPetraVersion.Text = Catalog.GetString("Version");
            this.Text = Catalog.GetString("OpenPetra Login");
            #endregion

            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(null, this, null);

            this.Text = StrPetraLoginFormTitle;

            this.lblPetraVersion.Text = Catalog.GetString("Version") + " " + TApplicationVersion.GetApplicationVersion();

            //this.Height = 142;
            //pnlLoginControls.Top = 46;
        }
Пример #3
0
        /// <summary>
        /// Runs the revalation ...
        /// </summary>
        /// <param name="AParentForm"></param>
        /// <param name="ASecurityContext"></param>
        public TGLRevaluation(Form AParentForm, string ASecurityContext = "") : base()
        {
            FSecurityContext = ASecurityContext;

            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            #region CATALOGI18N

            // this code has been inserted by GenerateI18N, all changes in this region will be overwritten by GenerateI18N
            btnRevaluate.Text = Catalog.GetString("Revalue");
            btnCancel.Text    = Catalog.GetString("Cancel");
            Text = Catalog.GetString("Revaluation ...");
            #endregion

            // Initialise our PetraForm object so we can use it to remember window positions
            FPetraUtilsObject = new TFrmPetraUtils(AParentForm, this, null);


            this.btnCancel.Click    += new EventHandler(CancelRevaluation);
            this.btnRevaluate.Click += new EventHandler(RunRevaluation);
            this.Resize             += TGLRevaluation_Resize;
            this.Load        += TGLRevaluation_Load;
            this.FormClosing += TGLRevaluation_FormClosing;
        }
Пример #4
0
        /// <remarks>
        /// For NUnit tests that just try to open the Conference Find screen but which don't instantiate a Main Form
        /// we need to work around the fact that there is no Main Window!
        /// </remarks>
        private void InitGridManually()
        {
            MethodInfo Method = null;

            LoadDataGrid(true);

            grdConferences.DoubleClickCell += new TDoubleClickCellEventHandler(grdConferences_DoubleClickCell);

            // Attempt to obtain conference key from parent form or parent's parent form and use this to focus the currently selected
            // conference in the grid. If no conference key is found then the first conference in the grid will be focused.
            Form MainWindow = FPetraUtilsObject.GetCallerForm();

            // Main Window will not be available if run from within NUnit Test without Main Form instance...
            if (MainWindow != null)
            {
                Method = MainWindow.GetType().GetMethod("GetSelectedConferenceKey");
            }

            if (Method == null)
            {
                // Main Window will not be available if run from within NUnit Test without Main Form instance...
                if (MainWindow != null)
                {
                    Method = MainWindow.GetType().GetMethod("GetPetraUtilsObject");
                }

                if (Method != null)
                {
                    TFrmPetraUtils ParentPetraUtilsObject = (TFrmPetraUtils)Method.Invoke(MainWindow, null);
                    MainWindow = ParentPetraUtilsObject.GetCallerForm();
                    Method     = MainWindow.GetType().GetMethod("GetSelectedConferenceKey");
                }
            }

            if (Method != null)
            {
                FSelectedConferenceKey = Convert.ToInt64(Method.Invoke(MainWindow, null));
                int RowPos = 1;

                foreach (DataRowView rowView in FMainDS.PcConference.DefaultView)
                {
                    PcConferenceRow Row = (PcConferenceRow)rowView.Row;

                    if (Row.ConferenceKey == FSelectedConferenceKey)
                    {
                        break;
                    }

                    RowPos++;
                }

                // automatically select the current conference
                grdConferences.SelectRowInGrid(RowPos, true);
            }
        }
        /// /////////////////////////////////////////////////////////////////////////////////////////////////////////

        public void InitializeGUI(TFrmAPMain AMainForm)
        {
            FMainForm = AMainForm;

            TFrmPetraUtils utils = FMainForm.GetPetraUtilsObject();

            utils.SetStatusBarText(grdInvoices, Catalog.GetString("Double-click an invoice to see full details"));
            utils.SetStatusBarText(btnReverseTagged, Catalog.GetString("Click to reverse the tagged items that have already been posted"));
            utils.SetStatusBarText(btnTagAll, Catalog.GetString("Click to tag all the displayed items"));
            utils.SetStatusBarText(btnUntagAll, Catalog.GetString("Click to un-tag all the displayed items"));
            utils.SetStatusBarText(chkToggleFilter, Catalog.GetString("Click to show/hide the Filter/Find panel"));
        }
Пример #6
0
 /// <summary>
 /// constructor
 /// </summary>
 public TGridPreview(Form APreviewForm,
                     TFrmPetraUtils APetraUtilsObject,
                     TPreviewDelegate APreviewDelegate,
                     TResultList AResultList,
                     TParameterList AParameters)
 {
     results               = AResultList.ConvertToFormattedStrings(AParameters);
     FOrigParameters       = AParameters;
     parameters            = AParameters.ConvertToFormattedStrings();
     FPreviewForm          = APreviewForm;
     FPetraUtilsObject     = APetraUtilsObject;
     FPreviewDelegate      = APreviewDelegate;
     FGenerateReportThread = null;
 }
Пример #7
0
        /// /////////////////////////////////////////////////////////////////////////////////////////////////////////


        public void InitializeGUI(TFrmAPMain AMainForm)
        {
            FMainForm = AMainForm;

            TFrmPetraUtils utils = FMainForm.GetPetraUtilsObject();

            utils.SetStatusBarText(grdSuppliers, Catalog.GetString("Double-click a supplier to see the transaction history"));
            utils.SetStatusBarText(btnCreateCreditNote, Catalog.GetString("Click to create a credit note for the selected supplier"));
            utils.SetStatusBarText(btnCreateInvoice, Catalog.GetString("Click to create an invoice for the selected supplier"));
            utils.SetStatusBarText(btnEditDetails, Catalog.GetString("Click to edit the details for the selected supplier"));
            utils.SetStatusBarText(btnNewSupplier, Catalog.GetString("Click to create a new supplier"));
            //utils.SetStatusBarText(btnSupplierTransactions, Catalog.GetString("Click to view the transaction history for the selected supplier"));
            utils.SetStatusBarText(chkToggleFilter, Catalog.GetString("Click to show/hide the Filter/Find panel"));
        }
        /// <summary>
        /// todoComment
        /// </summary>
        /// <returns></returns>
        public void SendEmailToPartner(TFrmPetraUtils APetraUtilsObject, bool AEmailToClipboard)
        {
            if (FPartnerInfoCollPanel.UserControlInstance == null)
            {
                FPartnerInfoCollPanel.RealiseUserControlNow();
            }

            var PartnerInfoUC = ((TUC_PartnerInfo)(FPartnerInfoCollPanel.UserControlInstance));

            PartnerInfoUC.PetraUtilsObject = APetraUtilsObject;
            PartnerInfoUC.InitUserControl();

            if (!AEmailToClipboard)
            {
                PartnerInfoUC.DataLoaded += PartnerInfoUC_DataLoaded;
            }

            // Ask the UserControl to load the data for the Partner; once it is finished
            // the 'DataLoaded' Event will fire and the Email can get sent - if the Partner
            // has indeed got a 'Primary E-Mail Address'
            if (!UpdatePartnerInfoPanel(false, PartnerInfoUC))
            {
                if (AEmailToClipboard)
                {
                    String PrimaryEmailAddress;

                    if (Calculations.GetPrimaryEmailAddress((PartnerInfoUC).GetPartnerAttributeData(), out PrimaryEmailAddress))
                    {
                        Clipboard.SetDataObject(PrimaryEmailAddress);
                    }
                    else
                    {
                        Clipboard.SetDataObject(String.Empty);
                    }
                }
                else
                {
                    PartnerInfoUC_DataLoaded(PartnerInfoUC, null);
                }
            }
        }
        /// <summary>
        /// todoComment
        /// </summary>
        /// <returns></returns>
        public void SendEmailToPartner(TFrmPetraUtils APetraUtilsObject)
        {
            if (FPartnerInfoCollPanel.UserControlInstance == null)
            {
                FPartnerInfoCollPanel.RealiseUserControlNow();
            }

            var PartnerInfoUC = ((TUC_PartnerInfo)(FPartnerInfoCollPanel.UserControlInstance));

            PartnerInfoUC.PetraUtilsObject = APetraUtilsObject;
            PartnerInfoUC.InitUserControl();

            PartnerInfoUC.DataLoaded += PartnerInfoUC_DataLoaded;

            // Ask the UserControl to load the data for the Partner; once it is finished
            // the 'DataLoaded' Event will fire and the Email can get sent - if the Partner
            // has indeed got a 'Primary E-Mail Address'
            if (!UpdatePartnerInfoPanel(false, PartnerInfoUC))
            {
                PartnerInfoUC_DataLoaded(PartnerInfoUC, null);
            }
        }
 /// <summary>
 /// todoComment
 /// </summary>
 public void SendEmailToPartner(TFrmPetraUtils APetraUtilsObject)
 {
     FLogic.SendEmailToPartner(APetraUtilsObject, false);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="Utils"></param>
 public void InitialiseData(TFrmPetraUtils Utils)
 {
 }
Пример #12
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="ACallerForm"></param>
        /// <param name="caption">caption of the dialog</param>
        /// <param name="duration"></param>
        /// <param name="results"></param>
        /// <param name="parameters"></param>
        /// <param name="AWrapColumn">True: Wrap the text in the column. False: Cut the text that is too long for the column</param>
        /// <param name="ACalculator"></param>
        public TFrmPrintPreview(Form ACallerForm, String caption, TimeSpan duration, TResultList results,
                                TParameterList parameters, bool AWrapColumn, TRptCalculator ACalculator)
            : base()
        {
            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(ACallerForm, this, stbMain);
            FCalculator       = ACalculator;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            #region CATALOGI18N

            // this code has been inserted by GenerateI18N, all changes in this region will be overwritten by GenerateI18N
            this.mniFile.Text                = Catalog.GetString("&File");
            this.mniFileClose.Text           = Catalog.GetString("&Close");
            this.mniFileClose.ToolTipText    = Catalog.GetString("Close the preview");
            this.mniHelp.Text                = Catalog.GetString("&Help");
            this.mniHelpPetraHelp.Text       = Catalog.GetString("&Petra Help");
            this.mniHelpBugReport.Text       = Catalog.GetString("Bug &Report");
            this.mniHelpAboutPetra.Text      = Catalog.GetString("&About OpenPetra...");
            this.mniHelpDevelopmentTeam.Text = Catalog.GetString("&The Development Team...");
            this.stbMain.Text                = Catalog.GetString("Status Bar");
            this.stpInfo.Text                = Catalog.GetString("Ready");
            this.tbbClose.Text               = Catalog.GetString("Close");
            this.tbbClose.ToolTipText        = Catalog.GetString("Closes this window");
            this.Text                           = Catalog.GetString("Print Preview");
            this.tbpText.Text                   = Catalog.GetString("Text Preview");
            this.txtOutput.Text                 = Catalog.GetString("Text Output");
            this.tbpPreview.Text                = Catalog.GetString("Print Preview");
            this.lblNoPrinter.Text              = Catalog.GetString("Unfortunately this function is disabled. Please" + " install a printer to use this page.");
            this.CbB_Zoom.Text                  = Catalog.GetString("Select Zoom");
            this.Btn_PreviousPage.Text          = Catalog.GetString("Previous Page");
            this.Btn_NextPage.Text              = Catalog.GetString("Next Page");
            this.tbpGridView.Text               = Catalog.GetString("Detail Reports");
            this.tbtPrint.Text                  = Catalog.GetString("Print");
            this.tbtPrint.ToolTipText           = Catalog.GetString("Print the report");
            this.tbtExportCSV.Text              = Catalog.GetString("Export to CSV");
            this.tbtExportCSV.ToolTipText       = Catalog.GetString("Export to CSV text file");
            this.tbtExportExcelFile.Text        = Catalog.GetString("Export to Excel");
            this.tbtExportExcelFile.ToolTipText = Catalog.GetString("Export to Excel xlsx file or directly into Excel, if" + " it is available");
            this.tbtExportText.Text             = Catalog.GetString("Save as Text file");
            this.tbtExportText.ToolTipText      = Catalog.GetString("Save as a text file (e.g. for email)");
            this.tbtSendEmail.Text              = Catalog.GetString("Send Email");
            this.tbtSendEmail.ToolTipText       = Catalog.GetString("Send the Report as an Email with Excel attachment");
            this.tbtGenerateChart.Text          = Catalog.GetString("Generate Chart");
            this.tbtGenerateChart.ToolTipText   = Catalog.GetString(
                "Generates a chart in Excel (only ava" + "ilable yet for few reports at the moment)");
            this.Text = Catalog.GetString("Print Preview");
            #endregion

            System.Windows.Forms.TabPage SelectedTab;

            this.Text             = this.Text + ": " + caption;
            this.ReportName       = caption;
            this.Results          = results;
            this.Parameters       = parameters;
            FTxtPrinter           = new TTxtPrinter();
            this.ReportTxtPrinter = new TReportPrinterLayout(Results, Parameters, FTxtPrinter, AWrapColumn);
            ReportTxtPrinter.PrintReport();

            this.txtOutput.Lines = FTxtPrinter.GetArrayOfString();
            FPrinterInstalled    = this.PrintDocument.PrinterSettings.IsValid;

            FWrapColumn = AWrapColumn;

            if (FPrinterInstalled)
            {
                this.tabPreview.SelectedTab = tbpPreview;
                FGfxPrinter = new TGfxPrinter(this.PrintDocument, TGfxPrinter.ePrinterBehaviour.eReport);

                // TReportPrinterLayout ReportGfxPrinter
                new TReportPrinterLayout(Results, Parameters, FGfxPrinter, AWrapColumn);

                this.PrintPreviewControl.Document     = FGfxPrinter.Document;
                this.PrintPreviewControl.Zoom         = 1; // show 100% by default
                this.PrintPreviewControl.UseAntiAlias = true;
                this.lblNoPrinter.Visible             = false;
            }
            else
            {
                // PrintPreviewControl.CalculatePageInfo will throw InvalidPrinterException
                this.tabPreview.SelectedTab      = tbpText;
                this.PrintPreviewControl.Visible = false;
                this.CbB_Zoom.Enabled            = false;
                this.Btn_PreviousPage.Enabled    = false;
                this.Btn_NextPage.Enabled        = false;
            }

            this.PrintChartProcedure         = null;
            this.PrintChartProcedureValid    = false;
            sgGridView.SortableHeaders       = false;
            sgGridView.SelectionMode         = SourceGrid.GridSelectionMode.Cell;
            this.sgGridView.DoubleClickCell += new TDoubleClickCellEventHandler(this.SgGridView_DoubleClickCell);
            FGridPreview = new TGridPreview(this, FPetraUtilsObject, @PreviewDetailReport, Results, Parameters);

            if (!FGridPreview.PopulateResultGrid(sgGridView))
            {
                SelectedTab = tabPreview.SelectedTab;
                this.tabPreview.TabPages.Clear();
                this.tabPreview.TabPages.AddRange(new TabPage[] { this.tbpText, this.tbpPreview });
                tabPreview.SelectedTab = SelectedTab;
            }
            else
            {
                FGridPreview.PopulateGridContextMenu(ContextMenu1);
            }

            stpInfo.Text = string.Empty;
            stbMain.ShowMessage(String.Format(Catalog.GetString("It took {0} to calculate the report"), FormatDuration(duration)));
        }