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

            List <Member> members;

            var selectedMember = (Member)lbxCommissionMembers.SelectedItem;

            try
            {
                commissionService.ExcludeMemberFromCommission(_commission.Id, selectedMember);
                members = commissionService.GetMembersOfCommission(_commission.Id);
                unitOfWork.Commit();
            }
            catch (Exception)
            {
                MessageBox.Show("Something was wrong!");
                unitOfWork.Rollback();
                return;
            }

            SetDatasourcesToNull();

            lbxMembers.DataSource           = GetMembersNonCommission(null);
            lbxCommissionMembers.DataSource = members;
        }
        private void ViewComissionMembers_Load(object sender, System.EventArgs e)
        {
            var unitOfWork        = new UnitOfWork(_context);
            var commissionService = new CommissionService(unitOfWork, unitOfWork);
            var members           = commissionService.GetMembersOfCommission(_comissionId);

            dgvComissionMembers.DataSource = members;
            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();
            }
        }