Example #1
0
        private void dgSellTek_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedProject = (Project)dgSellTek.SelectedItem;

            // MessageBox.Show(selectedProject.Name);



            var detailView = new frmAddEditProject(selectedProject, DetailPurpose.SellTek);

            var result = detailView.ShowDialog();

            /////////////////////Add more here///////////////////////////////////////////////////////
        }
Example #2
0
        private void dgManage_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedProject = (Project)dgManage.SelectedItem;

            MessageBox.Show(selectedProject.Name);

            var detailView = new frmAddEditProject(selectedProject);
            //this pops up the detail window..
            var result = detailView.ShowDialog();

            if (result == true)
            {
                try
                {
                    this._filteredProjects = null;
                    this._projects         = null;
                    _projects = _projectManager.GetProjectsByPhase();
                    if (cboProjectType.Items.Count == 0)
                    {
                        var projectTypes = _projectManager.GetProjectTypes();
                        foreach (var p in projectTypes)
                        {
                            cboProjectType.Items.Add(p);
                        }

                        cboProjectType.Items.Add("Show All");
                        cboProjectType.SelectedItem = "Show All";
                    }
                    if (_filteredProjects == null)
                    {
                        _filteredProjects = _projects;
                    }

                    dgManage.ItemsSource = _filteredProjects;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Example #3
0
        private void btnAddProject_Click(object sender, RoutedEventArgs e)
        {
            var addProjectForm = new frmAddEditProject();
            var result         = addProjectForm.ShowDialog();

            if (result == true)
            {
                try
                {
                    this._filteredProjects = null;
                    this._projects         = null;
                    _projects = _projectManager.GetProjectsByPhase();
                    if (cboProjectType.Items.Count == 0)
                    {
                        var projectTypes = _projectManager.GetProjectTypes();
                        foreach (var p in projectTypes)
                        {
                            cboProjectType.Items.Add(p);
                        }

                        cboProjectType.Items.Add("Show All");
                        cboProjectType.SelectedItem = "Show All";
                    }
                    if (_filteredProjects == null)
                    {
                        _filteredProjects = _projects;
                    }

                    dgManage.ItemsSource = _filteredProjects;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }