Ejemplo n.º 1
0
        /// <summary>
        /// Gather the values of the prompted columns.
        /// </summary>
        /// <param name="InPanel"></param>
        /// <returns></returns>
        private AcNamedValues GatherColumnValues(AcTable InPanel)
        {
            AcNamedValues ht = new AcNamedValues( );

            foreach (AcTableRow row in InPanel.Controls)
            {
                if (row.Controls.Count == 2)
                {
                    AcTableCell cell00 = (AcTableCell)row.Controls[0];
                    AcTableCell cell01 = (AcTableCell)row.Controls[1];
                    if (cell01.Controls.Count == 1)
                    {
                        string  columnValue  = null;
                        string  columnName   = cell00.Text;
                        Control entryControl = cell01.Controls[0];
                        if (entryControl is TextBox)
                        {
                            TextBox tb = (TextBox)entryControl;
                            columnValue = tb.Text;
                        }
                        else
                        {
                            DropDownList ddl = (DropDownList)entryControl;
                            columnValue = ddl.SelectedValue;
                        }
                        ht.Add(columnName, columnValue);
                    }
                }
            }
            return(ht);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gather the values of the prompted columns.
        /// </summary>
        /// <param name="InPanel"></param>
        /// <returns></returns>
        private AcNamedValues GatherColumnValues(Panel InPanel)
        {
            AcNamedValues ht          = new AcNamedValues();
            string        columnValue = null;
            string        columnName  = null;

            foreach (Control cntrl in InPanel.Controls)
            {
                if (cntrl is TextBox)
                {
                    TextBox tb = (TextBox)cntrl;
                    columnName  = tb.ID;
                    columnValue = tb.Text;
                    ht.Add(columnName, columnValue);
                }
                else if (cntrl is DropDownList)
                {
                    DropDownList ddl = (DropDownList)cntrl;
                    columnName  = ddl.ID;
                    columnValue = ddl.SelectedValue;
                    ht.Add(columnName, columnValue);
                }
            }
            return(ht);
        }