private void submitBtn_Click(object sender, EventArgs e) { try { foreach (DataGridViewRow row in CustomersGrid.Rows) { if ((row.Cells[0].Value != null) && ((bool)((DataGridViewCheckBoxCell)row.Cells[0]).Value)) { versionPK = Database.getLatestVersion(); DateTime date = Convert.ToDateTime(actualDatePicker.Value.ToShortDateString() + ' ' + actualTimePicker.Value.ToShortTimeString()); Database.AddUpdate(versionPK, Convert.ToInt32(row.Cells["PK"].Value.ToString()), date, null, "", 0); } } }catch (Exception ex) { System.Console.WriteLine(ex.StackTrace); } DataGridView dgv = mainMenu.getVersionGrid(); dgv.DataSource = Database.GetVersionList(); MessageBox.Show("Completed!"); this.Hide(); mainMenu.Show(); }
private void submitBtn_Click(object sender, EventArgs e) { bool blueAspect = blueAspectCB.Checked; bool redAspect = redAspectCB.Checked; bool webApp = webAppCB.Checked; bool webService = webServiceCB.Checked; if (blueAspect || redAspect || webApp || webService) { Database.UpdateVersion(currentPK, idTxtBx.Text, descriptionTxtBx.Text, Convert.ToInt32(typeCmboBx.SelectedItem), Convert.ToDateTime(releaseDateCal.SelectionRange.Start.ToShortDateString()), blueAspect, redAspect, webApp, webService); MessageBox.Show("Completed!"); DataGridView dgv = versionsPage.getVersionGrid(); dgv.DataSource = Database.GetVersionList(); versionsPage.Show(); this.Hide(); } else { MessageBox.Show("Version must include at least one piece of software."); } }