예제 #1
0
파일: MainForm.cs 프로젝트: uzigula/csla
 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);
         }
     }
 }
예제 #2
0
파일: MainForm.cs 프로젝트: BiYiTuan/csla
 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);
     }
   }
 }
예제 #3
0
        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);
     }
 }
예제 #5
0
파일: MainForm.cs 프로젝트: uzigula/csla
        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);
                        }
                    }
                }
            }
        }
예제 #6
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);
            }
              }
            }
              }
        }