Example #1
0
        //col the other form
        //send obj from this form
        //send the id
        //clear the combo
        //reload the combo
        //add the delegate of F3_UpdateEventHandler1 to the internal list that the UpdateEventHandler keeps track of
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            selected = Convert.ToString(comboBox2.SelectedItem).Split(':');
            edit_project obj = new edit_project(selected[0], this);

            obj.UpdateEventHandler += F3_UpdateEventHandler1;
            obj.ShowDialog();
            comboBox1.Items.Clear();
            comboBox2.Items.Clear();
            comboBox3.Items.Clear();
            comboBox4.Items.Clear();
            comboBox5.Items.Clear();

            edit_drop_list obj2  = new edit_drop_list();
            var            list  = obj2.load_drop2("[Project_id],[Project_Name]", "[dbo].[Projects]");
            int            count = 0;

            while (count < list.Count)
            {
                comboBox1.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                comboBox2.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                comboBox3.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                comboBox4.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                comboBox5.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                count++;
            }
        }
Example #2
0
        private void Resources_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'endProjectDataSet.resource' table. You can move, or remove it, as needed.
            this.resourceTableAdapter.Fill(this.endProjectDataSet.resource);
            BindData obj = new BindData();

            resourceDataGridView.DataSource = obj.BindSource("[dbo].[resource]");

            edit_drop_list obj2  = new edit_drop_list();
            var            list  = obj2.load_drop2("[resource_id],[resource name ]", "[dbo].[resource]");
            int            count = 0;

            while (count < list.Count)
            {
                comboBox2.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                comboBox3.Items.Add(list[count].IntegerData + ":" + list[count].StringData);
                count++;
            }
        }