コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }