示例#1
0
        protected void ddlWhere_SelectedColumnValueChanged(object sender, EventArgs e)
        {
            DBQueUtils          dbQueUtilsObj              = new DBQueUtils();
            int                 lastIndex                  = dbQueUtilsObj.getIndexOfDDList(sender) - 1;
            List <DropDownList> ddWhereColumnValueList     = getListOfWhereColumnValues();
            List <Label>        lblWhereSelectedColumnList = getListOfWhereSelectedIdList();

            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 = "";
            }
        }
示例#3
0
        protected void ddlProgram_SelectedIndexChangedPKTable(object sender, EventArgs e)
        {
            DBQueUtils          dbQueUtilsObj = new DBQueUtils();
            int                 lastIndex     = dbQueUtilsObj.getIndexOfDDList(sender);
            bool                emptySelected = ((DropDownList)sender).SelectedValue == String.Empty ? true : false;
            List <DropDownList> ddPKList      = new List <DropDownList>();

            ddPKList.Add(new DropDownList());
            ddPKList.Add(new DropDownList());
            ddPKList.Add(new DropDownList());
            ddPKList.Add(DropDownPKTb3);
            ddPKList.Add(DropDownPKTb4);
            ddPKList.Add(DropDownPKTb5);
            ddPKList.Add(DropDownPKTb6);
            ddPKList.Add(DropDownPKTb7);
            ddPKList.Add(DropDownPKTb8);
            ddPKList.Add(DropDownPKTb9);
            ddPKList.Add(DropDownPKTb10);

            List <DropDownList> ddFKList = new List <DropDownList>();

            ddFKList.Add(new DropDownList());
            ddFKList.Add(new DropDownList());
            ddFKList.Add(new DropDownList());
            ddFKList.Add(DropDownFKTb3);
            ddFKList.Add(DropDownFKTb4);
            ddFKList.Add(DropDownFKTb5);
            ddFKList.Add(DropDownFKTb6);
            ddFKList.Add(DropDownFKTb7);
            ddFKList.Add(DropDownFKTb8);
            ddFKList.Add(DropDownFKTb9);
            ddFKList.Add(DropDownFKTb10);

            List <Label> lblPKList = new List <Label>();

            lblPKList.Add(new Label());
            lblPKList.Add(new Label());
            lblPKList.Add(new Label());
            lblPKList.Add(PKCol3);
            lblPKList.Add(PKCol4);
            lblPKList.Add(PKCol5);
            lblPKList.Add(PKCol6);
            lblPKList.Add(PKCol7);
            lblPKList.Add(PKCol8);
            lblPKList.Add(PKCol9);
            lblPKList.Add(PKCol10);

            List <Label> lblFKList = new List <Label>();

            lblFKList.Add(new Label());
            lblFKList.Add(new Label());
            lblFKList.Add(new Label());
            lblFKList.Add(FKCol3);
            lblFKList.Add(FKCol4);
            lblFKList.Add(FKCol5);
            lblFKList.Add(FKCol6);
            lblFKList.Add(FKCol7);
            lblFKList.Add(FKCol8);
            lblFKList.Add(FKCol9);
            lblFKList.Add(FKCol10);

            dbQueUtilsObj.ddlPKChangeAction(lastIndex, ddPKList, ddFKList, lblPKList, lblFKList);

            if (emptySelected == false)
            {
                changeOfPKFKTable(lastIndex);
            }
        }
示例#4
0
        protected void ddlProgram_SelectedIndexChangedFKTable(object sender, EventArgs e)
        {
            FKCol2.Text = DropDownFKTb2.SelectedItem.Value;
            DBQueDao   daoObj        = new DBQueDao();
            DBQueUtils dbQueUtilsObj = new DBQueUtils();

            PKCol2.Text = DropDownPKTb2.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb2.SelectedItem.Text, DropDownPKTb2.SelectedItem.Text);
            int lastIndex = dbQueUtilsObj.getIndexOfDDList(sender);

            changeOfPKFKTable(lastIndex);
            if (lastIndex == 2)
            {
                PKCol3.Text = String.Empty;
                DropDownFKTb3.Items.Clear();
                FKCol3.Text = String.Empty;
            }

            if (lastIndex == 3)
            {
                FKCol3.Text = DropDownFKTb3.SelectedValue;
                PKCol3.Text = DropDownPKTb3.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb3.SelectedItem.Text, DropDownPKTb3.SelectedItem.Text);
            }
            if (lastIndex == 4)
            {
                FKCol4.Text = DropDownFKTb4.SelectedValue;
                PKCol4.Text = DropDownPKTb4.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb4.SelectedItem.Text, DropDownPKTb4.SelectedItem.Text);
            }
            if (lastIndex == 5)
            {
                FKCol5.Text = DropDownFKTb5.SelectedValue;
                PKCol5.Text = DropDownPKTb5.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb5.SelectedItem.Text, DropDownPKTb5.SelectedItem.Text);
            }
            if (lastIndex == 6)
            {
                FKCol6.Text = DropDownFKTb6.SelectedValue;
                PKCol6.Text = DropDownPKTb6.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb6.SelectedItem.Text, DropDownPKTb6.SelectedItem.Text);
            }
            if (lastIndex == 7)
            {
                FKCol7.Text = DropDownFKTb7.SelectedValue;
                PKCol7.Text = DropDownPKTb7.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb7.SelectedItem.Text, DropDownPKTb7.SelectedItem.Text);
            }
            if (lastIndex == 8)
            {
                FKCol8.Text = DropDownFKTb8.SelectedValue;
                PKCol8.Text = DropDownPKTb8.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb8.SelectedItem.Text, DropDownPKTb8.SelectedItem.Text);
            }
            if (lastIndex == 9)
            {
                FKCol9.Text = DropDownFKTb9.SelectedValue;
                PKCol9.Text = DropDownPKTb9.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb9.SelectedItem.Text, DropDownPKTb9.SelectedItem.Text);
            }
            if (lastIndex == 10)
            {
                FKCol10.Text = DropDownFKTb10.SelectedValue;
                PKCol10.Text = DropDownPKTb10.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb10.SelectedItem.Text, DropDownPKTb10.SelectedItem.Text);
            }
            if (lastIndex == 11)
            {
                FKCol11.Text = DropDownFKTb11.SelectedValue;
                PKCol11.Text = DropDownPKTb11.SelectedItem.Value.Split(' ')[1] + "." + daoObj.getPKFKColumnValue(DropDownFKTb11.SelectedItem.Text, DropDownPKTb11.SelectedItem.Text);
            }
        }