Exemplo n.º 1
0
        private void dgrProjects_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid     dataGrid;
            DataGridRow  selectedRow;
            DataGridCell ProjectID;
            string       strProjectID;

            try
            {
                if (dgrProjects.SelectedIndex > -1)
                {
                    //setting local variable
                    dataGrid     = dgrProjects;
                    selectedRow  = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex);
                    ProjectID    = (DataGridCell)dataGrid.Columns[0].GetCellContent(selectedRow).Parent;
                    strProjectID = ((TextBlock)ProjectID.Content).Text;

                    TheFindProjectMatrixByCustomerProjectIDDataSet = TheProjectMatrixClass.FindProjectMatrixByCustomerProjectID(strProjectID);

                    //find the record
                    MainWindow.gintProjectID = TheFindProjectMatrixByCustomerProjectIDDataSet.FindProjectMatrixByCustomerProjectID[0].ProjectID;

                    UpdateSelectedProject UpdateSelectedProject = new UpdateSelectedProject();
                    UpdateSelectedProject.ShowDialog();

                    ResetControls();
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Invoiced Project Reports // Projects Grid Selection " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }
        private void dgrOverdueProjectsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataGrid     dataGrid;
            DataGridRow  selectedRow;
            DataGridCell ProjectID;
            string       strProjectID;

            try
            {
                if (dgrOverdueProjectsList.SelectedIndex > -1)
                {
                    //setting local variable
                    dataGrid     = dgrOverdueProjectsList;
                    selectedRow  = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(dataGrid.SelectedIndex);
                    ProjectID    = (DataGridCell)dataGrid.Columns[0].GetCellContent(selectedRow).Parent;
                    strProjectID = ((TextBlock)ProjectID.Content).Text;


                    //find the record
                    MainWindow.gintProjectID = Convert.ToInt32(strProjectID);

                    UpdateSelectedProject UpdateSelectedProject = new UpdateSelectedProject();
                    UpdateSelectedProject.ShowDialog();
                }
            }
            catch (Exception Ex)
            {
                TheEventLogClass.InsertEventLogEntry(DateTime.Now, "New Blue Jay ERP // Office Info Dashboard // Overdue Projects List Grid Selection " + Ex.Message);

                TheMessagesClass.ErrorMessage(Ex.ToString());
            }
        }