コード例 #1
0
        public ExternalReportCreationDialogViewModel(IDataService <LabDbEntities> labDbData,
                                                     IReportService reportService) : base()
        {
            _labDbData        = labDbData;
            _reportService    = reportService;
            SampleDescription = "";
            TestDescription   = "";

            CancelCommand = new DelegateCommand <Window>(
                parent =>
            {
                parent.DialogResult = false;
            });

            ConfirmCommand = new DelegateCommand <Window>(
                parent =>
            {
                int year = DateTime.Now.Year - 2000;

                ExternalReportInstance = new ExternalReport
                {
                    Description    = TestDescription,
                    Year           = year,
                    Number         = _reportService.GetNextExternalReportNumber(year),
                    MaterialSent   = false,
                    RequestDone    = false,
                    Samples        = SampleDescription,
                    ReportReceived = false,
                    ExternalLabID  = SelectedLab.ID,
                    ProjectID      = SelectedProject.ID
                };

                ExternalReportInstance.Create();

                parent.DialogResult = true;
            });
        }
コード例 #2
0
ファイル: ExternalReportExtension.cs プロジェクト: PiSim/LDb2
        /// <summary>
        /// Extension Method used to generate an ObservableCollection of DataGridColumns
        /// that will be used to correctly visualize the results in a DataGrid
        /// </summary>
        /// <returns>An ObservableCollection of DataGridColumns</returns>
        public static ObservableCollection <DataGridColumn> GetResultPresentationColumns(this ExternalReport report)
        {
            ObservableCollection <DataGridColumn> output = new ObservableCollection <DataGridColumn>();

            output.Add(new DataGridTextColumn()
            {
                Header     = "Metodo",
                Binding    = new Binding("MethodName"),
                IsReadOnly = true,
                Width      = 100
            });

            output.Add(new DataGridTextColumn()
            {
                Header     = "Variante",
                Binding    = new Binding("MethodVariantName"),
                IsReadOnly = true,
                Width      = 150
            });

            output.Add(new DataGridTemplateColumn()
            {
                Header       = "Prove",
                CellTemplate = (DataTemplate)Application.Current.Resources[ResourceKeys.DataGridSubTestNameCellTemplate],
                Width        = 150
            });

            output.Add(new DataGridTemplateColumn()
            {
                Header       = "UM",
                CellTemplate = (DataTemplate)Application.Current.Resources[ResourceKeys.DataGridSubTestUMCellTemplate],
                Width        = 150
            });

            foreach (TestRecord tstr in report.TestRecords)
            {
                DataGridColumn resultColumn = new DataGridTemplateColumn()
                {
                    Header       = tstr.Batch.Number,
                    CellTemplate = (DataTemplate)Application.Current.Resources[ResourceKeys.DataGridSubTestExternalResultCellTemplate],
                    CellStyle    = (Style)Application.Current.Resources[ResourceKeys.DataGridCellEnabledOnEditModeStyle],
                    Width        = 150
                };

                DataGridColumnTagExtension.SetTag(resultColumn, tstr.BatchID);

                output.Add(resultColumn);
            }

            return(output);
        }
コード例 #3
0
        private void AddExternalCollidingPrimShape(PhysX.Shape otherShape, PhysxPrim colPrim)
        {
            _externalCollisionReports[otherShape] = new ExternalReport { RemoveAfterReport = false, Reported = false };

            HashSet<PhysX.Shape> primShapes;
            if (!_externalCollisionPrims.TryGetValue(colPrim, out primShapes))
            {
                primShapes = new HashSet<PhysX.Shape>();
                _externalCollisionPrims.Add(colPrim, primShapes);
                colPrim.OnDeleted += colPrim_OnDeleted;
            }

            primShapes.Add(otherShape);
        }