Ejemplo n.º 1
0
        /// <summary>
        /// Event handler after the data source is loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void domainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            base.domainDataSource_LoadedData(sender, e);
            //first item returned is the latest RG Report for the combination of inputs
            if (((DomainDataSourceView)((DomainDataSource)sender).Data).IsEmpty)
            {
                MessageBox.Show("Wrong Inputs Or RT No Already Completed\n\nCheck and try again");
                return;
            }

            FinalReport     = (FinalRTReport)((DomainDataSourceView)((DomainDataSource)sender).Data).GetItemAt(0);
            FinalReportRows = FinalReport.FinalRTReportRows;
            DataContext     = FinalReport;
            //now that fixedpatternid is available
            FixedPatternsSource.Load();
            if (FinalReport.StatusID == 2)
            {
                if (FinalReportRows.SelectMany(p => p.Classifications).Count() > 0)
                {
                    lblStatus.Text = "CASTING ACCEPTABLE AS PER LEVEL " + FinalReportRows.SelectMany(p => p.Classifications.Split(',')).Where(m => !string.IsNullOrEmpty(m)).Select(int.Parse).Max();
                }
                else
                {
                    lblStatus.Text = "CASTING ACCEPTABLE AS PER LEVEL 1";
                }
            }
            updateEnergyWiseArea();
        }
Ejemplo n.º 2
0
        public override void domainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            base.domainDataSource_LoadedData(sender, e);
            //first item returned is the latest RG Report for the combination of inputs
            if (((DomainDataSourceView)((DomainDataSource)sender).Data).IsEmpty)
            {
                MessageBox.Show("Wrong Inputs Or RT No Already Completed\n\nCheck and try again");
                return;
            }

            RGReport     = (RGReport)((DomainDataSourceView)((DomainDataSource)sender).Data).GetItemAt(0);
            RGReportRows = RGReport.RGReportRows;

            //now that fixedpatternid is available
            FixedPatternsSource.Load();
            UpdateEnergyWiseArea();
            OnPropertyChanged("TotalArea");
            SetViewing();

            //if edit mode, add a clone of original RGReport to original entities for change tracking
            if (IsEditMode)
            {
                OriginalEntities.Add(RGReport.ID, RGReport.Clone(ExcludePropertiesFromTracking));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Event handler after the data source is loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void domainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            base.domainDataSource_LoadedData(sender, e);
            //first item returned is the latest RG Report for the combination of inputs
            if (((DomainDataSourceView)((DomainDataSource)sender).Data).IsEmpty)
            {
                MessageBox.Show("Wrong Inputs Or RT No Already Completed\n\nCheck and try again");
                return;
            }

            FinalReport     = (FinalRTReport)((DomainDataSourceView)((DomainDataSource)sender).Data).GetItemAt(0);
            FinalReportRows = FinalReport.FinalRTReportRows;
            DataContext     = FinalReport;
            //now that fixedpatternid is available
            FixedPatternsSource.Load();
            updateEnergyWiseArea();
        }
        public override void domainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
        {
            base.domainDataSource_LoadedData(sender, e);
            //first item returned is the latest RG Report for the combination of inputs
            if (((DomainDataSourceView)((DomainDataSource)sender).Data).IsEmpty)
            {
                MessageBox.Show("Wrong Inputs Or RT No Already Completed\n\nCheck and try again");
                return;
            }

            RGReport     = (RGReport)((DomainDataSourceView)((DomainDataSource)sender).Data).GetItemAt(0);
            RGReportRows = RGReport.RGReportRows;
            //now that fixedpatternid is available
            FixedPatternsSource.Load();

            UpdateEnergyWiseArea();
            OnPropertyChanged("TotalArea");
            SetViewing();
            UpdatedStatus();
            if (isFromFetchMethod)
            {
                var      ctx      = (RadiographyContext)this.DomainSource.DomainContext;
                Coverage coverage = (Coverage)cmbCoverage.SelectedItem;
                ctx.Load(ctx.GetFixedPatternDetailsQuery(txtFPNo.Text, coverage.CoverageName, txtRTNo.Text));

                UpdateSourceBasedOnThickness();
                RGReport.FixedPattern = ctx.FixedPatterns.FirstOrDefault();
            }
            isFromFetchMethod = false;
            //if edit mode, add a clone of original RGReport to original entities for change tracking
            if (IsEditMode)
            {
                OriginalEntities.Add(RGReport.ID, RGReport.Clone(ExcludePropertiesFromTracking));
            }
            //ProcedureReference();
            BindToPage(cmbProcedureRef, ComboBox.SelectedValueProperty, "ProcedureReferences");
            BindToPage(cmbSpecifications, ComboBox.SelectedValueProperty, "Specifications");
            BindToPage(cmbAcceptance, ComboBox.SelectedValueProperty, "AcceptanceAsPers");
        }