/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AParentForm"></param>
        public TPartnerMergedPartnerInfoDialog(Form AParentForm) : base()
        {
            //
            // 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
            this.btnOK.Text                       = Catalog.GetString("&OK");
            this.btnCancel.Text                   = Catalog.GetString("&Cancel");
            this.lblHeading.Text                  = Catalog.GetString("The Partner that you have selected,");
            this.lblHeading2.Text                 = Catalog.GetString("was Merged into another Partner and is therefore no longer accessible.");
            this.txtMergedPartner.LabelText       = Catalog.GetString("Merged, Partner, A   [PERSON]");
            this.label3.Text                      = Catalog.GetString("Merge Date") + ":";
            this.label1.Text                      = Catalog.GetString("Partner Class") + ":";
            this.txtMergedIntoPartner.LabelText   = Catalog.GetString("Merged-Into, Partner, A");
            this.lblMergedIntoPartnerKeyName.Text = Catalog.GetString("Partner Key && Name") + ":";
            this.txtMergedIntoPartnerClass.Text   = Catalog.GetString("PERSON");
            this.label2.Text                      = Catalog.GetString("Merged By") + ":";
            this.txtMergedBy.Text                 = Catalog.GetString("DUMMY");
            this.txtMergeDate.Text                = Catalog.GetString("17-FEB-2009");
            this.lblMergedIntoPartnerInfo.Text    = Catalog.GetString("This is the Partner that it got merged into") + ":";
            this.lblInstructions.Text             = Catalog.GetString("Choose \'OK\' to accept the Merged-Into Partner, or \'Cancel\' to stop the operation ");
            this.Text = Catalog.GetString("Merged Partner Information");
            #endregion

            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(AParentForm, this, stbMain);
        }
        /// constructor
        public TFrmtestChkbox(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.lblSonst.Text           = Catalog.GetString("Sonst") + ":";
            this.mniClose.ToolTipText    = Catalog.GetString("Closes this window");
            this.mniClose.Text           = Catalog.GetString("&Close");
            this.mniFile.Text            = Catalog.GetString("&File");
            this.mniHelpPetraHelp.Text   = Catalog.GetString("&OpenPetra Help");
            this.mniHelpBugReport.Text   = Catalog.GetString("Bug &Report");
            this.mniAbout.Text           = Catalog.GetString("&About OpenPetra");
            this.mniDevelopmentTeam.Text = Catalog.GetString("&The Development Team...");
            this.mniHelp.Text            = Catalog.GetString("&Help");
            this.Text = Catalog.GetString("Test screen");
            #endregion

            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(AParentForm, this, stbMain);
            FPetraUtilsObject.ActionEnablingEvent += ActionEnabledEvent;

            FPetraUtilsObject.InitActionState();
            chkParentCheckedChanged(null, null);
            chkSonstCheckedChanged(null, null);
            chkChildCheckedChanged(null, null);
        }
    /// constructor
    public TFrmtestChkbox(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.lblSonst.Text = Catalog.GetString("Sonst") + ":";
      this.mniClose.ToolTipText = Catalog.GetString("Closes this window");
      this.mniClose.Text = Catalog.GetString("&Close");
      this.mniFile.Text = Catalog.GetString("&File");
      this.mniHelpPetraHelp.Text = Catalog.GetString("&OpenPetra Help");
      this.mniHelpBugReport.Text = Catalog.GetString("Bug &Report");
      this.mniAbout.Text = Catalog.GetString("&About OpenPetra");
      this.mniDevelopmentTeam.Text = Catalog.GetString("&The Development Team...");
      this.mniHelp.Text = Catalog.GetString("&Help");
      this.Text = Catalog.GetString("Test screen");
      #endregion

      FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(AParentForm, this, stbMain);
      FPetraUtilsObject.ActionEnablingEvent += ActionEnabledEvent;

      FPetraUtilsObject.InitActionState();
      chkParentCheckedChanged(null, null);
      chkSonstCheckedChanged(null, null);
      chkChildCheckedChanged(null, null);

    }
Beispiel #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AParentForm"></param>
        public TPartnerMergedPartnerInfoDialog(Form AParentForm) : base()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(AParentForm, this, stbMain);
        }
Beispiel #5
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;
 }
 /// <summary>
 /// The main constructor
 /// </summary>
 /// <param name="ACallerFormOrControl">The form or control that is instantiating this class</param>
 /// <param name="APetraUtilsObject">The TFrmPetraUtils instance associated with the caller form or control</param>
 /// <param name="AGrid">The grid associated with the caller form or control</param>
 /// <param name="AButtonPanel">The IButtonPanel associated with the caller form or control.  (Typically simply pass 'this').</param>
 /// <param name="APanelFilterFind">The Panel control associated with the caller form or control.</param>
 /// <param name="AChkToggleFilter">The checkbox control associated with the caller form or control.</param>
 /// <param name="ALblRecordCounter">The Label control displaying the record count associated with the caller form or control.</param>
 public TFilterAndFindPanel(IFilterAndFind ACallerFormOrControl,
                            TFrmPetraUtils APetraUtilsObject,
                            TSgrdDataGridPaged AGrid,
                            IButtonPanel AButtonPanel,
                            Panel APanelFilterFind,
                            CheckBox AChkToggleFilter,
                            Label ALblRecordCounter)
 {
     FCallerFormOrControl = ACallerFormOrControl;
     FPetraUtilsObject    = APetraUtilsObject;
     FGrid             = AGrid;
     FButtonPanel      = AButtonPanel;
     FPnlFilterFind    = APanelFilterFind;
     FChkToggleFilter  = AChkToggleFilter;
     FLblRecordCounter = ALblRecordCounter;
 }
Beispiel #7
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AParentForm"></param>
        public TLocationFindDialogWinForm(Form AParentForm) : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

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

            FLocationFindObject = TRemote.MPartner.Partner.UIConnectors.PartnerLocationFind();

            FPetraUtilsObject.InitActionState();
            FDefaultValues = FFindCriteriaDataTable.NewRow();

            lblSearchInfo.Text = "";
            grdResult.SendToBack();

            // catch enter on all controls, to trigger search or accept (could use this.AcceptButton, but we have a search button and an Accept Button)
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey);

            this.Closed += new System.EventHandler(this.TLocationFindDialogWinForm_Closed);
        }
Beispiel #8
0
        /// <summary>
        /// Runs the revalation ...
        /// </summary>
        /// <param name="AParentForm"></param>
        public TGLRevaluation(Form AParentForm) : base()
        {
            //
            // 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;
        }
 /// <summary>
 /// The main constructor
 /// </summary>
 /// <param name="ACallerFormOrControl">The form or control that is instantiating this class</param>
 /// <param name="APetraUtilsObject">The TFrmPetraUtils instance associated with the caller form or control</param>
 /// <param name="AGrid">The grid associated with the caller form or control</param>
 /// <param name="AButtonPanel">The IButtonPanel associated with the caller form or control.  (Typically simply pass 'this').</param>
 /// <param name="APanelFilterFind">The Panel control associated with the caller form or control.</param>
 /// <param name="AChkToggleFilter">The checkbox control associated with the caller form or control.</param>
 /// <param name="ALblRecordCounter">The Label control displaying the record count associated with the caller form or control.</param>
 public TFilterAndFindPanel(IFilterAndFind ACallerFormOrControl,
     TFrmPetraUtils APetraUtilsObject,
     TSgrdDataGridPaged AGrid,
     IButtonPanel AButtonPanel,
     Panel APanelFilterFind,
     CheckBox AChkToggleFilter,
     Label ALblRecordCounter)
 {
     FCallerFormOrControl = ACallerFormOrControl;
     FPetraUtilsObject = APetraUtilsObject;
     FGrid = AGrid;
     FButtonPanel = AButtonPanel;
     FPnlFilterFind = APanelFilterFind;
     FChkToggleFilter = AChkToggleFilter;
     FLblRecordCounter = ALblRecordCounter;
 }
Beispiel #10
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;
        }
Beispiel #11
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.tbtCreateExtract.Text = Catalog.GetString("Create Extract");
            this.tbtCreateExtract.ToolTipText = Catalog.GetString("Create an Extract from this result set");
            this.tbtGenerateChart.Text = Catalog.GetString("Generate Chart");
            this.tbtGenerateChart.ToolTipText = Catalog.GetString(
                "Generates a chart in Excel (not available for all reports)");
            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)));
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="Utils"></param>
 public void InitialiseData(TFrmPetraUtils Utils)
 {
 }
Beispiel #13
0
        /// <summary>
        /// Method to create and show the controls required for a particular code on the specified panel.
        /// Currently we support the following controls:
        ///    txt -> TextBox,
        ///    txt -> TTxtNumericTextBox with Format=Integer as the attribute,
        ///    cmb -> TCmbAutoComplete: content is defined in OptionalValues column: Format=yes/no turns the combo into a tri-state choice
        ///                where the OptionalValues do not have to be False and True because the result is yes or no based on SelectedIndex.
        ///    dtp -> TtxtPetraDate
        /// </summary>
        /// <param name="AControlCode">The code that is a primary key into the controls table</param>
        /// <param name="AHostPanel">The panel onto which the GUI controls will be placed</param>
        /// <param name="AInitialValue">The initial value for this 'setting'.  The value may be a comma separated list of values.</param>
        /// <param name="AReadOnly">Set to true to disable the control(s) or make them read-only as appropriate.</param>
        /// <param name="AValidationEventHandler">An event handler that will be called on validation</param>
        public void ShowControls(string AControlCode, Panel AHostPanel, string AInitialValue, bool AReadOnly, EventHandler AValidationEventHandler)
        {
            // Work out the PetraUtilsObject for the form that called us
            TFrmPetraUtils petraBase = ((IFrmPetra)AHostPanel.TopLevelControl).GetPetraUtilsObject();

            FPetraUtilsObject = (petraBase is TFrmPetraEditUtils) ? (TFrmPetraEditUtils)petraBase : null;

            // Set up a default view on the controls table that will tell us the controls we need for this code
            FDataTable.DefaultView.RowFilter = string.Format("{0}='{1}'", FCodeColumn, AControlCode);
            FDataTable.DefaultView.Sort      = string.Format("{0} ASC, {1} ASC", FCodeColumn, FControlIndexColumn);

            AHostPanel.AutoScroll = (FDataTable.DefaultView.Count > 1);
            AHostPanel.Controls.Clear();

            // Work out the value(s) that have been passed in as a comma separated list
            StringCollection values = StringHelper.GetCSVList(AInitialValue, ",", true);

            if (values.Count != FDataTable.DefaultView.Count)
            {
                return;
            }

            FCurrentHostPanel = AHostPanel;
            int id       = 0;
            int vPos     = 5;
            int tabIndex = 10;

            foreach (DataRowView drv in FDataTable.DefaultView)
            {
                // get the attributes as a dictionary
                Dictionary <string, string> attributes = new Dictionary <string, string>();
                object rowValue = drv.Row[FAttributesColumn];

                if ((rowValue != null) && rowValue.ToString().Contains("="))
                {
                    string[] attPairs = drv.Row[FAttributesColumn].ToString().Split(',');

                    foreach (string attPair in attPairs)
                    {
                        string[] att = attPair.Split('=');

                        if (att.Length == 2)
                        {
                            attributes.Add(att[0].Trim(), att[1].Trim());
                        }
                    }
                }

                // See if some of the popular attributes are defined and store their values in local variables
                string formatAttribute     = string.Empty;
                string allowBlankAttribute = string.Empty;
                string stretchAttribute    = string.Empty;
                int    widthAttribute      = -1;
                int    labelWidthAttribute = -1;

                if (attributes.ContainsKey("Format"))
                {
                    // Use lower case
                    formatAttribute = attributes["Format"].ToString().ToLower();
                }

                if (attributes.ContainsKey("Width"))
                {
                    widthAttribute = Convert.ToInt32(attributes["Width"]);
                }

                if (attributes.ContainsKey("LabelWidth"))
                {
                    labelWidthAttribute = Convert.ToInt32(attributes["LabelWidth"]);
                }

                if (attributes.ContainsKey("AllowBlankValue"))
                {
                    allowBlankAttribute = attributes["AllowBlankValue"].ToString().ToLower();
                }

                if (attributes.ContainsKey("Stretch"))
                {
                    stretchAttribute = attributes["Stretch"].ToString().ToLower();
                }

                // create the control label
                Label label = new Label();
                label.Name      = "cLabel_" + id.ToString();
                label.Text      = drv.Row[FLabelColumn].ToString() + ":";
                label.Location  = new Point(5, vPos);
                label.Size      = new Size((labelWidthAttribute > 0) ? labelWidthAttribute : (AHostPanel.Width / 2) - 10, 17);
                label.TextAlign = ContentAlignment.MiddleRight;
                label.Anchor    = AnchorStyles.Top | AnchorStyles.Left;

                AHostPanel.Controls.Add(label);

                // Create the control
                // We support text boxes, numeric (integer) text boxes, combo boxes and date boxes
                switch (drv.Row[FControlTypeColumn].ToString().Substring(0, 3))
                {
                case "txt":

                    if (formatAttribute == "integer")
                    {
                        TTxtNumericTextBox txt = new TTxtNumericTextBox();
                        txt.Context     = AHostPanel;
                        txt.ControlMode = TTxtNumericTextBox.TNumericTextBoxMode.Integer;
                        txt.Name        = "cValue_" + id.ToString();
                        txt.Location    = new Point(label.Right + 10, vPos);
                        txt.Size        = new Size((widthAttribute > 0) ? widthAttribute : 100, 22);
                        txt.TabStop     = true;
                        txt.TabIndex    = tabIndex;

                        int iValue;

                        if (int.TryParse(values[id], out iValue))
                        {
                            txt.NumberValueInt = iValue;
                        }

                        txt.ReadOnly = AReadOnly;

                        txt.Validated   += AValidationEventHandler;
                        txt.TextChanged += new EventHandler(MultiChangeEventHandler);

                        AHostPanel.Controls.Add(txt);
                    }
                    else
                    {
                        TextBox txt = new TextBox();
                        txt.Name     = "cValue_" + id.ToString();
                        txt.Location = new Point(label.Right + 10, vPos);
                        txt.Size     = new Size((widthAttribute > 0) ? widthAttribute : AHostPanel.Width - label.Width - 25, 22);
                        txt.TabStop  = true;
                        txt.TabIndex = tabIndex;
                        txt.Text     = values[id];
                        txt.ReadOnly = AReadOnly;

                        if (stretchAttribute == "horizontally")
                        {
                            txt.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                        }

                        txt.Validated   += AValidationEventHandler;
                        txt.TextChanged += new EventHandler(MultiChangeEventHandler);

                        AHostPanel.Controls.Add(txt);
                    }

                    break;

                case "cmb":

                    if (attributes.ContainsKey("List"))
                    {
                        TCmbAutoPopulated cmb = new TCmbAutoPopulated();
                        cmb.Name      = "cValue_" + id.ToString();
                        cmb.Location  = new Point(label.Right + 10, vPos);
                        cmb.Size      = new Size((widthAttribute > 0) ? widthAttribute : AHostPanel.Width - label.Width - 25, 22);
                        cmb.TabStop   = true;
                        cmb.TabIndex  = tabIndex;
                        cmb.ListTable = (TCmbAutoPopulated.TListTableEnum)Enum.Parse(typeof(TCmbAutoPopulated.TListTableEnum),
                                                                                     attributes["List"].ToString(),
                                                                                     true);
                        cmb.InitialiseUserControl();
                        cmb.SetSelectedString(values[id], -1);

                        cmb.Enabled = !AReadOnly;

                        cmb.Validated            += AValidationEventHandler;
                        cmb.SelectedValueChanged += new EventHandler(MultiChangeEventHandler);

                        AHostPanel.Controls.Add(cmb);
                    }
                    else
                    {
                        TCmbAutoComplete cmb = new TCmbAutoComplete();
                        cmb.Name     = "cValue_" + id.ToString();
                        cmb.Location = new Point(label.Right + 10, vPos);
                        cmb.Size     = new Size((widthAttribute > 0) ? widthAttribute : AHostPanel.Width - label.Width - 25, 22);
                        cmb.TabStop  = true;
                        cmb.TabIndex = tabIndex;

                        if (drv.Row[FOptionalValuesColumn] != null)
                        {
                            string[] optValues = drv.Row[FOptionalValuesColumn].ToString().Split(',');

                            for (int i = 0; i < optValues.Length; i++)
                            {
                                cmb.Items.Add(optValues[i].ToString().Trim());
                            }
                        }

                        if (formatAttribute == "yes/no")
                        {
                            cmb.SetSelectedYesNo(values[id]);
                            cmb.Tag = "yes/no";
                        }
                        else
                        {
                            cmb.Text = values[id];
                        }

                        if (stretchAttribute == "horizontally")
                        {
                            cmb.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
                        }

                        cmb.AllowBlankValue = (allowBlankAttribute == "true");
                        cmb.Enabled         = !AReadOnly;

                        cmb.Validated            += AValidationEventHandler;
                        cmb.SelectedIndexChanged += new EventHandler(MultiChangeEventHandler);
                        cmb.TextChanged          += new EventHandler(ComboBoxTextChangeEventHandler);

                        AHostPanel.Controls.Add(cmb);
                    }

                    break;

                case "dtp":
                    TtxtPetraDate dtp = new TtxtPetraDate();
                    dtp.Name     = "cValue_" + id.ToString();
                    dtp.Location = new Point(label.Right + 10, vPos);
                    dtp.Size     = new Size(94, 22);
                    dtp.TabStop  = true;
                    dtp.TabIndex = tabIndex;

                    DateTime dt;

                    if (DateTime.TryParse(values[id], out dt))
                    {
                        dtp.Date = Convert.ToDateTime(values[id]);
                    }
                    else
                    {
                        dtp.Date = null;
                    }

                    dtp.ReadOnly = AReadOnly;

                    dtp.Validated   += AValidationEventHandler;
                    dtp.DateChanged += new TPetraDateChangedEventHandler(MultiChangeEventHandler);

                    AHostPanel.Controls.Add(dtp);
                    break;

                default:
                    break;
                }

                id++;
                tabIndex += 10;
                vPos     += 30;
            }
        }
Beispiel #14
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.btnHelp.Text = Catalog.GetString("&Help");
            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;
        }