Ejemplo n.º 1
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();
            _bdc = MainClass.Bdc;

            //ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false);
            ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, false);

            cbStudyBasis.SelectedIndex = 0;
            FillStudyLevelGroup();
            FillStudyForm();
            cbStudyLevelGroup_SelectedIndexChanged(null, null);
            FillLicenseProgram();

            UpdateDataGrid();

            cbStudyLevelGroup.SelectedIndexChanged += cbStudyLevelGroup_SelectedIndexChanged;
            cbFaculty.SelectedIndexChanged         += new EventHandler(cbFaculty_SelectedIndexChanged);
            cbStudyForm.SelectedIndexChanged       += new EventHandler(cbStudyForm_SelectedIndexChanged);
            cbStudyBasis.SelectedIndexChanged      += new EventHandler(cbStudyBasis_SelectedIndexChanged);
            cbLicenseProgram.SelectedIndexChanged  += new EventHandler(cbLicenseProgram_SelectedIndexChanged);

            prh = new ProtocolRefreshHandler(UpdateDataGrid);
            MainClass.AddProtocolHandler(prh);
        }
Ejemplo n.º 2
0
        public ExamsVedCard(ExamsVedList owner, Guid?vedId)
        {
            InitializeComponent();

            _Id        = vedId;
            this.owner = owner;
            bdc        = MainClass.Bdc;

            using (PriemEntities context = new PriemEntities())
            {
                extExamsVed ved = (from vd in context.extExamsVed
                                   where vd.Id == _Id
                                   select vd).FirstOrDefault();

                this.facultyId    = ved.FacultyId;
                this.passDate     = ved.Date;
                this.isAdditional = ved.IsAdditional;
                this.examId       = ved.ExamId;
                this.studyBasisId = ved.StudyBasisId;
                this.isAddVed     = false;
                this.addCount     = 0;

                this.studyLevelGroupId = ved.StudyLevelGroupId;
            }

            InitControls();
        }
Ejemplo n.º 3
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            try
            {
                InitFocusHandlers();

                this.CenterToScreen();
                this.MdiParent = MainClass.mainform;
                _bdc           = MainClass.Bdc;
                _drh           = new DataRefreshHandler(UpdateDataGrid);
                MainClass.AddHandler(_drh);

                Dgv = dgvAbitList;

                lblCount.Text = dgvAbitList.RowCount.ToString();
                if (!MainClass.IsOwner())
                {
                    btnRemove.Visible = false;
                }

                using (PriemEntities context = new PriemEntities())
                {
                    ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, true);
                }
            }
            catch (Exception exc)
            {
                WinFormsServ.Error("Ошибка при инициализации формы " + exc.Message);
            }
        }
Ejemplo n.º 4
0
        protected override void ExtraInit()
        {
            base.ExtraInit();

            loadClass = new LoadFromInet();
            _bdcInet  = loadClass.BDCInet;

            if (MainClass.IsReadOnly())
            {
                btnLoad.Enabled = false;
            }

            btnAdd.Visible = btnCard.Visible = btnRemove.Visible = false;

            try
            {
                using (PriemEntities context = new PriemEntities())
                {
                    ComboServ.FillCombo(cbChangeType, HelpClass.GetComboListByTable("ed.ChangeType", "ORDER BY Id"), false, false);
                    ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false);
                    ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, true);

                    cbStudyBasis.SelectedIndex = 0;
                    FillLicenseProgram();
                    FillObrazProgram();
                    FillProfile();

                    UpdateDataGrid();
                }
            }
            catch (Exception exc)
            {
                WinFormsServ.Error("Ошибка при инициализации формы " + exc.Message);
            }
        }
Ejemplo n.º 5
0
        public DocsClass(int personBarcode, int?abitCommitBarcode)
        {
            _bdcInet      = new DBPriem();
            _bdcInetFiles = new DBPriem();
            try
            {
                _bdcInet.OpenDatabase(MainClass.connStringOnline);
                _bdcInetFiles.OpenDatabase(MainClass.connStringOnlineFiles);
            }
            catch (Exception exc)
            {
                WinFormsServ.Error(exc.Message);
            }

            _personId = _bdcInet.GetStringValue("SELECT Person.Id FROM Person WHERE Person.Barcode = " + personBarcode);

            if (abitCommitBarcode == null)
            {
                _abitId = null;
            }
            else
            {
                _abitId   = _bdcInet.GetStringValue("SELECT qAbiturient.Id FROM qAbiturient WHERE qAbiturient.CommitNumber = " + abitCommitBarcode);
                _commitId = _bdcInet.GetStringValue("SELECT qAbiturient.CommitId FROM qAbiturient WHERE qAbiturient.CommitNumber = " + abitCommitBarcode);
            }
        }
Ejemplo n.º 6
0
 public LoadFBS()
 {
     InitializeComponent();
     btnLoad.Enabled = true;
     rbEgeAnswerType1.CheckedChanged += new EventHandler(EnableLoadButton);
     rbEgeAnswerType2.CheckedChanged += new EventHandler(EnableLoadButton);
     bdc = MainClass.Bdc;
 }
Ejemplo n.º 7
0
        protected override void ExtraInit()
        {
            this.MdiParent = MainClass.mainform;
            _isModified    = false;
            this.CenterToParent();

            _bdc      = MainClass.Bdc;
            CardTitle = string.Empty;
        }
Ejemplo n.º 8
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            this.CenterToParent();
            InitFocusHandlers();
            this.MdiParent = MainClass.mainform;
            bdc            = MainClass.Bdc;

            FillExams();
        }
Ejemplo n.º 9
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            this.CenterToParent();
            this.MdiParent = MainClass.mainform;
            bdc            = MainClass.Bdc;

            ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.SP_Faculty"), false, false);
            FillExams();

            cbFaculty.SelectedIndexChanged += new EventHandler(cbFaculty_SelectedIndexChanged);
        }
Ejemplo n.º 10
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            this.CenterToParent();
            InitFocusHandlers();
            this.MdiParent = MainClass.mainform;
            bdc            = MainClass.Bdc;


            ComboServ.FillCombo(cbStudyLevelGroup, HelpClass.GetComboListByTable("ed.StudyLevelGroup"), false, false);
            ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis"), false, false);
        }
Ejemplo n.º 11
0
        public ExamsVedRoomCard(ExamsVedRoomList owner, Guid?vedId, Guid?vedRoomId)
        {
            InitializeComponent();

            this.vedId     = vedId;
            this.owner     = owner;
            this.vedRoomId = vedRoomId;
            bdc            = MainClass.Bdc;

            InitControls();
        }
Ejemplo n.º 12
0
 public LoadFromInet()
 {
     _bdcInet = new DBPriem();
     try
     {
         _bdcInet.OpenDatabase(MainClass.connStringOnline);
     }
     catch (Exception exc)
     {
         WinFormsServ.Error(exc.Message);
     }
 }
Ejemplo n.º 13
0
        public MainForm()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Maximized;

            SetDB();

            try
            {
                if (string.IsNullOrEmpty(MainClass.connString))
                {
                    return;
                }

                MainClass.Init(this);

                _bdc = MainClass.Bdc;


                //автоматическая проверка актуальной версии
                bwChecker = new BackgroundWorker();
                bwChecker.WorkerSupportsCancellation = true;
                bwChecker.DoWork += (sender, e) =>
                {
                    int zz = 0;
                    int treshHoldSeconds = 30;
                    //3 min
                    while (true && !e.Cancel)
                    {
                        zz++;
                        Thread.Sleep(1000);
                        if (zz >= treshHoldSeconds)
                        {
                            ((BackgroundWorker)sender).ReportProgress(0);
                            //CheckActualVersion();
                            zz = 0;
                        }
                    }
                };
                bwChecker.WorkerReportsProgress = true;
                bwChecker.ProgressChanged      += (sender, e) => { CheckActualVersion(); };

                bwChecker.RunWorkerAsync();
            }
            catch (Exception exc)
            {
                WinFormsServ.Error("Не удалось подключиться под вашей учетной записью  " + exc.Message);
                msMainMenu.Enabled = false;
            }

            CheckActualVersion();
        }
Ejemplo n.º 14
0
        public SetNewMark(LoadMarks owner, string examId, DateTime date, SortedList <string, string> slValues)
        {
            InitializeComponent();

            this.owner = owner;
            bdc        = MainClass.Bdc;

            this.passDate = date;
            this.examId   = examId;

            this.slAbits = slValues;
            InitControls();
        }
Ejemplo n.º 15
0
        private void InitControls()
        {
            this.CenterToParent();
            this.MdiParent = MainClass.mainform;
            _bdc           = MainClass.Bdc;

            _drh = new DataRefreshHandler(UpdateDataGrid);
            MainClass.AddHandler(_drh);

            Dgv = dgvChanges;

            UpdateDataGrid();
            InitHandlers();
        }
Ejemplo n.º 16
0
        protected override void ExtraInit()
        {
            base.ExtraInit();

            btnCard.Visible = btnAdd.Visible = btnRemove.Visible = false;

            loadClass = new LoadFromInet();
            _bdcInet  = loadClass.BDCInet;

            if (MainClass.IsReadOnly())
            {
                btnLoad.Enabled = false;
            }

            try
            {
                using (PriemEntities context = new PriemEntities())
                {
                    ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Name"), false, true);
                    ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, true);
                    ComboServ.FillCombo(cbStudyLevel, HelpClass.GetComboListByTable("ed.StudyLevel", "ORDER BY LevelGroupId, Name"), false, false);

                    cbStudyBasis.SelectedIndex = 0;
                    FillNationality();
                    FillLicenseProgram();
                    FillObrazProgram();
                    FillProfile();

                    UpdateDataGrid();

                    if (MainClass.IsPasha())
                    {
                        gbUpdateImport.Visible = true;
                    }
                    else
                    {
                        gbUpdateImport.Visible = false;
                    }

                    chbSelectAll.Checked = false;

                    tbAbitBarcode.Focus();
                }
            }
            catch (Exception exc)
            {
                WinFormsServ.Error("Ошибка при инициализации формы " + exc.Message);
            }
        }
Ejemplo n.º 17
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();

            this.CenterToParent();
            //this.MdiParent = MainClass.mainform;
            bdc = MainClass.Bdc;

            lblAdd.Text = string.Empty;

            using (PriemEntities context = new PriemEntities())
            {
                extExamsVed exVed = (from ev in context.extExamsVed
                                     where ev.Id == _vedId
                                     select ev).FirstOrDefault();

                _examId       = exVed.ExamId.ToString();
                _dateExam     = exVed.Date;
                _facultyId    = exVed.FacultyId.ToString();
                _studybasisId = exVed.StudyBasisId.ToString();

                lblFaculty.Text += exVed.FacultyName;

                if (exVed.StudyBasisId == null)
                {
                    lblStudyBasis.Text += "все";
                }
                else
                {
                    lblStudyBasis.Text += exVed.StudyBasisName;
                }

                lblExam.Text += exVed.ExamName;
                lblDate.Text += exVed.Date.ToShortDateString();
                if (exVed.IsAddVed)
                {
                    lblAdd.Text += "дополнительная (" + exVed.AddCount.ToString() + ")";
                }

                if (MainClass.IsCryptoMain() || MainClass.IsPasha())
                {
                    btnLoad.Visible = true;
                }
                else
                {
                    btnLoad.Visible = false;
                }
            }
        }
Ejemplo n.º 18
0
        protected virtual void InitControls()
        {
            InitFocusHandlers();

            this.Text      = Title + BaseFormsLib.Constants.CARD_READ_ONLY;
            _bdc           = MainClass.Bdc;
            this.MdiParent = MainClass.mainform;

            BindGrid(GetSource());
            SetReadOnly(true);

            ExtraInit();

            return;
        }
Ejemplo n.º 19
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();

            this.CenterToParent();
            this.MdiParent = MainClass.mainform;
            bdc            = MainClass.Bdc;

            if (!_isModified)
            {
                dgvMarks.ReadOnly = true;
                btnSave.Text      = "Изменить";
            }

            using (PriemEntities context = new PriemEntities())
            {
                lblFaculty.Text += (from f in context.SP_Faculty
                                    where f.Id == _facultyId
                                    select f.Name).FirstOrDefault();

                if (_studybasisId == null)
                {
                    lblStudyBasis.Text += "все";
                }
                else
                {
                    lblStudyBasis.Text += (from f in context.StudyBasis
                                           where f.Id == _studybasisId
                                           select f.Name).FirstOrDefault();
                }

                var exam = (from e in context.Exam
                            join en in context.ExamName
                            on e.ExamNameId equals en.Id
                            where e.Id == _examId
                            select new
                {
                    e.IsAdditional,
                    en.Name
                }).FirstOrDefault();

                _isAdditional = exam.IsAdditional;
                lblExam.Text += exam.Name;
            }
        }
Ejemplo n.º 20
0
        public ExamsVedCard(ExamsVedList owner, int?StudyLevelGroupId, int?facId, int?examId, DateTime date, int?basisId, bool isAdd)
        {
            InitializeComponent();

            _Id        = null;
            this.owner = owner;
            bdc        = MainClass.Bdc;

            this.facultyId         = facId;
            this.passDate          = date;
            this.examId            = examId;
            this.studyBasisId      = basisId;
            this.isAddVed          = isAdd;
            this.studyLevelGroupId = StudyLevelGroupId;

            using (PriemEntities context = new PriemEntities())
            {
                if (isAddVed)
                {
                    addCount = (from vd in context.extExamsVed
                                where vd.ExamId == examId && vd.Date == passDate.Date &&
                                vd.FacultyId == facultyId && vd.StudyLevelGroupId == studyLevelGroupId &&
                                (studyBasisId != null ? vd.StudyBasisId == studyBasisId : true == true)
                                select vd.AddCount).Max();

                    if (addCount == null)
                    {
                        addCount = 0;
                    }

                    addCount++;
                }
                else
                {
                    addCount = 0;
                }

                isAdditional = (from vd in context.extExamsVed
                                where vd.ExamId == examId
                                select vd.IsAdditional).FirstOrDefault();
            }

            InitControls();
        }
Ejemplo n.º 21
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();

            this.CenterToScreen();
            this.MdiParent = MainClass.mainform;
            _bdc           = MainClass.Bdc;
            _drh           = new DataRefreshHandler(UpdateDataGrid);
            MainClass.AddHandler(_drh);

            Dgv = dgvAbitList;

            lblCount.Text = dgvAbitList.RowCount.ToString();

            using (PriemEntities context = new PriemEntities())
            {
                ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, true);
            }
        }
Ejemplo n.º 22
0
        //дополнительная инициализация
        private void InitItems()
        {
            this.CenterToParent();
            this.MdiParent = MainClass.mainform;

            _bdc = MainClass.Bdc;

            if (MainClass.IsPasha())
            {
                ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.SP_Faculty"), false, true);
            }
            else
            {
                ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.SP_Faculty"), false, false);
            }

            btnStart.Enabled = false;
            btnMetro.Enabled = false;
        }
Ejemplo n.º 23
0
        //конструтор
        public Filters(FormFilter la, DBPriem bdc, List <iFilter> list)
        {
            InitializeComponent();

            _bdc   = bdc;
            _owner = la;

            FillFilters();

            if (list != null)
            {
                foreach (iFilter obj in list)
                {
                    flag = true;
                    AddInList(obj);
                }
                lbFilters.SelectedIndex = 0;
            }
        }
Ejemplo n.º 24
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();
            _bdc      = MainClass.Bdc;
            forUpdate = false;

            ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false);
            ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, false);

            cbStudyBasis.SelectedIndex = 0;
            FillStudyForm();
            FillLicenseProgram();

            UpdateDataGrid();

            cbFaculty.SelectedIndexChanged        += new EventHandler(cbFaculty_SelectedIndexChanged);
            cbStudyForm.SelectedIndexChanged      += new EventHandler(cbStudyForm_SelectedIndexChanged);
            cbStudyBasis.SelectedIndexChanged     += new EventHandler(cbStudyBasis_SelectedIndexChanged);
            cbLicenseProgram.SelectedIndexChanged += new EventHandler(cbLicenseProgram_SelectedIndexChanged);
        }
Ejemplo n.º 25
0
        protected override void ExtraInit()
        {
            this.CenterToParent();
            this.MdiParent = MainClass.mainform;
            _bdc           = MainClass.Bdc;

            _drh = new DataRefreshHandler(UpdateDataGrid);
            MainClass.AddHandler(_drh);

            Dgv.ReadOnly                = true;
            Dgv.AllowUserToAddRows      = Dgv.AllowUserToDeleteRows = false;
            Dgv.CellDoubleClick        += new System.Windows.Forms.DataGridViewCellEventHandler(Dgv_CellDoubleClick);
            Dgv.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(Dgv_ColumnHeaderMouseClick);

            if (MainClass.IsOwner())
            {
                btnRemove.Visible = true;
            }
            else
            {
                btnRemove.Visible = false;
            }
        }
Ejemplo n.º 26
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();
            bdc = MainClass.Bdc;

            try
            {
                if (MainClass.IsCrypto() || MainClass.IsPasha())
                {
                    btnCreateCsv.Visible = true;
                }
                else
                {
                    btnCreateCsv.Visible = false;
                }

                using (PriemEntities context = new PriemEntities())
                {
                    ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false);
                    ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, true);

                    UpdateVedList();
                    UpdateVedRoomList();

                    UpdateDataGrid();

                    cbFaculty.SelectedIndexChanged     += new EventHandler(cbFaculty_SelectedIndexChanged);
                    cbStudyBasis.SelectedIndexChanged  += new EventHandler(cbStudyBasis_SelectedIndexChanged);
                    cbExamVed.SelectedIndexChanged     += new EventHandler(cbExamVed_SelectedIndexChanged);
                    cbExamVedRoom.SelectedIndexChanged += new EventHandler(cbExamVedRoom_SelectedIndexChanged);
                }
            }
            catch (Exception ex)
            {
                WinFormsServ.Error("Ошибка при инициализации формы ведомостей: " + ex.Message);
            }
        }
Ejemplo n.º 27
0
        //конструктор
        public Columns(FormFilter owner, string facId)
        {
            InitializeComponent();
            this.CenterToParent();
            own         = owner;
            _fac        = facId;
            _bdc        = MainClass.Bdc;
            _columnList = FillColumns();

            foreach (DataGridViewColumn col in own.Dgv.Columns)
            {
                if (col.Visible)
                {
                    try
                    {
                        lbYes.Items.Add(_columnList[col.Name]);
                    }
                    catch { }
                }
            }


            foreach (string li in _columnList.Values)
            {
                try
                {
                    if (!lbYes.Items.Contains(li))
                    {
                        lbNo.Items.Add(li);
                    }
                }
                catch
                {
                }
            }
        }
Ejemplo n.º 28
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();
            bdc = MainClass.Bdc;

            try
            {
                btnDeleteFromVed.Visible = btnDeleteFromVed.Enabled = false;
                btnUnload.Visible        = btnUnload.Enabled = false;

                //наверное нужно писать права по отдельным группам. Чуть больше, зато на порядок понятнее. И чтобы "левых" вставок не было
                //Паше наклейки печатать нельзя??? Непорядок!!!
                if (MainClass.IsFacMain())
                {
                    btnCreate.Visible = true;
                    btnChange.Visible = true;
                    btnDelete.Visible = false;

                    tbCountCell.Visible     = false;
                    lblCountCell.Visible    = false;
                    btnLock.Visible         = false;
                    btnCreateAdd.Visible    = true;
                    btnPrintSticker.Visible = false;
                }
                else if (MainClass.IsCryptoMain() || MainClass.IsPasha())
                {
                    btnCreate.Visible = false;
                    btnChange.Visible = false;
                    btnDelete.Visible = false;

                    tbCountCell.Visible     = true;
                    lblCountCell.Visible    = true;
                    btnLock.Visible         = true;
                    btnCreateAdd.Visible    = true;
                    btnPrintSticker.Visible = true;
                }
                else if (MainClass.IsPasha())
                {
                    btnDelete.Visible        = true;
                    btnChange.Visible        = true;
                    btnDeleteFromVed.Visible = btnDeleteFromVed.Enabled = true;
                    btnUnload.Visible        = btnUnload.Enabled = true;
                }
                else
                {
                    btnCreate.Visible = false;
                    btnChange.Visible = false;
                    btnDelete.Visible = false;

                    tbCountCell.Visible     = false;
                    lblCountCell.Visible    = false;
                    btnLock.Visible         = false;
                    btnCreateAdd.Visible    = false;
                    btnPrintSticker.Visible = false;
                }

                if (MainClass.IsOwner())
                {
                    btnCreate.Visible       = true;
                    btnChange.Visible       = true;
                    btnDelete.Visible       = true;
                    tbCountCell.Visible     = true;
                    lblCountCell.Visible    = true;
                    btnLock.Visible         = true;
                    btnCreateAdd.Visible    = true;
                    btnPrintSticker.Visible = true;
                }

                //по умолчанию печатается 2 штрих-кода
                tbCountCell.Text = (2).ToString();

                using (PriemEntities context = new PriemEntities())
                {
                    ComboServ.FillCombo(cbStudyLevelGroup, HelpClass.GetComboListByTable("ed.StudyLevelGroup", ""), false, false);
                    ComboServ.FillCombo(cbFaculty, HelpClass.GetComboListByTable("ed.qFaculty", "ORDER BY Acronym"), false, false);
                    ComboServ.FillCombo(cbStudyBasis, HelpClass.GetComboListByTable("ed.StudyBasis", "ORDER BY Name"), false, true);

                    UpdateVedList();
                    UpdateDataGrid();

                    cbFaculty.SelectedIndexChanged    += new EventHandler(cbFaculty_SelectedIndexChanged);
                    cbStudyBasis.SelectedIndexChanged += new EventHandler(cbStudyBasis_SelectedIndexChanged);
                    cbExamVed.SelectedIndexChanged    += new EventHandler(cbExamVed_SelectedIndexChanged);
                }
            }
            catch (Exception ex)
            {
                WinFormsServ.Error("Ошибка при инициализации формы ведомостей: " + ex.Message);
            }
        }
Ejemplo n.º 29
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            loadClass = new LoadFromInet();
            bdcInet   = loadClass.BDCInet;

            int fileNum = 0;

            string barcText = tbPersonNum.Text.Trim();

            if (barcText == string.Empty)
            {
                WinFormsServ.Error("Не введен номер");
                return;
            }

            //if (barcText.Length == 7)
            //{
            //    if (barcText.StartsWith("2"))
            //    {
            //        WinFormsServ.Error("Выбран человек, подавший заявления в магистратуру");
            //        return;
            //    }

            //    barcText = barcText.Substring(1);
            //}

            if (!int.TryParse(barcText, out fileNum))
            {
                WinFormsServ.Error("Неправильно введен номер");
                return;
            }

            if (MainClass.CheckPersonBarcode(fileNum))
            {
                try
                {
                    //extPerson person = loadClass.GetPersonByBarcode(fileNum);
                    DataTable dtEge = new DataTable();

                    //if(person != null)
                    //{
                    //    string queryEge = "SELECT EgeMark.Id, EgeMark.EgeExamNameId AS ExamId, EgeMark.Value, EgeCertificate.PrintNumber, EgeCertificate.Number, EgeMark.EgeCertificateId FROM EgeMark LEFT JOIN EgeCertificate ON EgeMark.EgeCertificateId = EgeCertificate.Id LEFT JOIN Person ON EgeCertificate.PersonId = Person.Id";
                    //    DataSet dsEge = bdcInet.GetDataSet(queryEge + " WHERE Person.Barcode = " + fileNum + " ORDER BY EgeMark.EgeCertificateId ");
                    //    dtEge = dsEge.Tables[0];
                    //}

                    CardFromInet crd = new CardFromInet(fileNum, null, true);
                    crd.ToUpdateList += UpdateDataGrid;
                    crd.Show();
                }
                catch (Exception exc)
                {
                    WinFormsServ.Error(exc.Message);
                    tbPersonNum.Text = "";
                    tbPersonNum.Focus();
                }
            }
            else
            {
                UpdateDataGrid();
                using (PriemEntities context = new PriemEntities())
                {
                    extPersonAll person = (from per in context.extPersonAll
                                           where per.Barcode == fileNum
                                           select per).FirstOrDefault();

                    string fio    = person.FIO;
                    string num    = person.PersonNum;
                    string persId = person.Id.ToString();

                    WinFormsServ.Search(this.dgvAbiturients, "PersonNum", num);
                    DialogResult dr = MessageBox.Show(string.Format("Абитуриент {0} с данным номером баркода уже импортирован в базу.\nОткрыть карточку абитуриента?", fio), "Внимание", MessageBoxButtons.YesNo);
                    if (dr == System.Windows.Forms.DialogResult.Yes)
                    {
                        MainClass.OpenCardPerson(persId, this, null);
                    }
                }
            }

            tbPersonNum.Text = "";
            tbPersonNum.Focus();
            loadClass.CloseDB();
        }
Ejemplo n.º 30
0
        //дополнительная инициализация контролов
        private void InitControls()
        {
            InitFocusHandlers();

            this.CenterToParent();
            //this.MdiParent = MainClass.mainform;
            bdc = MainClass.Bdc;

            slReplaceMark = new SortedList <string, string>();
            slNewMark     = new SortedList <string, string>();

            dgvMarks.ReadOnly = true;

            lblAdd.Text = string.Empty;

            using (PriemEntities context = new PriemEntities())
            {
                extExamsVed exVed = (from ev in context.extExamsVed
                                     where ev.Id == _vedId
                                     select ev).FirstOrDefault();

                _isAdditional = exVed.IsAddVed;
                _examId       = exVed.ExamId.ToString();
                _dateExam     = exVed.Date;
                _facultyId    = exVed.FacultyId.ToString();
                _studybasisId = exVed.StudyBasisId.ToString();
                _vedNum       = exVed.Number.ToString();

                lblFaculty.Text += exVed.FacultyName;

                if (exVed.StudyBasisId == null)
                {
                    lblStudyBasis.Text += "все";
                }
                else
                {
                    lblStudyBasis.Text += exVed.StudyBasisName;
                }

                lblExam.Text += exVed.ExamName;
                lblDate.Text += exVed.Date.ToShortDateString();
                if (exVed.IsAddVed)
                {
                    lblAdd.Text += "дополнительная (" + exVed.AddCount.ToString() + ")";
                }

                btnPrintVed.Enabled = false;

                if (exVed.IsLoad)
                {
                    _isLoad             = true;
                    dgvMarks.ReadOnly   = true;
                    lblIsLoad.Text      = "Загружена";
                    btnPrintVed.Enabled = true;
                }

                if ((MainClass.IsCryptoMain() || MainClass.IsPasha()) && !exVed.IsLoad)
                {
                    btnLoad.Visible = true;
                }
                else
                {
                    btnLoad.Visible = false;
                }

                if (MainClass.IsPasha())
                {
                    btnPrintVed.Enabled = true;
                }

                btnDoubleLanguage.Visible = false;//MainClass.IsPasha();
            }
        }