private void EditResourceToolStripMenuItem_Click( object sender, EventArgs e) { ResourceSelect dlg = new ResourceSelect(); dlg.Text = "Edit Resource"; if (dlg.ShowDialog() == DialogResult.OK) { // get the resource id ShowEditResource(dlg.ResourceId); } }
private void AssignButton_Click(object sender, EventArgs e) { ResourceSelect dlg = new ResourceSelect(); if (dlg.ShowDialog() == DialogResult.OK) { try { _project.Resources.Assign(dlg.ResourceId); } catch (InvalidOperationException ex) { MessageBox.Show(ex.ToString(), "Error Assigning", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void AssignButton_Click(object sender, EventArgs e) { ResourceSelect dlg = new ResourceSelect(); if (dlg.ShowDialog() == DialogResult.OK) try { _project.Resources.Assign(dlg.ResourceId); } 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 DeleteResourceToolStripMenuItem_Click( object sender, EventArgs e) { ResourceSelect dlg = new ResourceSelect(); dlg.Text = "Delete Resource"; if (dlg.ShowDialog() == DialogResult.OK) { // get the resource id int resourceId = dlg.ResourceId; if (MessageBox.Show("Are you sure?", "Delete resource", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { using (StatusBusy busy = new StatusBusy("Deleting resource...")) { try { ProjectTracker.Library.ResourceEdit.DeleteResourceEdit(resourceId); } 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 DeleteResourceToolStripMenuItem_Click( object sender, EventArgs e) { ResourceSelect dlg = new ResourceSelect(); dlg.Text = "Delete Resource"; if (dlg.ShowDialog() == DialogResult.OK) { // get the resource id int resourceId = dlg.ResourceId; if (MessageBox.Show("Are you sure?", "Delete resource", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { using (StatusBusy busy = new StatusBusy("Deleting resource...")) { try { Resource.DeleteResource(resourceId); } 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); } } } } }