Пример #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (AddStartDate.Value < System.DateTime.Now)
            {
                SetBalloonTip("Invalid Start Date", "Please select a Start Date after current date");
                notifyIcon1.Visible = true;
                notifyIcon1.ShowBalloonTip(3000);
            }
            else if (AddEndDate.Value < AddStartDate.Value)
            {
                SetBalloonTip("Invalid End Date", "Please select a End Date after Start Date");
                notifyIcon1.Visible = true;
                notifyIcon1.ShowBalloonTip(3000);
            }
            else if (AddConferenceName.Text == "" || AddConferenceName.Text == null)
            {
                SetBalloonTip("Please don't leave the Name empty", "Please enter a name for the conference");
                notifyIcon1.Visible = true;
                notifyIcon1.ShowBalloonTip(3000);
            }
            else
            {
                try
                {
                    if (EditNew == 1)
                    {
                        eventDetails.ConferenceName = AddConferenceName.Text;
                        eventDetails.LocationName   = AddAddress.Text;
                        eventDetails.StartDate      = AddStartDate.Value;
                        eventDetails.EndDate        = AddEndDate.Value;
                        _ConferenceRepository.AddConference(eventDetails);
                    }
                    else
                    {
                        eventDetails.StartDate = AddStartDate.Value;
                        eventDetails.EndDate   = AddEndDate.Value;
                        _ConferenceRepository.EditConference(eventDetails, AddAddress.Text, AddConferenceName.Text);
                    }

                    string            message = "Do you want a new Conference?";
                    string            caption = "Error Detected in Input";
                    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                    DialogResult      result;

                    result = MessageBox.Show(message, caption, buttons);
                    if (result == System.Windows.Forms.DialogResult.Yes)
                    {
                        this.Close();
                        formMain.AddEventNotEdit();
                    }
                    this.Close();
                }
                catch
                {
                    SetBalloonTip("Invalid entry", "Please enter a valid entry");
                    notifyIcon1.Visible = true;
                    notifyIcon1.ShowBalloonTip(3000);
                }
            }
        }
 public IActionResult UpdateConference([FromRoute] int?conferenceId, ConferenceModel conference)
 {
     if (conferenceId == null)
     {
         return(BadRequest());
     }
     conference.ConferenceId = (int)conferenceId;
     conferenceRepository.EditConference(conference);
     return(Ok());
 }
Пример #3
0
 public bool EditConference(ConferenceDTO conference)
 {
     try
     {
         _repository.EditConference(conference);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
 public IActionResult EditConference([FromBody] AddEventDetailModel eventDetail, [FromBody] string newAddress, [FromBody] string newConferenceName)
 {
     _conferenceRepository.EditConference(eventDetail, newAddress, newConferenceName);
     return(Ok());
 }