Esempio n. 1
0
        public List<ViewConference> GetConferences(ConferenceFilter filter)
        {
            IQueryable<ViewConference> conf = db.ViewConferences;

            /*
             * 1) conference
             * 2) subject
             * 3) theme
             *
             * */

            conf = GetViewConferences(filter.conference, conf);
            conf = GetCountry(filter.country, conf);
            conf = GetAddresses(filter.address, conf);

            if (filter.withDate)
            {
                conf = GetDate(filter.date.Date, conf);
            }

            return conf.ToList();
        }
        private void initData()
        {
            conferenceController = new ConferenceController(dataFormDTO.db);
            filter = new ConferenceFilter();

            conferenceCrud = new ConferenceCrud(dataFormDTO.db);

            formDTO          = new CUConferenceFormDTO();
            formDTO.contex   = dataFormDTO.db;
            formDTO.obj      = new conference();
            formDTO.userData = dataFormDTO.userData;

            CheckBoxDataInit dataInit = new CheckBoxDataInit(dataFormDTO.db);

            filter.date = DateTime.Now;
            dataInit.addConferences(cbConference);
            dataInit.addAddresses(cbAddress);
            dataInit.addCountries(cbCountry);

            if (!(dataFormDTO.userData.userRole == UserRole.ADMIN ||
                  dataFormDTO.userData.userRole == UserRole.CONFERENCE_MANAGER))
            {
                AddConferenceButton.Visible = false;

                updButton.Visible = false;
                delButton.Visible = false;
            }
            else
            {
                AddConferenceButton.Visible = true;

                updButton.Visible = true;
                delButton.Visible = true;
            }

            //dataGridView1.DataSource = db.ViewConferences.ToList();
        }