コード例 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            List <itemObjOrdered> listt2 = new List <itemObjOrdered>(listt);

            gf.SaveGroup((comboBox1.SelectedItem as itemObj).Id_o, (comboBox1.SelectedItem as itemObj).Name_o, textBox2.Text);
            foreach (itemObjOrdered it in listt)
            {
                bool del = true;
                foreach (itemObjOrdered it2 in listBox1.Items)
                {
                    if (it.Id_o == it2.Id_o)
                    {
                        del = false;
                        break;
                    }
                }
                if (del)
                {
                    gf.DeleteTableFromGroup((comboBox1.SelectedItem as itemObj).Id_o, it.Id_o);
                }
            }

            foreach (itemObjOrdered it in listBox1.Items)
            {
                bool add = true;
                foreach (itemObjOrdered it2 in listt)
                {
                    if (it.Id_o == it2.Id_o)
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    gf.MoveTableToGroup((comboBox1.SelectedItem as itemObj).Id_o, it.Id_o);
                }
            }
            for (int i = 0; i < listBox1.Items.Count; i++)
            {
                if ((listBox1.Items[i] as itemObjOrdered).order != i)
                {
                    (listBox1.Items[i] as itemObjOrdered).order = i;
                    gf.SetOrderTableInGroup((comboBox1.SelectedItem as itemObj).Id_o, (listBox1.Items[i] as itemObjOrdered).Id_o, (listBox1.Items[i] as itemObjOrdered).order);
                }
            }
            comboBox1_SelectedIndexChanged(this, null);

            var cls = new classesOfMetods();

            Program.tablegroups_info = cls.loadTablesGroupsInfo();
            Program.mainFrm1.layerItemsView1.RefreshLayers();
        }
コード例 #2
0
ファイル: TableGroup.cs プロジェクト: luckymenslife/autobase
        private void button3_Click(object sender, EventArgs e)
        {
            List <itemObj> listt2 = new List <itemObj>(listt);

            foreach (itemObj it in listt)
            {
                bool del = true;
                foreach (itemObj it2 in listBox1.Items)
                {
                    if (it.Id_o == it2.Id_o)
                    {
                        del = false;
                        break;
                    }
                }
                if (del)
                {
                    gf.DeleteTableFromGroup(it.Id_o, id);
                }
            }

            foreach (itemObj it in listBox1.Items)
            {
                bool add = true;
                foreach (itemObj it2 in listt)
                {
                    if (it.Id_o == it2.Id_o)
                    {
                        add = false;
                        break;
                    }
                }
                if (add)
                {
                    gf.MoveTableToGroup(it.Id_o, id);
                }
            }
            if (parent != null)
            {
                parent.CloseElemsAfter(this, true);
            }
        }