private string SetButtonText(Meetings meeting) { string buttonText = Environment.NewLine; buttonText += meeting.Companies.CompanyName; buttonText += Environment.NewLine; buttonText += meeting.Date.ToShortDateString(); buttonText += Environment.NewLine; buttonText += meeting.Hour + ":00" + " - " + (meeting.Hour + 2) + ":00"; return(buttonText); }
private void b_Click(object sender, EventArgs e) { Button button = sender as Button; if (button.Name != "") { int selectedID = Convert.ToInt32(button.Name); Meetings MeetingOnButton = Program.db.Meetings .Where(x => x.MeetingID == selectedID) .FirstOrDefault(); MessageBox.Show(MeetingOnButton.Description); } }