Beispiel #1
0
        private void ChooseGroupsForm_Load(object sender, EventArgs e)
        {
            int i = 0;

            ListGroups.Items.Clear();

            List <ScheduleGroup> Groups = DictionaryConverter.GroupsToList(ds);

            foreach (ScheduleGroup group in Groups)
            {
                ListGroups.Items.Add(group.Name);
                ListGroups.SetItemChecked(i, false);
                i++;
            }

            BindingSource bs = new BindingSource();

            bs.DataSource = ScheduleView.BasicViews;
            //  cmbProjection.DisplayMember = "Description";
            // cmbProjection.ValueMember = "TypeCode";
            //  cmbProjection.DataSource = bs;

            //  ChooseView =  (View)Convert.ToInt32(cmbProjection.SelectedValue);

            //   this.cmbProjection.SelectedIndexChanged += new EventHandler(cmbProjection_SelectedIndexChanged);
        }
Beispiel #2
0
        void cmbProjection_SelectedIndexChanged(object sender, EventArgs e)
        {
            //   View view = (View)Convert.ToInt32(cmbProjection.SelectedValue);
            //  ChooseView = view;

            List <string> names = new List <string>();

            //switch (view)
            //{
            //    case View.Group: names = adapter.NamesGroups; break;
            //    case View.Discipline: names = adapter.NamesDisciplines; break;
            //    case View.Room: names = (from r in Rooms select r.Name).Distinct().ToList(); break;
            //    case View.Teacher: names = adapter.NamesTeachers; break;
            //    default: names = new List<string>(); break;
            //}

            int i = 0;

            ListGroups.Items.Clear();
            foreach (string name in names)
            {
                ListGroups.Items.Add(name);
                ListGroups.SetItemChecked(i, true);
                i++;
            }
        }
Beispiel #3
0
        private void ChooseGroupsForm_Load(object sender, EventArgs e)
        {
            int i = 0;

            ListGroups.Items.Clear();
            foreach (string group in adapter.NamesGroups)
            {
                ListGroups.Items.Add(group);
                ListGroups.SetItemChecked(i, true);
                i++;
            }

            BindingSource bs = new BindingSource();

            bs.DataSource = ScheduleView.BasicViews;
            cmbProjection.DisplayMember = "Description";
            cmbProjection.ValueMember   = "TypeCode";
            cmbProjection.DataSource    = bs;

            ChooseView = (ScheduleClasses.View)Convert.ToInt32(cmbProjection.SelectedValue);

            this.cmbProjection.SelectedIndexChanged += new EventHandler(cmbProjection_SelectedIndexChanged);
        }