Ejemplo n.º 1
0
        private void UpdateGrids()
        {
            if (_context != null)
            {
                _context = new DumaContext(Resources.ConnectionString);
            }
            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);
            var membershipService = new MembershipService(unitOfWork, unitOfWork);
            var meetingService    = new MeetingService(unitOfWork, unitOfWork);

            dgvCommissions.DataSource = null;
            dgvMembers.DataSource     = null;
            dgvMeetings.DataSource    = null;

            var members     = membershipService.GetAllMembers();
            var commissions = commissionService.GetAllCommissions();
            var meetings    = meetingService.GetAllMeetings();

            dgvCommissions.DataSource = commissions;
            dgvMembers.DataSource     = members;
            dgvMeetings.DataSource    = meetings;

            unitOfWork.Commit();
        }
Ejemplo n.º 2
0
        private void btnViewCommissions_ButtonClick(object sender, EventArgs e)
        {
            if (_context != null)
            {
                _context = new DumaContext(Resources.ConnectionString);
            }

            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);

            var commissions = commissionService.GetAllCommissions();

            dgvCommissions.DataSource = commissions;

            dgvMembers.Visible     = false;
            dgvCommissions.Visible = true;
            dgvMeetings.Visible    = false;

            unitOfWork.Commit();
        }