Esempio n. 1
0
        public Process(
            string routingId,
            IModelDoc2 pDoc,
            ISldWorks swApp)
        {
            InitializeComponent();

            this.routingId = routingId;
            this.pDoc      = pDoc;
            this.swApp     = swApp;

            pContext  = new ProcessContext(DbConfig.Connection);
            rpContext = new RoutingProcessRelationContext(DbConfig.Connection);

            ///初始化组件
            InitCombox();
        }
Esempio n. 2
0
        public SketchRefProcess(
            string routingId,
            string operId,
            string componentName,
            IModelDoc2 doc)
        {
            InitializeComponent();
            spContent  = new SketchProcessContent(DbConfig.Connection);
            rprContext = new RoutingProcessRelationContext(DbConfig.Connection);

            _routingId     = routingId;
            _operId        = operId;
            _componentName = componentName;
            pDoc           = doc;

            CurrentSketchRefProcess = this;
        }
Esempio n. 3
0
        public ProcessLine(IModelDoc2 pDoc, ISldWorks swApp, List <string> routingIds)
        {
            _routingIds = routingIds;

            dicSketchRefProcess = new Dictionary <string, List <CSketchFileProcess> >();

            InitializeComponent();
            this.AutoSize             = true;
            this.tvProcessLine.Height = Height;
            this.pDoc  = pDoc;
            this.swApp = swApp;

            rcontext   = new RoutingContext(DbConfig.Connection);
            rprContext = new RoutingProcessRelationContext(DbConfig.Connection);
            pfrContext = new ProcessFileRoutingContext(DbConfig.Connection);

            try
            {
                var slist = (from s in pfrContext.SketchFileProcesses
                             where _routingIds.Contains(s.RoutingId) &&
                             s.ComponentName == GlobalCache.Instance.ComponetName
                             select s).ToList <CSketchFileProcess>();

                List <CSketchFileProcess> cSketchFileProcessList = null;
                slist.ForEach((x) =>
                {
                    if (dicSketchRefProcess.ContainsKey(x.RoutingId))
                    {
                        cSketchFileProcessList = dicSketchRefProcess[x.RoutingId];
                        cSketchFileProcessList.Add(x);
                        dicSketchRefProcess[x.RoutingId] = cSketchFileProcessList;
                    }
                    else
                    {
                        dicSketchRefProcess.Add(x.RoutingId, new List <CSketchFileProcess>()
                        {
                            x
                        });
                    }
                });


                var qList = (from q in rcontext.Routings
                             where _routingIds.Contains(q.RoutingId)
                             select q).ToList <Routing>();

                foreach (var r in qList)
                {
                    TreeNode tn = new TreeNode(r.Name);
                    tn.Name     = r.Code;
                    tn.Tag      = r.RoutingId;
                    tn.ImageKey = "Routing";
                    tn.Expand();
                    AddChildTreeNode(r.RoutingId, tn);
                    tvProcessLine.Nodes.Add(tn);
                }
            }
            catch
            {
                MessageBox.Show("访问数据库失败");
            }

            ///默认第一个选中的Routing
            TreeNode[] tnodes = tvProcessLine.Nodes.Find(_routingIds.FirstOrDefault(), true);
            if (tnodes != null)
            {
                SelectedCurrentRouting(
                    tnodes.FirstOrDefault <TreeNode>(),
                    _routingIds.FirstOrDefault());

                ///初始状态没有
                GlobalCache.Instance.OperId = string.Empty;
            }

            ///初始化SketchDic
            //InitSketchDic(pDoc);

            EventHelper eh = EventHelper.GetInstance();

            eh.Testing += new TestEventHandler(SeletedProcessByComponentName);

            CurrentProcessLine = this;
        }
Esempio n. 4
0
 public NewProcess(string routingId)
 {
     InitializeComponent();
     _routingId = routingId;
     rprConext  = new RoutingProcessRelationContext(DbConfig.Connection);
 }