private void EditProjectToolStripMenuItem_Click( object sender, EventArgs e) { using (ProjectSelect dlg = new ProjectSelect()) { dlg.Text = "Edit Project"; if (dlg.ShowDialog() == DialogResult.OK) { ShowEditProject(dlg.ProjectId); } } }
private void AssignButton_Click(object sender, EventArgs e) { ProjectSelect dlg = new ProjectSelect(); if (dlg.ShowDialog() == DialogResult.OK) { try { _resource.Assignments.AssignTo(dlg.ProjectId); } catch (InvalidOperationException ex) { MessageBox.Show(ex.ToString(), "Error Assigning", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void AssignButton_Click(object sender, EventArgs e) { ProjectSelect dlg = new ProjectSelect(); if (dlg.ShowDialog() == DialogResult.OK) try { _resource.Assignments.AssignTo(dlg.ProjectId); } catch (InvalidOperationException ex) { MessageBox.Show(ex.ToString(), "Error Assigning", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error Assigning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void DeleteProjectToolStripMenuItem_Click(object sender, EventArgs e) { ProjectSelect dlg = new ProjectSelect(); dlg.Text = "Delete Project"; if (dlg.ShowDialog() == DialogResult.OK) { // get the project id var projectId = dlg.ProjectId; if (MessageBox.Show("Are you sure?", "Delete project", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { using (StatusBusy busy = new StatusBusy("Deleting project...")) { try { ProjectTracker.Library.ProjectEdit.DeleteProject(projectId); } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), "Error deleting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error deleting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } } }
private void DeleteProjectToolStripMenuItem_Click(object sender, EventArgs e) { ProjectSelect dlg = new ProjectSelect(); dlg.Text = "Delete Project"; if (dlg.ShowDialog() == DialogResult.OK) { // get the project id Guid projectId = dlg.ProjectId; if (MessageBox.Show("Are you sure?", "Delete project", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { using (StatusBusy busy = new StatusBusy("Deleting project...")) { try { Project.DeleteProject(projectId); } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), "Error deleting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error deleting", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } } }