private void ClickHandler(object sender, EventArgs e)
        {
            SimpleButton tmpButton = (SimpleButton)sender;

            selectedDescription = tmpButton.Text;

            LSRetailPosis.POSProcesses.SubcodeInfo code = SubCodes[tmpButton.TabIndex];
            selectedSubCodeId = code.SubCodeId;
            triggerCode       = code.TriggerCode;
            triggerFunction   = (int)code.TriggerFunction;
            priceType         = (int)code.PriceType;
            amountPercent     = code.AmountPercent;

            Close();
        }
        protected override void OnLoad(EventArgs e)
        {
            if (!this.DesignMode)
            {
                infoCodeData = new InfoCodeData(
                    ApplicationSettings.Database.LocalConnection,
                    ApplicationSettings.Database.DATAAREAID,
                    InfoCodes.InternalApplication);

                lblPrompt.Text = infoCodePrompt;
                DataTable infoSubCodes = infoCodeData.GetSubInfoCode(infoCodeId);
                SubCodes = new System.Collections.Generic.List <LSRetailPosis.POSProcesses.SubcodeInfo>(infoSubCodes.Rows.Count);
                button   = new SimpleButtonEx[infoSubCodes.Rows.Count];
                int buttonId = 0;

                this.tableLayoutPanel2.Controls.Clear();

                foreach (DataRow dr in infoSubCodes.Rows)
                {
                    LSRetailPosis.POSProcesses.SubcodeInfo subcode = new LSRetailPosis.POSProcesses.SubcodeInfo();
                    subcode.SubCodeId       = (string)dr["SUBCODEID"];
                    subcode.Description     = (string)dr["DESCRIPTION"];
                    subcode.TriggerFunction = (LSRetailPosis.POSProcesses.TriggerFunctionEnum)(int) dr["TRIGGERFUNCTION"];
                    subcode.TriggerCode     = (string)dr["TRIGGERCODE"];
                    subcode.PriceType       = (LSRetailPosis.POSProcesses.PriceTypeEnum)dr["PRICETYPE"];
                    subcode.AmountPercent   = (decimal)dr["AMOUNTPERCENT"];

                    SubCodes.Add(subcode);

                    newButton(buttonId++, subcode.Description);
                }

                // Show and position cancel button
                if (!inputRequired)
                {
                    this.cancelButton.Text = LSRetailPosis.ApplicationLocalizer.Language.Translate(3605);
                    this.tableLayoutPanel1.SetCellPosition(this.cancelButton, new TableLayoutPanelCellPosition(0, this.tableLayoutPanel1.RowCount - 1));
                    this.cancelButton.Visible = true;
                }
            }

            base.OnLoad(e);
        }