Example #1
0
        // закрытие части полей в зависимости от прав
        protected override void SetReadOnlyFields()
        {
            if (MainClass.RightsFaculty())
            {
                tbName.Enabled       = false;
                tbSurname.Enabled    = false;
                tbSecondName.Enabled = false;

                dtBirthDate.Enabled = false;

                cbPassportType.Enabled   = false;
                tbPassportAuthor.Enabled = false;
                tbPassportNumber.Enabled = false;
                tbPassportSeries.Enabled = false;
                dtPassportDate.Enabled   = false;

                tbAttestatRegion.Enabled = false;
                tbAttestatNum.Enabled    = false;
                cbAttestatSeries.Enabled = false;

                //tbDiplomNum.Enabled = false;
                //tbDiplomSeries.Enabled = false;

                gbPrivileges.Enabled = false;

                //временная добавка, ибо очень уж просили
                btnAttMarks.Enabled = true;
            }

            if (inEnableProtocol && MainClass.RightsFaculty())
            {
                SetAllFieldsNotEnabled();

                tbMobiles.Enabled    = true;
                gbStag.Enabled       = true;
                gbPersonInfo.Enabled = true;

                tbDiplomNum.Enabled    = true;
                tbDiplomSeries.Enabled = true;

                btnSaveChange.Enabled = true;
                btnClose.Enabled      = true;
                btnAddAbit.Enabled    = true;

                //попросили, чтобы можно было добавлять даже зачисленным в протокол о допуске
                gbEduc.Enabled      = true;
                btnAttMarks.Enabled = true;
            }

            if (inEnableProtocol && MainClass.RightsSov_SovMain_FacMain())
            {
                tbName.Enabled       = false;
                tbSurname.Enabled    = false;
                tbSecondName.Enabled = false;

                dtBirthDate.Enabled = false;

                cbPassportType.Enabled   = false;
                tbPassportAuthor.Enabled = false;
                tbPassportNumber.Enabled = false;
                tbPassportSeries.Enabled = false;
                dtPassportDate.Enabled   = false;

                tbAttestatRegion.Enabled = false;
                tbAttestatNum.Enabled    = false;
                cbAttestatSeries.Enabled = false;

                //tbDiplomNum.Enabled = false;
                //tbDiplomSeries.Enabled = false;

                gbPrivileges.Enabled = false;
            }

            // закрываем для создания новых для уже зачисленных
            if (inEntryView)
            {
                btnAddAbit.Enabled     = false;
                chbIsExcellent.Enabled = false;
                tbSchoolAVG.Enabled    = false;
            }
        }
Example #2
0
 protected override bool IsForReadOnly()
 {
     return(!MainClass.RightsToEditCards());
 }