private void InitializeManualCode() { FGLTransactionFindObject = TRemote.MFinance.Finance.UIConnectors.GLTransactionFind(); // remove from the combobox all ledger numbers which the user does not have permission to access DataView cmbLedgerDataView = (DataView)cmbLedger.cmbCombobox.DataSource; for (int i = 0; i < cmbLedgerDataView.Count; i++) { string LedgerNumberStr; // postgresql if (cmbLedgerDataView[i].Row[0].GetType().Equals(typeof(int))) { LedgerNumberStr = ((int)cmbLedgerDataView[i].Row[0]).ToString("0000"); } else // sqlite { LedgerNumberStr = ((Int64)cmbLedgerDataView[i].Row[0]).ToString("0000"); } if (!UserInfo.GUserInfo.IsInModule("LEDGER" + LedgerNumberStr)) { cmbLedgerDataView.Delete(i); i--; } } // add event to combobox (this is the best moment to do this) cmbLedger.SelectedValueChanged += new System.EventHandler(this.OnComboChange); // add divider line (can't currently do this in YAML) DevAge.Windows.Forms.Line linCriteriaDivider = new DevAge.Windows.Forms.Line(); linCriteriaDivider.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); linCriteriaDivider.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; linCriteriaDivider.FirstColor = System.Drawing.SystemColors.ControlDark; linCriteriaDivider.LineStyle = DevAge.Windows.Forms.LineStyle.Horizontal; linCriteriaDivider.Location = new System.Drawing.Point(grpFindCriteria.Location.Y + 6, btnSearch.Location.Y - 2); linCriteriaDivider.Name = "linCriteriaDivider"; linCriteriaDivider.SecondColor = System.Drawing.SystemColors.ControlLightLight; linCriteriaDivider.Size = new System.Drawing.Size(grpFindCriteria.Size.Width - 12, 2); grpFindCriteria.Controls.Add(linCriteriaDivider); // pnlBlankSearchResult pnlBlankSearchResult.BackColor = System.Drawing.SystemColors.ControlLightLight; pnlBlankSearchResult.Size = grdResult.Size; lblSearchInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); // lblSearchInfo this.lblSearchInfo.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblSearchInfo.ForeColor = System.Drawing.SystemColors.ControlDarkDark; lblSearchInfo.Size = grdResult.Size; lblSearchInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // remove '0' from these textboxes txtBatchNumber.NumberValueInt = null; txtMinimumAmount.NumberValueInt = null; txtMaximumAmount.NumberValueInt = null; // set button to be on the very right of the screen (can't make this work in YAML) btnClear.Location = new System.Drawing.Point(linCriteriaDivider.Location.X + linCriteriaDivider.Width - btnClear.Width, btnClear.Location.Y); // set to blank initially lblRecordCounter.Text = ""; // event fired on screen close this.Closed += new System.EventHandler(this.TFrmGLTransactionFindScreen_Closed); // catch enter on all controls, to trigger search or accept (could use this.AcceptButton, but we have several search buttons etc) this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey); // catch enter on grid to view the selected transaction this.grdResult.EnterKeyPressed += new Ict.Common.Controls.TKeyPressedEventHandler(this.BtnView_Click); // fix tab order int Temp = cmbCostCentre.TabIndex; int Temp2 = txtJournalDescription.TabIndex; cmbCostCentre.TabIndex = dtpDateFrom.TabIndex; dtpDateFrom.TabIndex = dtpDateTo.TabIndex; dtpDateTo.TabIndex = txtNarrative.TabIndex; txtNarrative.TabIndex = txtBatchDescription.TabIndex; txtBatchDescription.TabIndex = txtBatchNumber.TabIndex; txtBatchNumber.TabIndex = Temp; txtJournalDescription.TabIndex = cmbAccount.TabIndex; cmbAccount.TabIndex = Temp2; this.ActiveControl = cmbStatus; FinishButtonPanelSetup(); }
private void InitializeManualCode() { FGLTransactionFindObject = TRemote.MFinance.Finance.UIConnectors.GLTransactionFind(); // remove from the combobox all ledger numbers which the user does not have permission to access DataView cmbLedgerDataView = (DataView)cmbLedger.cmbCombobox.DataSource; for (int i = 0; i < cmbLedgerDataView.Count; i++) { string LedgerNumberStr; // postgresql if (cmbLedgerDataView[i].Row[0].GetType().Equals(typeof(int))) { LedgerNumberStr = ((int)cmbLedgerDataView[i].Row[0]).ToString("0000"); } else // sqlite { LedgerNumberStr = ((Int64)cmbLedgerDataView[i].Row[0]).ToString("0000"); } if (!UserInfo.GUserInfo.IsInModule("LEDGER" + LedgerNumberStr)) { cmbLedgerDataView.Delete(i); i--; } } // add event to combobox (this is the best moment to do this) cmbLedger.SelectedValueChanged += new System.EventHandler(this.OnComboChange); // add divider line (can't currently do this in YAML) DevAge.Windows.Forms.Line linCriteriaDivider = new DevAge.Windows.Forms.Line(); linCriteriaDivider.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); linCriteriaDivider.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; linCriteriaDivider.FirstColor = System.Drawing.SystemColors.ControlDark; linCriteriaDivider.LineStyle = DevAge.Windows.Forms.LineStyle.Horizontal; linCriteriaDivider.Location = new System.Drawing.Point(grpFindCriteria.Location.Y + 6, btnSearch.Location.Y - 2); linCriteriaDivider.Name = "linCriteriaDivider"; linCriteriaDivider.SecondColor = System.Drawing.SystemColors.ControlLightLight; linCriteriaDivider.Size = new System.Drawing.Size(grpFindCriteria.Size.Width - 12, 2); grpFindCriteria.Controls.Add(linCriteriaDivider); // pnlBlankSearchResult pnlBlankSearchResult.BackColor = System.Drawing.SystemColors.ControlLightLight; pnlBlankSearchResult.Size = grdResult.Size; lblSearchInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); // lblSearchInfo this.lblSearchInfo.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblSearchInfo.ForeColor = System.Drawing.SystemColors.ControlDarkDark; lblSearchInfo.Size = grdResult.Size; lblSearchInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // remove '0' from these textboxes txtBatchNumber.NumberValueInt = null; txtMinimumAmount.NumberValueInt = null; txtMaximumAmount.NumberValueInt = null; // set button to be on the very right of the screen (can't make this work in YAML) btnClear.Location = new System.Drawing.Point(linCriteriaDivider.Location.X + linCriteriaDivider.Width - btnClear.Width, btnClear.Location.Y); // set to blank initially lblRecordCounter.Text = ""; // event fired on screen close this.Closed += new System.EventHandler(this.TFrmGLTransactionFindScreen_Closed); // catch enter on all controls, to trigger search or accept (could use this.AcceptButton, but we have several search buttons etc) this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey); // catch enter on grid to view the selected transaction this.grdResult.EnterKeyPressed += new Ict.Common.Controls.TKeyPressedEventHandler(this.BtnView_Click); // fix tab order int Temp = cmbCostCentre.TabIndex; int Temp2 = txtJournalDescription.TabIndex; cmbCostCentre.TabIndex = dtpDateFrom.TabIndex; dtpDateFrom.TabIndex = dtpDateTo.TabIndex; dtpDateTo.TabIndex = txtNarrative.TabIndex; txtNarrative.TabIndex = txtBatchDescription.TabIndex; txtBatchDescription.TabIndex = txtBatchNumber.TabIndex; txtBatchNumber.TabIndex = Temp; txtJournalDescription.TabIndex = cmbAccount.TabIndex; cmbAccount.TabIndex = Temp2; this.ActiveControl = cmbStatus; FinishButtonPanelSetup(); }
private void TFrmGLTransactionFindScreen_Closed(object sender, EventArgs e) { FGLTransactionFindObject = null; }
private void TFrmGLTransactionFindScreen_Closed(object sender, EventArgs e) { FGLTransactionFindObject = null; }