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

            string sFilter = string.Empty;

            sFilter = string.Format(" AND ed.extProtocol.Excluded=0 AND ed.extProtocol.ISOld=0 AND extProtocol.ProtocolTypeId=1 AND extProtocol.FacultyId ={0} AND extProtocol.StudyFormId = {1} AND extProtocol.StudyBasisId = {2} ",
                                    _facultyId.ToString(), _studyFormId.ToString(), _studyBasisId.ToString());

            if (!MainClass.RightsSov_SovMain())
            {
                sFilter += " AND ed.extAbit.CompetitionId NOT IN (1,2,7,8) ";
            }
            FillGrid(dgvRight, sQuery, GetWhereClause("ed.extAbit") + sFilter, sOrderby);

            //заполнили левый
            if (_id != null)
            {
                sFilter = string.Format(" WHERE ed.extAbit.Id IN (SELECT AbiturientId FROM ed.extProtocol WHERE ProtocolId = '{0}')", _id);
                FillGrid(dgvLeft, sQuery, sFilter, sOrderby);
            }
            else //новый
            {
                InitGrid(dgvLeft);
            }
        }