private void updateJobCardToolStripMenuItem_Click(object sender, EventArgs e) { Form jobCardUpdate = new Job_Update(); jobCardUpdate.ShowDialog(); this.Close(); }
private void button1_Click(object sender, EventArgs e)// btnSaveAssesment { Survey survey = new Survey(); survey = SetSurveyAssessmentSharedProperties(survey); survey = SetSurveyAssessmentSection1Properties(survey); survey.JobCardNumber = txt_SA_jobcardNo.Text; survey.CurrentSurveyItems = CurrentSurveyItems; if (ShowMessageBox) { MessageBox.Show("Please double check your input."); } else { try { proccessing.AddSurveyToDatabase(survey); proccessing.AddSurveyItemsToDatabase(survey); string message = "Survey Created.Do you want to create Job Card?"; string title = "Survey Success"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result = MessageBox.Show(message, title, buttons); if (result == DialogResult.Yes) { proccessing.GenerateJobCard(survey.JobCardNumber); Form jobCardUpdate = new Job_Update(); jobCardUpdate.ShowDialog(); this.Close(); } else { ReLoad(); } } catch (Exception ex) { MessageBox.Show("Survey Creation Failed :" + ex.ToString()); } } }