예제 #1
0
        protected void ddlWhere_SelectedColumnChanged(object sender, EventArgs e)
        {
            DBQueUtils          dbQueUtilsObj              = new DBQueUtils();
            int                 lastIndex                  = dbQueUtilsObj.getIndexOfDDList(sender) - 1;
            List <DropDownList> ddWhereTableList           = getListOfWhereTables();
            List <DropDownList> ddWhereColumnList          = getListOfWhereColumns();
            List <DropDownList> ddWhereColumnValueList     = getListOfWhereColumnValues();
            List <Label>        lblWhereSelectedColumnList = getListOfWhereSelectedIdList();

            dbQueUtilsObj.fillSelectedColumnValues(ddWhereTableList[lastIndex], ddWhereColumnList[lastIndex], ddWhereColumnValueList[lastIndex]);
            if (ddWhereColumnValueList[lastIndex] != null && ddWhereColumnValueList[lastIndex].SelectedItem != null)
            {
                lblWhereSelectedColumnList[lastIndex].Text = ddWhereColumnValueList[lastIndex].SelectedItem.Value;
            }
            else
            {
                lblWhereSelectedColumnList[lastIndex].Text = "";
            }
        }
예제 #2
0
        protected void ddlWhere_SelectedIndexChanged(object sender, EventArgs e)
        {
            DBQueUtils          dbQueUtilsObj              = new DBQueUtils();
            int                 lastIndex                  = dbQueUtilsObj.getIndexOfDDList(sender) - 1;
            List <DropDownList> ddWhereTableList           = getListOfWhereTables();
            List <DropDownList> ddWhereColumnsList         = getListOfWhereColumns();
            List <DropDownList> ddWhereColumnValueList     = getListOfWhereColumnValues();
            List <Label>        lblSelectedColumnIdList    = getListOfWhereSelectedIdList();
            List <Label>        lblPKColumnList            = getListOfPkColumnList();
            List <CheckBox>     cbAskUserList              = getListOfAskUsers();
            List <TextBox>      txbBxHeadingWhereTableList = getListOfHeadingWhereTable();

            if (ddWhereTableList[lastIndex].SelectedValue != "")
            {
                dbQueUtilsObj.fillSelectTableColumList(ddWhereColumnsList[lastIndex], ddWhereTableList[lastIndex], ddWhereTableList[lastIndex].SelectedValue);
                dbQueUtilsObj.fillSelectedColumnValues(ddWhereTableList[lastIndex], ddWhereColumnsList[lastIndex], ddWhereColumnValueList[lastIndex]);
                if (ddWhereColumnValueList[lastIndex] != null && ddWhereColumnValueList[lastIndex].SelectedItem != null)
                {
                    lblSelectedColumnIdList[lastIndex].Text = ddWhereColumnValueList[lastIndex].SelectedItem.Value;
                }
                else
                {
                    lblSelectedColumnIdList[lastIndex].Text = "";
                }
                DBQueDao dbQueDaoObj = new DBQueDao();
                String   pkColName   = dbQueDaoObj.getPKColumnByTableName(ddWhereTableList[lastIndex].SelectedItem.Text);
                lblPKColumnList[lastIndex].Text = ddWhereTableList[lastIndex].SelectedValue + "." + pkColName;
            }
            else
            {
                //do empty other dropdowns and fields
                ddWhereColumnsList[lastIndex].Items.Clear();
                cbAskUserList[lastIndex].Checked = false;
                ddWhereColumnValueList[lastIndex].Items.Clear();
                lblSelectedColumnIdList[lastIndex].Text    = "";
                lblPKColumnList[lastIndex].Text            = "";
                txbBxHeadingWhereTableList[lastIndex].Text = "";
            }
        }