Пример #1
0
        public MemberCheckIn(MainForm mainForm, TabControl tabControl, member member)
        {
            InitializeComponent();
            this.mainForm   = mainForm;
            this.tabControl = tabControl;
            this.member     = member;
            //Show user informations
            lblLoginMemberFirstName.Text  = member.first_name;
            lblLoginMemberLastName.Text   = member.last_name;
            lblLoginMemberAttendance.Text = AttendanceDAO.getLastById(member.member_id);

            String loginSuccessText;
            Image  loginSuccessImage;

            setMemberLoginStatus(member, out loginSuccessText, out loginSuccessImage);

            lblLoginStatus.Text         = loginSuccessText;
            pictureBoxLoginStatus.Image = loginSuccessImage;

            if (String.IsNullOrEmpty(member.profile_picture))
            {
                pictureBoxMemberProfileImage.Image = Properties.Resources.user;
            }
            else
            {
                pictureBoxMemberProfileImage.Image = Image.FromFile(member.profile_picture);
            }
        }
Пример #2
0
        public void displayMemberInfo(member member)
        {
            panelNoMemberSelected.Hide();
            lblAddEducationLevelError.Text        = "";
            lblFirstNameProfileView.Text          = member.first_name;
            lblLastNameProfileView.Text           = member.last_name;
            lblBirthDateProfileView.Text          = String.Format("{0:dd.MM.yyyy}", member.birth_date);
            lblAddressProfileView.Text            = member.address;
            lblSexProfileView.Text                = member.sex;
            lblPhoneNumberProfileView.Text        = member.phone_number;
            lblEmailProfileView.Text              = member.email;
            lblRegistrationDateProfileView.Text   = String.Format("{0:dd.MM.yyyy}", member.registration_date);
            lblMembershipTypeProfileView.Text     = MembershipTypeDAO.getById(member.membership_type_id).name;
            lblFirstAndLastNameAttendance.Text    = member.first_name + " " + member.last_name;
            lblFirstAndLastNameMembershipFee.Text = member.first_name + " " + member.last_name;
            lblFirstAndLastNameEducation.Text     = member.first_name + " " + member.last_name;
            lblMeberIdProfileView.Text            = member.member_id.ToString();

            if (String.IsNullOrEmpty(member.profile_picture))
            {
                pictureBoxProfilePicture.Image = Properties.Resources.user;
            }
            else
            {
                pictureBoxProfilePicture.Image = Image.FromFile(member.profile_picture);
            }
            var lastAttendance = AttendanceDAO.getLastById(member.member_id);

            lblLastAttendance.Text = lastAttendance;

            populateCalendar(member.member_id);

            //You can pay for the month three days before
            var payingMonth = DateTime.Now.AddDays(3).Month;
            var payingYear  = DateTime.Now.AddDays(3).Year;

            comboBoxMonthMembershipFee.SelectedIndex = 0;
            comboBoxYearMembershipFee.SelectedIndex  = 0;

            populateMembershipFeeStatistic();
            var memberEducations = MemberEducationDAO.getById(member.member_id);

            comboBoxEducationLevel4.Items.Clear();
            comboBoxEducationLevel3.Items.Clear();
            comboBoxEducationLevel2.Items.Clear();
            comboBoxEducationLevel1.Items.Clear();

            lblEducationLevelExamDate4.Text = "/";
            lblEducationLevelExamDate3.Text = "/";
            lblEducationLevelExamDate2.Text = "/";
            lblEducationLevelExamDate1.Text = "/";

            comboBoxEducationLevel4.Enabled = false;
            comboBoxEducationLevel3.Enabled = false;
            comboBoxEducationLevel2.Enabled = false;
            comboBoxEducationLevel1.Enabled = false;


            switch (memberEducations.Count)
            {
            case 4:
                lblEducationLevelExamDate4.Text = memberEducations[3].exam_date.ToString("dd.MM.yyyy.");
                comboBoxEducationLevel4.Items.Add(memberEducations[3].commission_member_1);
                comboBoxEducationLevel4.Items.Add(memberEducations[3].commission_member_2);
                comboBoxEducationLevel4.Items.Add(memberEducations[3].commission_member_3);
                comboBoxEducationLevel4.SelectedIndex = 0;
                comboBoxEducationLevel4.Enabled       = true;
                goto case 3;

            case 3:
                lblEducationLevelExamDate3.Text = memberEducations[2].exam_date.ToString("dd.MM.yyyy.");
                comboBoxEducationLevel3.Items.Add(memberEducations[2].commission_member_1);
                comboBoxEducationLevel3.Items.Add(memberEducations[2].commission_member_2);
                comboBoxEducationLevel3.Items.Add(memberEducations[2].commission_member_3);
                comboBoxEducationLevel3.SelectedIndex = 0;
                comboBoxEducationLevel3.Enabled       = true;
                goto case 2;

            case 2:
                lblEducationLevelExamDate2.Text = memberEducations[1].exam_date.ToString("dd.MM.yyyy.");
                comboBoxEducationLevel2.Items.Add(memberEducations[1].commission_member_1);
                comboBoxEducationLevel2.Items.Add(memberEducations[1].commission_member_2);
                comboBoxEducationLevel2.Items.Add(memberEducations[1].commission_member_3);
                comboBoxEducationLevel2.SelectedIndex = 0;
                comboBoxEducationLevel2.Enabled       = true;
                goto case 1;

            case 1:
                lblEducationLevelExamDate1.Text = memberEducations[0].exam_date.ToString("dd.MM.yyyy.");
                comboBoxEducationLevel1.Items.Add(memberEducations[0].commission_member_1);
                comboBoxEducationLevel1.Items.Add(memberEducations[0].commission_member_2);
                comboBoxEducationLevel1.Items.Add(memberEducations[0].commission_member_3);
                comboBoxEducationLevel1.SelectedIndex = 0;
                comboBoxEducationLevel1.Enabled       = true;
                break;
            }
            int lastPayedMonth = MembershipFeePaymentDAO.getLastPaidMonth(member.member_id);

            if (lastPayedMonth == payingMonth)
            {
                comboBoxMonthMembershipFee.Enabled = false;
                comboBoxYearMembershipFee.Enabled  = false;
                btnSubmitPayment.Enabled           = false;
            }
            else
            {
                comboBoxMonthMembershipFee.Enabled = true;
                comboBoxYearMembershipFee.Enabled  = true;
                btnSubmitPayment.Enabled           = true;
            }
        }