public DockContentView CreateViewAnalysis(Analysis analysis)
        {
            DockContentView form = null;

            if (analysis is AnalysisCasePallet)
            {
                form = new DockContentAnalysisCasePallet(this, analysis as AnalysisCasePallet);
            }
            else if (analysis is AnalysisBoxCase)
            {
                form = new DockContentAnalysisBoxCase(this, analysis as AnalysisBoxCase);
            }
            else if (analysis is AnalysisPalletTruck)
            {
                form = new DockContentAnalysisPalletTruck(this, analysis as AnalysisPalletTruck);
            }
            else if (analysis is AnalysisCylinderPallet)
            {
                form = new DockContentAnalysisCylinderPallet(this, analysis as AnalysisCylinderPallet);
            }
            else if (analysis is AnalysisCylinderCase)
            {
                form = new DockContentAnalysisCylinderCase(this, analysis as AnalysisCylinderCase);
            }
            else
            {
                _log.Error(string.Format("Analysis ({0}) type not handled", analysis.Name));
                return(null);
            }
            AddView(form);
            return(form);
        }
Exemple #2
0
        public void EditAnalysis(Analysis analysis)
        {
            // search for any DockContentAnalysis window and close it
            var seq = (from view in Views
                       where view is DockContentAnalysisEdit && analysis == (view as DockContentAnalysisEdit).Analysis
                       select view);

            if (seq.Count() > 0)
            {
                seq.First().Close();
            }

            // instantiate a form to edit analysis
            Form form = null;

            if (analysis is AnalysisCasePallet)
            {
                form = new FormNewAnalysisCasePallet(this, analysis);
            }
            else if (analysis is AnalysisBoxCase)
            {
                form = new FormNewAnalysisBoxCase(this, analysis);
            }
            else if (analysis is AnalysisCylinderPallet)
            {
                form = new FormNewAnalysisCylinderPallet(this, analysis);
            }
            else if (analysis is AnalysisCylinderCase)
            {
                form = new FormNewAnalysisCylinderCase(this, analysis);
            }
            else if (analysis is AnalysisPalletTruck)
            {
                form = new FormNewAnalysisPalletTruck(this, analysis);
            }
            else if (analysis is AnalysisCaseTruck)
            {
                form = new FormNewAnalysisCaseTruck(this, analysis);
            }
            else
            {
                MessageBox.Show("Unexepected analysis type!");
                return;
            }
            if (DialogResult.OK == form.ShowDialog())
            {
                DockContentView formAnalysis = CreateViewAnalysis(analysis);
                formAnalysis.Show();
            }
        }
Exemple #3
0
        public DockContentView CreateViewHAnalysis(HAnalysis analysis)
        {
            DockContentView form = null;

            if (analysis is HAnalysisPallet)
            {
                form = new DockContentHAnalysisCasePallet(this, analysis);
            }
            else
            {
                _log.Error(string.Format("Analysis ({0}) type not handled", analysis.Name));
                return(null);
            }
            AddView(form);
            return(form);
        }
Exemple #4
0
        public DockContentView CreateViewHAnalysis(AnalysisHetero analysis)
        {
            DockContentView form = null;

            if (analysis is HAnalysisPallet)
            {
                form = new DockContentHAnalysisCasePallet(this, analysis);
            }
            else if (analysis is HAnalysisTruck)
            {
                form = new DockContentHAnalysisCaseTruck(this, analysis);
            }
            else
            {
                _log.Error($"Analysis ({analysis.Name}) type not handled");
                return(null);
            }
            AddView(form);
            return(form);
        }