private void ApplyButton_Click(object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Saving...")) { RebindUI(true, true); } }
private void NewResourceToolStripMenuItem_Click(object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Creating resource...")) { AddWinPart(new ResourceEdit(ProjectTracker.Library.ResourceEdit.NewResourceEdit())); } }
private void OKButton_Click(object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Saving...")) { RebindUI(true, false); } this.Close(); }
private void NewProjectToolStripMenuItem_Click( object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Creating project...")) { AddWinPart(new ProjectEdit(ProjectTracker.Library.ProjectEdit.NewProject())); } }
private void OK_Click(object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Verifying credentials...")) { ProjectTracker.Library.Security.PTPrincipal.Login( this.UsernameTextBox.Text, this.PasswordTextBox.Text); } this.Close(); }
private void RefreshButton_Click(object sender, EventArgs e) { if (CanRefresh()) { using (StatusBusy busy = new StatusBusy("Refreshing...")) { if (RebindUI(false, false)) { Project = ProjectTracker.Library.ProjectEdit.GetProject(Project.Id); RoleList.InvalidateCache(); RoleList.CacheList(); Setup(); } } } }
public void ShowEditProject(int projectId) { // see if this project is already loaded foreach (Control ctl in Panel1.Controls) { if (ctl is ProjectEdit) { ProjectEdit part = (ProjectEdit)ctl; if (part.Project.Id.Equals(projectId)) { // project already loaded so just // display the existing winpart ShowWinPart(part); return; } } } // the project wasn't already loaded // so load it and display the new winpart using (StatusBusy busy = new StatusBusy("Loading project...")) { try { AddWinPart(new ProjectEdit(ProjectTracker.Library.ProjectEdit.GetProject(projectId))); } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), "Error loading", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error loading", 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 async 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 { await ProjectTracker.Library.ProjectEdit.DeleteProjectAsync(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); } } } } }
public void ShowEditResource(int resourceId) { // see if this resource is already loaded foreach (Control ctl in Panel1.Controls) { if (ctl is ResourceEdit) { ResourceEdit part = (ResourceEdit)ctl; if (part.Resource.Id.Equals(resourceId)) { // resource already loaded so just // display the existing winpart ShowWinPart(part); return; } } } // the resource wasn't already loaded // so load it and display the new winpart using (StatusBusy busy = new StatusBusy("Loading resource...")) { try { AddWinPart(new ResourceEdit(Resource.GetResource(resourceId))); } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), "Error loading", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error loading", 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); } } } } }
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); } } } } }
private void NewResourceToolStripMenuItem_Click(object sender, EventArgs e) { using (StatusBusy busy = new StatusBusy("Creating resource...")) { AddWinPart(new ResourceEdit(Resource.NewResource())); } }
public void ShowEditProject(Guid projectId) { // see if this project is already loaded foreach (Control ctl in Panel1.Controls) { if (ctl is ProjectEdit) { ProjectEdit part = (ProjectEdit)ctl; if (part.Project.Id.Equals(projectId)) { // project already loaded so just // display the existing winpart ShowWinPart(part); return; } } } // the project wasn't already loaded // so load it and display the new winpart using (StatusBusy busy = new StatusBusy("Loading project...")) { try { AddWinPart(new ProjectEdit(Project.GetProject(projectId))); } catch (Csla.DataPortalException ex) { MessageBox.Show(ex.BusinessException.ToString(), "Error loading", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error loading", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }