Exemplo n.º 1
0
        public void ddlPKChangeAction(int lastIndex, List <DropDownList> ddPKList, List <DropDownList> ddFKList,
                                      List <Label> lblPKList, List <Label> lblFKList)
        {
            for (int i = 10; i > lastIndex; i--)
            {
                ddPKList[i].Items.Clear();
                ddFKList[i].Items.Clear();
                lblPKList[i].Text = String.Empty;
                lblFKList[i].Text = String.Empty;
            }

            DBQueUtils dbQueUtilsObj = new DBQueUtils();
            DBQueDao   daoObj        = new DBQueDao();

            dbQueUtilsObj.fillFKTableListForPKTable(ddPKList[lastIndex].SelectedItem.Text, ddFKList[lastIndex], ("A" + (lastIndex - 1).ToString()));
            if (ddFKList[lastIndex].Items.Count == 0)
            {
                ddPKList[lastIndex].Items.RemoveAt(ddPKList[lastIndex].SelectedIndex);
            }
            lblFKList[lastIndex].Text = ddFKList[lastIndex].SelectedValue;
            String fkColumnValue = "";

            if (ddFKList[lastIndex].SelectedItem != null && ddFKList[lastIndex].SelectedItem.Text != "" &&
                ddPKList[lastIndex].SelectedItem != null && ddPKList[lastIndex].SelectedItem.Text != "")
            {
                fkColumnValue = daoObj.getPKFKColumnValue(ddFKList[lastIndex].SelectedItem.Text,
                                                          ddPKList[lastIndex].SelectedItem.Text);
            }
            lblPKList[lastIndex].Text = ddPKList[lastIndex].SelectedItem.Value.Split(' ')[1] + "."
                                        + fkColumnValue;
        }
Exemplo n.º 2
0
        public void changeInitOfSelectTableList(DropDownList selectTableFKTableName2, Label selectTableFkColumnName2,
                                                DropDownList DropDownSelectTable1, Label selectTablePKName2, Label selectTablePkColumnName2,
                                                DropDownList DropDownFKTb2, DropDownList DropDownPKTb2, DropDownList DropDownSelectCol1, String aliasFK, String aliasPK)

        {
            fillFKTableListForPKTable(DropDownPKTb2.SelectedItem.Text, DropDownFKTb2, aliasFK);
            if (DropDownFKTb2.Items.Count == 0)
            {
                DropDownPKTb2.Items.RemoveAt(DropDownPKTb2.SelectedIndex);
            }
            fillSelectTableColumList(DropDownSelectCol1, DropDownPKTb2, aliasPK);
            if (selectTableFKTableName2.SelectedItem != null)
            {
                selectTableFkColumnName2.Text = selectTableFKTableName2.SelectedItem.Value;
            }
            else
            {
                selectTableFkColumnName2.Text = "";
            }
            selectTablePKName2.Text = DropDownSelectTable1.SelectedItem.Text;
            DBQueDao daoObj = new DBQueDao();

            if (selectTableFKTableName2.SelectedItem != null)
            {
                selectTablePkColumnName2.Text = aliasPK + "." + daoObj.getPKFKColumnValue(selectTableFKTableName2.SelectedItem.Text, DropDownPKTb2.SelectedItem.Text);//DropDownSelectTable1.SelectedValue;
            }
        }
Exemplo n.º 3
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);
            }
        }