Exemplo n.º 1
0
        public void AddSubMenu(List <MySQLSchema> _SelectedFields)
        {
            stripMenu_INNER_JOIN.DropDownItems.Clear();
            stripMenu_LEFT_JOIN.DropDownItems.Clear();
            stripMenu_RIGHT_JOIN.DropDownItems.Clear();
            foreach (MySQLSchema item in _SelectedFields)
            {
                if (item.tbname.Equals(mysqlSchema.tbname) == true)
                {
                    continue;
                }
                ToolStripMenuItem subMenu = new ToolStripMenuItem();
                subMenu.Text = item.tbnick + ".(" + item.tbname + ")";

                stripMenu_INNER_JOIN.DropDownItems.Add(subMenu);
                foreach (MySQLField sqlField in item.tbfields)
                {
                    MySQLReleationShip join = new MySQLReleationShip();
                    join.ToTable = item.tbname;
                    join.ToNick  = item.tbnick;
                    join.ToField = sqlField.FieldName;

                    ToolStripMenuItem sqlMenu = new ToolStripMenuItem();
                    sqlMenu.Text   = sqlField.FieldName;
                    sqlMenu.Tag    = join;
                    sqlMenu.Click += SqlMenu_Click;
                    subMenu.DropDownItems.Add(sqlMenu);
                }
            }
        }
Exemplo n.º 2
0
 private void Uctable_AddJoin(MySQLReleationShip item)
 {
     if (_JoinList.Contains(item) == false)
     {
         _JoinList.Add(item);
     }
     BuildFrom();
 }
Exemplo n.º 3
0
        private void SqlMenu_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem  sqlMenu = (ToolStripMenuItem)sender;
            MySQLReleationShip join    = (MySQLReleationShip)sqlMenu.Tag;

            join.FromTable = mysqlSchema.tbname;
            join.FromNick  = mysqlSchema.tbnick;
            join.FromField = checkedListBox1.Items[checkedListBox1.SelectedIndex].ToString();

            AddJoin(join);
        }
Exemplo n.º 4
0
        private void toolstrip_Join_Click(object sender, EventArgs e)
        {
            if (dgv_Join.CurrentCell == null)
            {
                return;
            }
            MySQLReleationShip item = (MySQLReleationShip)dgv_Join.Rows[dgv_Join.CurrentCell.RowIndex].Cells[1].Value;

            _JoinList.Remove(item);
            BuildFrom();
        }