예제 #1
0
        private void grdRouters_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(WorkUnit)))
            {
                WorkUnit source = (WorkUnit)e.Data.GetData(typeof(WorkUnit));

                // 获取鼠标拖放位置
                point = grdRouters.PointToClient(new Point(e.X, e.Y));
                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi = grdvRouters.CalcHitInfo(point);

                if (hi.RowHandle >= 0 && hi.RowHandle < routers.Count)
                {
                    if (hi.Column == grdclmnCurrWorkUnit)
                    {
                        if (routers[hi.RowHandle].NextWorkUnit.T107LeafID == source.T107LeafID)
                        {
                            XtraMessageBox.Show("当前工位和下一工位不能是相同的工位!",
                                                "系统信息",
                                                MessageBoxButtons.OK,
                                                MessageBoxIcon.Error);
                        }
                        else
                        {
                            routers[hi.RowHandle].CurrWorkUnit = source.Clone();
                            ArrangeReworkRouters();
                        }
                    }
                    else if (hi.Column == grdclmnPrevWorkUnit)
                    {
                        if (routers[hi.RowHandle].CurrWorkUnit.T107LeafID == source.T107LeafID)
                        {
                            XtraMessageBox.Show("当前工位和下一工位不能是相同的工位!",
                                                "系统信息",
                                                MessageBoxButtons.OK,
                                                MessageBoxIcon.Error);
                        }
                        else
                        {
                            routers[hi.RowHandle].NextWorkUnit = source.Clone();
                            ArrangeReworkRouters();
                        }
                    }
                }
                else
                {
                    GUIReworkRouter router = new GUIReworkRouter()
                    {
                        CurrWorkUnit = source.Clone()
                    };
                    routers.Add(router);
                    grdvRouters.FocusedRowHandle = routers.Count - 1;
                    ArrangeReworkRouters();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 获取指定返工工单的返工路由表
        /// </summary>
        private void GetPWOReworkRoutingTBL()
        {
            string strProcedureName = string.Format("{0}.{1}",
                                                    className,
                                                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                List <ReworkRouter> reworkRoutingTBL = new List <ReworkRouter>();
                if (pwo != null)
                {
                    WriteLog.Instance.Write("获取指定返工工单的返工路由表", strProcedureName);
                    try
                    {
                        int    errCode = 0;
                        string errText = "";

                        IRAPMESClient.Instance.ufn_GetReworkRoutingTBL(
                            IRAPUser.Instance.CommunityID,
                            pwo.TF482PK,
                            pwo.PWOIssuingFactID,
                            IRAPUser.Instance.SysLogID,
                            ref reworkRoutingTBL,
                            out errCode,
                            out errText);
                        WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);

                        if (errCode == 0 && reworkRoutingTBL.Count > 0)
                        {
                            foreach (ReworkRouter router in reworkRoutingTBL)
                            {
                                GUIReworkRouter guiRouter = new GUIReworkRouter();
                                guiRouter.Ordinal      = router.Ordinal;
                                guiRouter.CurrWorkUnit = GetWorkUnitWithLeafID(router.T107LeafID1);
                                guiRouter.NextWorkUnit = GetWorkUnitWithLeafID(router.T107LeafID2);

                                routers.Add(guiRouter);
                            }
                            ArrangeReworkRouters();
                        }
                    }
                    catch (Exception error)
                    {
                        WriteLog.Instance.Write(error.Message, strProcedureName);
                    }
                }
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }
예제 #3
0
        private void miMoveDown_Click(object sender, EventArgs e)
        {
            int index = grdvRouters.GetFocusedDataSourceRowIndex();

            if (index >= 0 && index < routers.Count)
            {
                GUIReworkRouter router = routers[index];
                routers.Remove(router);
                routers.Insert(index + 1, router);

                ArrangeReworkRouters();
            }
        }