コード例 #1
0
        public void recalc_bij_del()
        {
            taak_bepaler tb = new taak_bepaler();

            ///////////////////////////////
            if (prev_rows > 0)
            {
                for (int i = 0; i < prev_rows; i++)
                {
                    get_controls(SC_ar[i]);


                    tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                }
            }

            //////////////////////////////////////////
            for (int i = prev_rows; i < num_rows; i++)
            {
                if (!to_del[i])
                {
                    get_controls(SC_ar[i]);
                    if (cbb.SelectedIndex >= 0 || mcbb.SelectedIndex >= 0)
                    {
                        tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                    }
                }
            }
            //////////////////////////////////////////
            for (int j = 0; j < prev_rows; j++)
            {
                if (to_del[j])
                {
                    tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                }
            }
            /////////////////////////////////////////
        }
コード例 #2
0
        public void save()
        {
            taak_bepaler tb = new taak_bepaler();

            ///////////////////////////////
            if (prev_rows > 0)
            {
                for (int i = 0; i < prev_rows; i++)
                {
                    get_controls(SC_ar[i]);

                    switch (type)
                    {
                    case 1:        //proj
                        break;

                    case 2:        //bdr

                        bdr_var_row = (zeebregtsdbDataSet1.bedrijvensetvariabelRow)bdr_var_table.Rows[i];

                        if (int.Parse(mcbb.SelectedIndex.ToString()) > -1)
                        {
                            bdr_var_row.bedrijf_nr = int.Parse(mcbb.SelectedValue.ToString());
                            bdr_var_row.functie_nr = int.Parse(cbb.SelectedValue.ToString());
                            bdr_var_adapt.Update(bdr_var_row);
                        }

                        break;

                    case 3:
                        pers_var_row = (zeebregtsdbDataSet1.personensetvariabelRow)pers_var_table.Rows[i];
                        if (int.Parse(mcbb.SelectedIndex.ToString()) > -1)
                        {
                            pers_var_row.persoon_nr = int.Parse(mcbb.SelectedValue.ToString());
                            pers_var_row.functie_nr = int.Parse(cbb.SelectedValue.ToString());
                            pers_var_adapt.Update(pers_var_row);
                        }
                        break;
                    }
                    tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                }
            }

            //////////////////////////////////////////
            for (int i = prev_rows; i < num_rows; i++)
            {
                if (!to_del[i])
                {
                    get_controls(SC_ar[i]);
                    if (cbb.SelectedIndex >= 0 || mcbb.SelectedIndex >= 0)
                    {
                        switch (type)
                        {
                        case 1:    //proj
                            break;

                        case 2:    //bdr
                            bdr_var_adapt.new_var_bdr(project_nr, int.Parse(cbb.SelectedValue.ToString()), int.Parse(mcbb.SelectedValue.ToString()));
                            break;

                        case 3:    //cont
                            pers_var_adapt.new_var_pers(project_nr, int.Parse(cbb.SelectedValue.ToString()), int.Parse(mcbb.SelectedValue.ToString()));;
                            break;
                        }
                        tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                    }
                }
            }
            //////////////////////////////////////////
            for (int j = 0; j < prev_rows; j++)
            {
                if (to_del[j])
                {
                    switch (type)
                    {
                    case 1:
                        break;

                    case 2:
                        bdr_var_row = (zeebregtsdbDataSet1.bedrijvensetvariabelRow)bdr_var_table.Rows[j];
                        bdr_var_adapt.Delete_bdr_var_entry(bdr_var_row.bedrijvenset_ID);
                        break;

                    case 3:
                        pers_var_row = (zeebregtsdbDataSet1.personensetvariabelRow)pers_var_table.Rows[j];
                        pers_var_adapt.Delete_pers_var_entry(pers_var_row.personenSet_ID);
                        break;
                    }
                    tb.Recalc_function(int.Parse(mcbb.SelectedValue.ToString()), type);
                }
            }
            /////////////////////////////////////////

            refresh();
        }