コード例 #1
0
ファイル: ExamsVedList.cs プロジェクト: wladengine/Foreigners
        private void btnCreateAdd_Click(object sender, EventArgs e)
        {
            if (MainClass.IsFacMain() || MainClass.IsOwner() || MainClass.IsPasha())
            {
                using (PriemEntities context = new PriemEntities())
                {
                    int?stBas = null;
                    if (cbExamVed.SelectedItem.ToString().Contains("г/б"))
                    {
                        stBas = 1;
                    }
                    else if (cbExamVed.SelectedItem.ToString().Contains("дог"))
                    {
                        stBas = 2;
                    }

                    extExamsVed ved = (from ev in context.extExamsVed
                                       where ev.Id == ExamVedId
                                       select ev).FirstOrDefault();

                    DateTime passDate = ved.Date;
                    int      examId   = ved.ExamId;

                    SelectExamCrypto frm = new SelectExamCrypto(this, StudyLevelGroupId, FacultyId, stBas, passDate, examId);
                    frm.Show();
                }
            }
        }
コード例 #2
0
ファイル: VedExamLists.cs プロジェクト: wladengine/Foreigners
        protected override void ExtraInit()
        {
            base.ExtraInit();
            Dgv.ReadOnly = 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);
                cbStudyBasis.SelectedIndex = 0;

                ComboServ.FillCombo(cbStudyForm, HelpClass.GetComboListByTable("ed.StudyForm", "ORDER BY Id"), false, true);
                cbStudyForm.SelectedIndex = 0;

                FillLicenseProgram();

                ComboServ.FillCombo(cbCompetition, HelpClass.GetComboListByTable("ed.Competition"), false, true);

                UpdateDataGrid();

                if (MainClass.IsFacMain() || MainClass.IsOwner())
                {
                    btnLists.Enabled = true;
                }
                else
                {
                    btnLists.Enabled = false;
                }
            }
        }
コード例 #3
0
        //изменение - только для супер
        private void btnChange_Click(object sender, EventArgs e)
        {
            if (ExamVedId == null || ExamVedRoomId == null)
            {
                return;
            }

            if (MainClass.IsFacMain() || MainClass.IsPasha())
            {
                ExamsVedRoomCard p = new ExamsVedRoomCard(this, ExamVedId, ExamVedRoomId);
                p.Show();
            }
        }
コード例 #4
0
        public EntryViewList()
            : base()
        {
            //this.CenterToParent();
            //this.MdiParent = MainClass.mainform;

            //this.sQuery = string.Format("SELECT DISTINCT Person.Id, {0} as Ид_номер, Person.Surname AS Фамилия, Person.Name AS Имя, Person.SecondName AS Отчество, Person.BirthDate AS Дата_рождения " +
            //                       "FROM Person INNER JOIN ExamsVedHistory ON ExamsVedHistory.PersonId = Person.Id ", MainClass.GetStringPersonNumber());

            //InitializeComponent();
            //InitControls();

            //btnPrintOrder.Visible = btnPrintOrder.Enabled = btnCancelView.Enabled = btnCancelView.Visible = false;
            btnCreate.Enabled = false;

            chbIsForeign.Enabled = false;
            chbIsForeign.Checked = true;

            if (MainClass.IsFacMain())
            {
                btnCreate.Enabled     = true;
                btnPrintOrder.Visible = btnPrintOrder.Enabled = true;
            }

            if (MainClass.IsPasha())
            {
                btnPrintOrder.Visible = btnPrintOrder.Enabled = btnCancelView.Enabled = btnCancelView.Visible = true;
                btnCreate.Enabled     = true;
            }

            if (MainClass.IsPrintOrder())
            {
                btnPrintOrder.Visible = btnPrintOrder.Enabled = true;
            }

            //// посомтреть, почему отдельные факультеты
            //if (_bdc.IsMed() || _bdc.GetFacultyId() == "9" || _bdc.GetFacultyId() == "14" || _bdc.GetFacultyId() == "20")
            //    btnCreate.Enabled = true;

            //if (_bdc.IsReadOnly())
            //    btnPrintOrder.Visible = btnPrintOrder.Enabled = true;
        }
コード例 #5
0
ファイル: ExamsVedList.cs プロジェクト: wladengine/Foreigners
        //дополнительная инициализация контролов
        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);
            }
        }
コード例 #6
0
        /// <summary>
        /// extra information for open - what smi are enabled
        /// </summary>
        /// <param name="path"></param>
        public void OpenHelp(string path)
        {
            try
            {
                bFirstRun = false;
                // убирает все IsOpen для данного пользователя
                MainClass.DeleteAllOpenByHolder();

                tsslMain.Text          = string.Format("Открыта база: Прием в СПбГУ {0} {1}; ", MainClass.sPriemYear, path);
                MainClass.dirTemplates = string.Format(@"{0}\Templates", Application.StartupPath);

                MainClass.InitQueryBuilder();

                ShowProtocolWarning();

                //предупреждение об рабочем режиме базы
                //MessageBox.Show("Уважаемые пользователи!\nСистема находится в рабочем режиме.\nВведение тестовых записей не допускается.", "Внимание");

                if (MainClass.IsOwner())
                {
                    return;
                }

                // магистратура!
                if (MainClass.dbType == PriemType.PriemMag || MainClass.dbType == PriemType.PriemForeigners)
                {
                    smiOlympAbitList.Visible     = false;
                    smiOlymps.Visible            = false;
                    smiOlymp2Competition.Visible = false;
                    smiOlymp2Mark.Visible        = false;
                }
                else
                {
                    smiOnlineChanges.Visible = false;
                    smiLoad.Visible          = false;
                }

                smiRatingList.Visible       = false;
                smiOrderNumbers.Visible     = false;
                smiOlymps.Visible           = false;
                smiCreateVed.Visible        = false;
                smiBooks.Visible            = false;
                smiCrypto.Visible           = false;
                smiFBS.Visible              = false;
                smiExport.Visible           = false;
                smiImport.Visible           = false;
                smiExamsVedRoomList.Visible = false;
                //smiProblemSolver.Visible = false;
                smiEntryView.Visible    = false;
                smiDisEntryView.Visible = false;


                smiEGEStatistics.Visible = false;
                smiDynamics.Visible      = false;
                smiFormA.Visible         = false;
                smiForm2.Visible         = false;

                smiAbitFacultyIntesection.Visible = false;
                smiRegionStat.Visible             = false;
                smiOlympStatistics.Visible        = false;

                // Разделение видимости меню
                if (MainClass.IsFacMain())
                {
                    smiOlymps.Visible                 = true;
                    smiCreateVed.Visible              = true;
                    smiExamsVedRoomList.Visible       = true;
                    smiRatingList.Visible             = true;
                    smiEntryView.Visible              = true;
                    smiDisEntryView.Visible           = true;
                    smiAbitFacultyIntesection.Visible = true;
                    smiExport.Visible                 = true;
                }

                if (MainClass.IsEntryChanger())
                {
                    smiBooks.Visible           = true;
                    smiEnterManual.Visible     = false;
                    smiRatingListPasha.Visible = false;
                    smiRatingList.Visible      = true;
                    smiExport.Visible          = true;
                }

                if (MainClass.IsPasha())
                {
                    smiCrypto.Visible       = true;
                    smiBooks.Visible        = true;
                    smiRatingList.Visible   = true;
                    smiFBS.Visible          = true;
                    smiOrderNumbers.Visible = true;
                    smiExport.Visible       = true;
                    smiEntryView.Visible    = true;
                    smiDisEntryView.Visible = true;
                    smiEnterManual.Visible  = true;
                    smiAppeal.Visible       = true;
                    smiDecryptor.Visible    = true;

                    //Паша попросил добавить себе
                    smiCreateVed.Visible        = true;
                    smiExamsVedRoomList.Visible = true;

                    smiRatingListPasha.Visible = true;

                    smiEGEStatistics.Visible = true;
                    smiDynamics.Visible      = true;
                    smiFormA.Visible         = true;
                    smiForm2.Visible         = true;

                    smiAbitFacultyIntesection.Visible = true;
                    smiRegionStat.Visible             = true;
                    smiOlympStatistics.Visible        = true;
                }

                if (MainClass.IsRectorat())
                {
                    smiEGEStatistics.Visible = true;
                    smiFormA.Visible         = true;

                    smiExport.Visible = true;

                    smiAbitFacultyIntesection.Visible = true;
                    smiRegionStat.Visible             = true;
                    smiOlympStatistics.Visible        = true;
                }

                if (MainClass.IsSovetnik() || MainClass.IsSovetnikMain())
                {
                    smiAbitFacultyIntesection.Visible = true;
                }

                if (MainClass.IsCrypto())
                {
                    smiCrypto.Visible           = true;
                    smiExamsVedRoomList.Visible = true;
                    smiAppeal.Visible           = false;
                    smiDecryptor.Visible        = false;
                    smiLoadMarks.Visible        = false;
                }

                if (MainClass.IsCryptoMain())
                {
                    smiCrypto.Visible           = true;
                    smiAppeal.Visible           = true;
                    smiExamsVedRoomList.Visible = true;

                    //глава шифровалки тоже хочет создавать ведомости
                    smiCreateVed.Visible = true;

                    smiDecryptor.Visible = false;
                    smiLoadMarks.Visible = false;
                }

                if (MainClass.IsPrintOrder())
                {
                    smiEntryView.Visible = true;
                }

                //временно
                smiImport.Visible = false;


                Form frm;
                if (MainClass._config.ValuesList.Keys.Contains("lstAbitDef"))
                {
                    bool lstAbitDef = bool.Parse(MainClass._config.ValuesList["lstAbitDef"]);

                    if (lstAbitDef)
                    {
                        frm = new ListAbit(this);
                        smiListAbit.Checked   = true;
                        smiListPerson.Checked = false;
                    }
                    else
                    {
                        if (MainClass.dbType == PriemType.PriemMag)
                        {
                            frm = new ApplicationInetList();
                        }
                        else
                        {
                            frm = new PersonInetList();
                        }

                        smiListPerson.Checked = true;
                        smiListAbit.Checked   = false;
                    }
                }
                else
                {
                    frm = new PersonInetList();
                }

                ShowProtocolWarning();

                frm.Show();
            }

            catch (Exception exc)
            {
                WinFormsServ.Error("Ошибка инициализации " + exc.Message);
            }
        }