Esempio n. 1
0
 private void PictureBox_AddAdditionalPhoneNumber_Click(object sender, EventArgs e)
 {
     PictureBox_AddAdditionalPhoneNumber.Hide();
     PictureBox_DeleteAdditionalPhoneNumber.Show();
     TextBox_AdditionalPhoneNumber.Show();
     Label_AdditionalPhoneNumber.Show();
 }
Esempio n. 2
0
 private bool addParticipantData()
 {
     ComboBox_Events.SelectedIndex = mainWindow.events.FindIndex(ev => ev.eventName.Equals(templateParticipatEvent.eventName));
     //participant.TextBox_FirstName = this.TextBox_FirstName;
     //participant.TextBox_LastName = this.TextBox_LastName;
     TextBox_JobTitle.Text              = templateParticipat.jobTitle;
     TextBox_CompanyName.Text           = templateParticipat.companyName;
     ComboBox_CompanyType.SelectedIndex = ComboBox_CompanyType.Items.IndexOf(templateParticipat.companyType);
     TextBox_Email.Text       = templateParticipat.email;
     TextBox_PhoneNumber.Text = templateParticipat.phoneNumber;
     if (templateParticipat.additionalPhoneNumber.Length > 0)
     {
         TextBox_AdditionalPhoneNumber.Text = templateParticipat.additionalPhoneNumber;
         PictureBox_AddAdditionalPhoneNumber.Hide();
         Label_AdditionalPhoneNumber.Show();
         TextBox_AdditionalPhoneNumber.Show();
         PictureBox_DeleteAdditionalPhoneNumber.Show();
     }
     else
     {
         Label_AdditionalPhoneNumber.Hide();
         TextBox_AdditionalPhoneNumber.Hide();
         PictureBox_DeleteAdditionalPhoneNumber.Hide();
     }
     TextBox_Country.Text                           = templateParticipat.country;
     TextBox_Comment.Text                           = templateParticipat.comment;
     DateTime_PaymentDate.Value                     = templateParticipat.paymentDate;
     DateTime_RegistrationDate.Value                = templateParticipat.registrationDate;
     TextBox_PaymentAmount.Text                     = templateParticipat.paymentAmount.ToString();
     ComboBox_ParticipationFormat.SelectedIndex     = ComboBox_ParticipationFormat.Items.IndexOf(templateParticipat.participationFormat);
     ComboBox_PaymentStatus.SelectedIndex           = ComboBox_PaymentStatus.Items.IndexOf(templateParticipat.paymentStatus);
     ComboBox_Materials.SelectedIndex               = ComboBox_Materials.Items.IndexOf(templateParticipat.materials ? "Yes":"No");
     ComboBox_ParticipateEveningEvent.SelectedIndex = ComboBox_ParticipateEveningEvent.Items.IndexOf(templateParticipat.participateEveningEvent ? "Yes" : "No");
     ComboBox_ParticipateDay1.SelectedIndex         = ComboBox_ParticipateDay1.Items.IndexOf(templateParticipat.participateInDay1 ? "Yes" : "No");
     ComboBox_ParticipateDay2.SelectedIndex         = ComboBox_ParticipateDay2.Items.IndexOf(templateParticipat.participateInDay2 ? "Yes" : "No");
     ComboBox_ParticipateDay3.SelectedIndex         = ComboBox_ParticipateDay3.Items.IndexOf(templateParticipat.participateInDay3 ? "Yes" : "No");
     ComboBox_ParticipateDay4.SelectedIndex         = ComboBox_ParticipateDay4.Items.IndexOf(templateParticipat.participateInDay4 ? "Yes" : "No");
     return(true);
 }
Esempio n. 3
0
        private async void loadWindowData()
        {
            participationFormats = await participationFormatServices.getAllParticipationFormats();

            PictureBox_DeleteAdditionalPhoneNumber.Hide();
            TextBox_AdditionalPhoneNumber.Text = "";
            TextBox_AdditionalPhoneNumber.Hide();
            Label_AdditionalPhoneNumber.Hide();


            foreach (Event eventEntity in events)
            {
                ComboBox_Events.Items.Add(eventEntity.eventName);
            }
            foreach (CompanyTypes companyType in (CompanyTypes[])Enum.GetValues(typeof(CompanyTypes)))
            {
                ComboBox_CompanyType.Items.Add(companyType.ToString());
            }


            foreach (ParticipationFormat participationFormat in participationFormats)
            {
                ComboBox_ParticipationFormat.Items.Add(participationFormat.Value);
            }
            //Set payment status values to comboBox and select first item
            foreach (PaymentStatus paymentStatus in (PaymentStatus[])Enum.GetValues(typeof(PaymentStatus)))
            {
                ComboBox_PaymentStatus.Items.Add(paymentStatus.ToString());
            }
            ComboBox_PaymentStatus.SelectedIndex = 0;

            //Set Yes No values to materials, participation in evening event, and participation
            //in event days comboBoxes and select no values for all exept for participating in
            //first day of event
            foreach (YesNo yesNo in (YesNo[])Enum.GetValues(typeof(YesNo)))
            {
                ComboBox_Materials.Items.Add(yesNo.ToString());
                ComboBox_ParticipateEveningEvent.Items.Add(yesNo.ToString());
                ComboBox_ParticipateDay1.Items.Add(yesNo.ToString());
                ComboBox_ParticipateDay2.Items.Add(yesNo.ToString());
                ComboBox_ParticipateDay3.Items.Add(yesNo.ToString());
                ComboBox_ParticipateDay4.Items.Add(yesNo.ToString());
            }
            ComboBox_Materials.SelectedIndex = 1;
            ComboBox_ParticipateEveningEvent.SelectedIndex = 1;
            ComboBox_ParticipateDay1.SelectedIndex         = 0;
            ComboBox_ParticipateDay2.SelectedIndex         = 1;
            ComboBox_ParticipateDay3.SelectedIndex         = 1;
            ComboBox_ParticipateDay4.SelectedIndex         = 1;

            TextBox_PaymentAmount.Text = "0";

            ComboBox_PaymentStatus.SelectedIndex = 0;
            ComboBox_ParticipationFormat.Items.Add(addNewParticipationFormat);
            ComboBox_ParticipationFormat.Items.Add(deleteParticipationFormat);
            ComboBox_ParticipationFormat.SelectedIndexChanged += ParticipationFormatSelectedIndexChanged;
            DateTime_PaymentDate.Hide();
            if (addParticipantDataAction)
            {
                bool added = addParticipantData();
                BringToFront();
            }
        }
Esempio n. 4
0
        private async void loadWindowData()
        {
            this.emailTemplates = await emailTemplateServices.getAllMailTemplates();

            participationFormats = await participationFormatServices.getAllParticipationFormats();

            foreach (ParticipationFormat participationFormat in participationFormats)
            {
                ComboBox_ParticipationFormat.Items.Add(participationFormat.Value);
            }
            EventDaysShowHide(participantEvent.eventLengthDays);
            Label_EventName.Text = participantEvent.eventName;
            foreach (CompanyTypes companyType in (CompanyTypes[])Enum.GetValues(typeof(CompanyTypes)))
            {
                ComboBox_CompanyType.Items.Add(companyType);
            }

            //Set payment status values to comboBox and select first item
            foreach (PaymentStatus paymentStatus in (PaymentStatus[])Enum.GetValues(typeof(PaymentStatus)))
            {
                ComboBox_PaymentStatus.Items.Add(paymentStatus);
            }
            ComboBox_PaymentStatus.SelectedIndex = ComboBox_PaymentStatus.Items.IndexOf(participant.paymentStatus);



            //Set Yes No values to materials, participation in evening event, and participation
            //in event days comboBoxes and select no values for all exept for participating in
            //first day of event
            foreach (YesNo yesNo in (YesNo[])Enum.GetValues(typeof(YesNo)))
            {
                ComboBox_Materials.Items.Add(yesNo);
                ComboBox_ParticipateEveningEvent.Items.Add(yesNo);
                ComboBox_ParticipateDay1.Items.Add(yesNo);
                ComboBox_ParticipateDay2.Items.Add(yesNo);
                ComboBox_ParticipateDay3.Items.Add(yesNo);
                ComboBox_ParticipateDay4.Items.Add(yesNo);
            }

            ComboBox_ParticipationFormat.Items.Add(addNewParticipationFormat);
            ComboBox_ParticipationFormat.Items.Add(deleteParticipationFormat);
            ComboBox_ParticipationFormat.SelectedIndexChanged += ParticipationFormatSelectedIndexChanged;
            DateTime_PaymentDate.Value      = participant.paymentDate;
            DateTime_RegistrationDate.Value = participant.registrationDate;



            if (participant.paymentAmount >= 0)
            {
                TextBox_PaymentAmount.Text = participant.paymentAmount.ToString();
            }
            else
            {
                TextBox_PaymentAmount.Text = "";
            }

            if (participant.additionalPhoneNumber.Length > 0)
            {
                TextBox_AdditionalPhoneNumber.Text = participant.additionalPhoneNumber;
            }
            else
            {
                PictureBox_AddAdditionalPhoneNumber.Show();
                PictureBox_DeleteAdditionalPhoneNumber.Hide();
                TextBox_AdditionalPhoneNumber.Text = "";
                TextBox_AdditionalPhoneNumber.Hide();
                Label_AdditionalPhoneNumber.Hide();
            }
            showHidePyamentAmountAndDate();
            TextBox_Comment.Text = participant.comment;

            setFieldsData();
        }