예제 #1
0
        public void Execute()
        {
            BindingList <Part> parts = new BindingList <Part>();
            var query = session.CreateSQLQuery(PartQuery.BuildSqlForInspection(viewModel.SearchNumber))
                        .SetResultTransformer(PartQuery.Transformer);

            var qparts = query.List <Part>();

            foreach (var item in qparts)
            {
                if (item.IsActive)
                {
                    parts.Add(item);
                }
            }

            viewModel.Parts = parts;
            if (parts.Count > 0)
            {
                if (inspectionDialog == null)
                {
                    inspectionDialog = new InspectionSelectPartDialog(parts, viewModel);
                }
                else
                {
                    inspectionDialog.SetupForm(parts, viewModel);
                }

                inspectionDialog.ShowDialog();
            }
            else if (ctx.HasAccess(global::Domain.Entity.Security.Privileges.PartsInspection))
            {
                if (dialog == null)
                {
                    dialog = new CreateSpoolComponentDialog(viewModel.SearchNumber);
                }
                else
                {
                    dialog.SetupForm(viewModel.SearchNumber);
                }

                dialog.ShowDialog();
                var parent = viewModel.CurrentForm.MdiParent as PrizmApplicationXtraForm;
                if (parent != null && dialog.DialogResult == DialogResult.Yes)
                {
                    parent.OpenChildForm(typeof(SpoolsXtraForm), Guid.Empty, viewModel.SearchNumber);
                }
                else if (parent != null && dialog.DialogResult == DialogResult.No)
                {
                    parent.OpenChildForm(typeof(ComponentNewEditXtraForm), Guid.Empty, viewModel.SearchNumber);
                }
            }
            RefreshVisualStateEvent();
        }
예제 #2
0
        protected override void BeginProcessing()
        {
            this.shouldInclude = CreateShouldIncludeList();

            PartQuery initialQuery = new PartQuery(this);

            this.queue = new SearchQueue();

            queue.AddRange(this.SearchDirectories.Select(searchDir => new SearchState(initialQuery, searchDir, 0)));

            base.BeginProcessing();
        }
        public void Execute()
        {
            BindingList <Part> parts = new BindingList <Part>();
            var query = session.CreateSQLQuery(PartQuery.BuildSqlForInspection(viewModel.SearchNumber))
                        .SetResultTransformer(PartQuery.Transformer);

            var qparts = query.List <Part>();

            foreach (var item in qparts)
            {
                parts.Add(item);
            }

            viewModel.Parts = parts;
            if (parts.Count > 0)
            {
                if (inspectionDialog == null)
                {
                    inspectionDialog = new InspectionSelectPartDialog(parts, viewModel);
                }
                else
                {
                    inspectionDialog.SetupForm(parts, viewModel);
                }

                inspectionDialog.ShowDialog();
            }
            else if (ctx.HasAccess(global::Domain.Entity.Security.Privileges.PartsInspection))
            {
                if (dialog == null)
                {
                    dialog = new CreateSpoolComponentDialog(viewModel.SearchNumber);
                }
                else
                {
                    dialog.SetupForm(viewModel.SearchNumber);
                }

                dialog.ShowDialog();
                if (dialog.DialogResult == DialogResult.Yes)
                {
                    FormManager.Instance.OpenChildForm(DocumentTypes.ConstructionSpool, viewModel.SearchNumber);
                }
                else if (dialog.DialogResult == DialogResult.No)
                {
                    FormManager.Instance.OpenChildForm(DocumentTypes.ConstructionComponent, viewModel.SearchNumber);
                }
            }
            RefreshVisualStateEvent();
        }
예제 #4
0
 public SearchState(PartQuery query, DirectoryInfo directory, int strength)
 {
     this.Query     = query;
     this.Directory = directory;
     this.Strength  = strength;
 }
예제 #5
0
 public SearchState(PartQuery query, string directory, int strength)
     : this(query, new DirectoryInfo(directory), strength)
 {
 }