private void buttonSubmit_Click(object sender, EventArgs e) { if ((int)numericUpDownPrice.Value < 1) { MessageBox.Show("Price must be at least 1"); return; } try { string name = textBoxConferenceName.Text; string edition = textBoxConferenceEdition.Text; string website = textBoxConferenceWebsite.Text; string city = textBoxConferenceCity.Text; string country = textBoxConferenceCountry.Text; int price = (int)numericUpDownPrice.Value; DateTime abs = dateTimePicker1.Value; DateTime complete = dateTimePicker2.Value; DateTime participation = dateTimePicker3.Value; DateTime bidding = dateTimePicker4.Value; DateTime evaluation = dateTimePicker5.Value; DateTime begin = dateTimePicker6.Value; DateTime end = dateTimePicker7.Value; List <String> topics = tempTopics.ToList(); List <Model.AvailableRoom> availableRooms = tempAvailableRooms.ToList(); ctrl.AddConference(name, edition, topics, abs, complete, bidding, evaluation, participation, city, country, website, price, begin, end); Conference addedConf = ctrl.getConference(name, edition, city); foreach (var ar in availableRooms) { ctrl.addRoom(addedConf.Id, ar.RoomName, ar.Capacity, ar.Street, ar.City, ar.PostalCode, ar.BeginDate, ar.EndDate); } if (addedChairs.Count == 1) { Participant chair = new Participant(addedChairs[0], addedConf.Id, true, false, true, false); ctrl.addParticipant(chair); } else { foreach (var c in addedChairs) { Participant chair = new Participant(c, addedConf.Id, false, true, true, false); ctrl.addParticipant(chair); } } foreach (var p in addedPCMembers) { Participant pcm = new Participant(p, addedConf.Id, false, false, true, false); ctrl.addParticipant(pcm); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.Close(); }
private void buttonSubmit_Click(object sender, EventArgs e) { try { string name = textBoxConferenceName.Text; string edition = textBoxConferenceEdition.Text; string website = textBoxConferenceWebsite.Text; string city = textBoxConferenceCity.Text; string country = textBoxConferenceCountry.Text; int price = Convert.ToInt32(textBoxPrice.Text); DateTime begin = new DateTime( Convert.ToInt32(textBoxBeginYear.Text), Convert.ToInt32(textBoxBeginMonth.Text), Convert.ToInt32(textBoxBeginDay.Text)); DateTime end = new DateTime( Convert.ToInt32(textBoxEndYear.Text), Convert.ToInt32(textBoxEndMonth.Text), Convert.ToInt32(textBoxEndDay.Text)); DateTime abs = new DateTime( Convert.ToInt32(textBoxAbstractYear.Text), Convert.ToInt32(textBoxAbstractMonth.Text), Convert.ToInt32(textBoxAbstractDay.Text)); DateTime complete = new DateTime( Convert.ToInt32(textBoxCompleteYear.Text), Convert.ToInt32(textBoxCompleteMonth.Text), Convert.ToInt32(textBoxCompleteDay.Text)); DateTime bidding = new DateTime( Convert.ToInt32(textBoxBiddingYear.Text), Convert.ToInt32(textBoxBiddingMonth.Text), Convert.ToInt32(textBoxBiddingDay.Text)); DateTime evaluation = new DateTime( Convert.ToInt32(textBoxEvaluationYear.Text), Convert.ToInt32(textBoxEvaluationMonth.Text), Convert.ToInt32(textBoxEvaluationDay.Text)); DateTime participation = new DateTime( Convert.ToInt32(textBoxParticipationYear.Text), Convert.ToInt32(textBoxParticipationMonth.Text), Convert.ToInt32(textBoxParticipationDay.Text)); List <String> topics = new List <string>(); ctrl.AddConference(name, edition, topics, abs, complete, bidding, evaluation, participation, city, country, website, price, begin, end); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.Close(); }