private void btnAddNewFollowup_Click(object sender, EventArgs e) { try { frmFollowUp frm = new frmFollowUp(); frm.SchdeuleID = this.SelectedScheduleID; if (frm.ShowDialog() == DialogResult.OK) { PopulateAllSchedules(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ctrlScheduleCallLog::btnAddNewFollowup_Click", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnEditFollowup_Click(object sender, EventArgs e) { int lastFollwUpID = (new ServiceScheduleCallLog()).GetLatestFollowUpIDForSchdeuleCall(this.SelectedScheduleID); if (this.SelectedFollowUpID == lastFollwUpID) { frmFollowUp frm = new frmFollowUp(); frm.SchdeuleID = this.SelectedScheduleID; frm.FollowUpID = this.SelectedFollowUpID; if (frm.ShowDialog() == DialogResult.OK) { PopulateAllSchedules(); } } else { MessageBox.Show("You can Edit the Latest Follow-Up only.", "Invalid Selection", MessageBoxButtons.OK, MessageBoxIcon.Information); } }