Пример #1
0
        protected override void ExtraInit()
        {
            base.ExtraInit();

            _tableName = "ed.Entry";
            _title     = "Конкурс";

            Dgv.Size          = new Size(1031, 270);
            Dgv.Location      = new Point(12, 172);
            lblCount.Location = new Point(405, 448);

            try
            {
                using (PriemEntities context = new PriemEntities())
                {
                    List <KeyValuePair <string, string> > lst = (from f in context.qFaculty
                                                                 orderby f.Acronym
                                                                 select new { f.Id, f.Name }).ToList().Select(u => new KeyValuePair <string, string>(u.Id.ToString(), u.Name)).ToList();
                    ComboServ.FillCombo(cbFaculty, lst, false, true);

                    lst = (from f in context.StudyLevel
                           orderby f.Acronym
                           select new { f.Id, f.Name }).ToList().Select(u => new KeyValuePair <string, string>(u.Id.ToString(), u.Name)).ToList();
                    ComboServ.FillCombo(cbStudyLevel, lst, false, true);

                    lst = (from f in context.StudyBasis
                           orderby f.Acronym
                           select new { f.Id, f.Name }).ToList().Select(u => new KeyValuePair <string, string>(u.Id.ToString(), u.Name)).ToList();
                    ComboServ.FillCombo(cbStudyBasis, lst, false, true);

                    lst = (from f in context.StudyForm
                           orderby f.Acronym
                           select new { f.Id, f.Name }).ToList().Select(u => new KeyValuePair <string, string>(u.Id.ToString(), u.Name)).ToList();
                    ComboServ.FillCombo(cbStudyForm, lst, false, true);

                    lst = ComboServ.GetBoolFilter();
                    ComboServ.FillCombo(cbIsReduced, lst, false, true);
                    lst = ComboServ.GetBoolFilter();
                    ComboServ.FillCombo(cbIsParallel, lst, false, true);
                    lst = ComboServ.GetBoolFilter();
                    ComboServ.FillCombo(cbIsSecond, lst, false, true);
                }
            }
            catch (Exception exc)
            {
                WinFormsServ.Error("Ошибка при инициализации формы " + exc.Message);
            }

            InitHandlers();

            btnAdd.Visible = btnRemove.Visible = false;
        }