コード例 #1
0
ファイル: ProjectEdit.cs プロジェクト: wyerp/csla
 private void ApplyButton_Click(object sender, EventArgs e)
 {
     using (StatusBusy busy = new StatusBusy("Saving..."))
     {
         RebindUI(true, true);
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: uzigula/csla
 private void NewResourceToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (StatusBusy busy = new StatusBusy("Creating resource..."))
     {
         AddWinPart(new ResourceEdit(ProjectTracker.Library.ResourceEdit.NewResourceEdit()));
     }
 }
コード例 #3
0
 private void ApplyButton_Click(object sender, EventArgs e)
 {
     using (StatusBusy busy = new StatusBusy("Saving..."))
       {
     RebindUI(true, true);
       }
 }
コード例 #4
0
ファイル: ProjectEdit.cs プロジェクト: wyerp/csla
 private void OKButton_Click(object sender, EventArgs e)
 {
     using (StatusBusy busy = new StatusBusy("Saving..."))
     {
         RebindUI(true, false);
     }
     this.Close();
 }
コード例 #5
0
ファイル: ResourceEdit.cs プロジェクト: Jaans/csla
 private void OKButton_Click(object sender, EventArgs e)
 {
   using (StatusBusy busy = new StatusBusy("Saving..."))
   {
     RebindUI(true, false);
   }
   this.Close();
 }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: BiYiTuan/csla
 private void NewProjectToolStripMenuItem_Click(
   object sender, EventArgs e)
 {
   using (StatusBusy busy = 
     new StatusBusy("Creating project..."))
   {
     AddWinPart(new ProjectEdit(ProjectTracker.Library.ProjectEdit.NewProject()));
   }
 }
コード例 #7
0
ファイル: LoginForm.cs プロジェクト: mlivensp/csla
 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();
 }
コード例 #8
0
 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();
 }
コード例 #9
0
 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();
             }
         }
     }
 }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: uzigula/csla
        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);
                }
            }
        }
コード例 #11
0
ファイル: MainForm.cs プロジェクト: uzigula/csla
        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);
                        }
                    }
                }
            }
        }
コード例 #12
0
        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);
                        }
                    }
                }
            }
        }
コード例 #13
0
        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);
            }
              }
        }
コード例 #14
0
        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);
            }
              }
            }
              }
        }
コード例 #15
0
        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);
            }
              }
            }
              }
        }
コード例 #16
0
 private void NewResourceToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (StatusBusy busy = new StatusBusy("Creating resource..."))
       {
     AddWinPart(new ResourceEdit(Resource.NewResource()));
       }
 }
コード例 #17
0
        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);
            }
              }
        }