private void btnNew_Click(object sender, EventArgs e) { MeetingInfo info = new MeetingInfo(); if (info.ShowDialog() == DialogResult.OK) { if (Program.Repository.GetMeetingsTable().AddMeeting(info.Meeting)) { MessageBox.Show(INSERT_SUCCESSFULLY, INSERTED_SUCCESSFULLY_TITLE, MessageBoxButtons.OK); FillWeekPlaner(); } else { MessageBox.Show(ERROR_MESSAGE, ERROR_MESSAGE_TITLE, MessageBoxButtons.OK); } } }
private void Meeting_Click(object sender, EventArgs e) { FlowLayoutPanel selectedPanel; if (sender is Label) { selectedPanel = (sender as Label).Parent as FlowLayoutPanel; } else { selectedPanel = sender as FlowLayoutPanel; } int meetingId = int.Parse(selectedPanel.Tag.ToString()); MeetingInfo info = new MeetingInfo(); info.Meeting = currentMeetings[meetingId]; info.DisableInput(); info.ShowDialog(); }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { ContextMenuStrip menuStrip = (sender as ToolStripMenuItem).Owner as ContextMenuStrip; int meetingId = int.Parse((menuStrip.SourceControl as FlowLayoutPanel).Tag.ToString()); MeetingInfo info = new MeetingInfo(); info.Meeting = currentMeetings[meetingId]; if (info.ShowDialog() == DialogResult.OK) { if (Program.Repository.GetMeetingsTable().ChangeMeeting(info.Meeting)) { MessageBox.Show(GlobalResources.SaveSuccess, GlobalResources.SuccessTitle, MessageBoxButtons.OK); FillWeekPlaner(SelectedDateService.GetSelectedDateVM().CurrentDate); } else { MessageBox.Show(GlobalResources.ErrorMessage, GlobalResources.ErrorTitle, MessageBoxButtons.OK); } } }