private void editSummary_Click(object sender, EventArgs e) { try { if (dataGrid.SelectedRows.Count > 0 || dataGrid.SelectedCells.Count > 0) { int selectedrowindex = dataGrid.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dataGrid.Rows[selectedrowindex]; int selectedSummary = Convert.ToInt32(selectedRow.Cells["summaryNumber"].Value); newSummary editSummary = new newSummary(selectedSummary); editSummary.ShowDialog(); summariesList_Load(sender, e); } } catch (Exception ex) { functions functions = new functions(); if (!functions.CheckForInternetConnection(storage.inUseDomain)) { MessageBox.Show(GlobalStrings.ConnectionToServerLost, GlobalStrings.ConnectionLost, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show(GlobalStrings.Error + ": " + ex.Message, GlobalStrings.CriticalError, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void menuSummaryNew_Click(object sender, EventArgs e) { var functions = new codeResources.functions(); if (functions.CheckForInternetConnection(storage.inUseDomain)) { newSummary newSummary = new newSummary(); newSummary.ShowDialog(); } else { MessageBox.Show(GlobalStrings.ConnectionToServerLost, GlobalStrings.ConnectionLost, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void addSummary_Click(object sender, EventArgs e) { if (workspaceResponse.contents[workspaceResponse.contents.FindIndex(x => x.workspaceName == workspaceName)].write) { functions functions = new functions(); if (!functions.CheckForInternetConnection(storage.inUseDomain)) { MessageBox.Show(GlobalStrings.ConnectionToServerLost, GlobalStrings.ConnectionLost, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { newSummary newSummary = new newSummary(); newSummary.ShowDialog(); summariesList_Load(sender, e); } } else { MessageBox.Show(summariesListStrings.ReadOnlyWorkspace, summariesListStrings.ReadOnly, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }