private void ViewComission_Load(object sender, EventArgs e)
        {
            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);

            _commission       = commissionService.GetCommissionById(_commissionId);
            tbxName.Text      = _commission.Name;
            tbxProfile.Text   = _commission.Profile.Description;
            tbxPresident.Text = _commission.President.NSP;

            unitOfWork.Commit();
        }
Example #2
0
        private void ViewMeetingComissions_Load(object sender, System.EventArgs e)
        {
            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);
            var meetingService    = new MeetingService(unitOfWork, unitOfWork);

            _commission = commissionService.GetCommissionById(_commissionId);

            Commission = String.Format("Commission name: {0}", _commission.Name);
            Profile    = String.Format("Commisiion profile name - {0}", _commission.Profile.Description);

            var meetings = meetingService.GetMeetingsForCommission(_commission);

            dgvMeetings.DataSource = meetings;

            unitOfWork.Commit();
        }
        private void AddChangeComission_Load(object sender, EventArgs e)
        {
            var unitOfWork               = new UnitOfWork(_context);
            var commissionService        = new CommissionService(unitOfWork, unitOfWork);
            var profileCommissionService = new ProfileCommissionService(unitOfWork, unitOfWork);
            var membershipService        = new MembershipService(unitOfWork, unitOfWork);

            var membersForPresident = membershipService.GetMembersForPresident();
            var profiles            = profileCommissionService.GetAllProfiles();

            if (_commissionId != 0)
            {
                _commission    = commissionService.GetCommissionById(_commissionId);
                CommissionName = _commission.Name;

                cmbxProfile.DataSource = profiles;
                if (_commission.Profile == null)
                {
                    cmbxProfile.SelectedItem = 0;
                }
                cmbxProfile.Text = _commission.Profile.Description;

                cmbxPresident.DataSource = membersForPresident;
                cmbxPresident.Text       = _commission.President.NSP;

                var membersForList    = GetMembersNonCommission(unitOfWork);
                var commissionMembers = commissionService.GetMembersOfCommission(_commission.Id);

                lbxMembers.DataSource           = membersForList;
                lbxCommissionMembers.DataSource = commissionMembers;

                unitOfWork.Commit();
            }
            else
            {
                CommissionName           = String.Empty;
                cmbxProfile.DataSource   = profiles;
                cmbxPresident.DataSource = membersForPresident;
                unitOfWork.Commit();
            }
        }