示例#1
0
        /// <summary>
        /// 获取form
        /// </summary>
        /// <param name="RelationObjectType"></param>
        /// <param name="objectID"></param>
        /// <returns></returns>
        public static Form GetDetaiFrm(DataType.RelationObjectType RelationObjectType, string objectID)
        {
            Form FrmDetail = null;
            string tableName = DataType.GetTableName(RelationObjectType);
            switch (RelationObjectType)
            {
                case DataType.RelationObjectType.Document:
                    {
                        IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                        HYPDM.WinUI.Document.DocRegForm frm = new Document.DocRegForm(true);
                        frm.Document = _docService.GetDocListByID(objectID)[0];
                        frm.StartPosition = FormStartPosition.CenterParent;
                        FrmDetail = frm;
                        break;
                    }
                case DataType.RelationObjectType.File:
                    {
                        //tableName = "DOC_FILE_LIST";
                        break;
                    }
                case DataType.RelationObjectType.Material:
                    {
                        //tableName = "PDM_MATERAIL";

                        HYPDM.WinUI.ProductsAndParts.Material.MaterialConfForm frm = new ProductsAndParts.Material.MaterialConfForm(objectID, 1, true);  //2为半成品  1为成品
                        //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                        //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();
                        FrmDetail = frm;
                        frm.StartPosition = FormStartPosition.CenterParent;
                        break;
                    }
                case DataType.RelationObjectType.Product:
                    {
                        // tableName = "PDM_ALL_PRODUCT";  //PRODUCTLEVEL为1的时候表示是产品
                        HYPDM.WinUI.ProductsAndParts.Products.ProductsConfForm frm = new ProductsAndParts.Products.ProductsConfForm(objectID, 1, true);  //2为半成品  1为成品
                        //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                        //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();
                        FrmDetail = frm;
                        frm.StartPosition = FormStartPosition.CenterParent;

                        break;
                    }
                case DataType.RelationObjectType.SemiProduct:
                    {
                        //tableName = "PDM_ALL_PRODUCT"; //PRODUCTLEVEL为2的时候表示是半产品
                        HYPDM.WinUI.ProductsAndParts.Products.ProductsConfForm frm = new ProductsAndParts.Products.ProductsConfForm(objectID, 2, true);  //2为半成品  1为成品
                        //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                        //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();

                        //frm.Product = m_AllProductService.GetById(objectID);

                        frm.StartPosition = FormStartPosition.CenterParent;
                        FrmDetail = frm;
                        break;
                    }
                case DataType.RelationObjectType.Drawing:
                    {
                        IDRAWINGService _docService = ServiceContainer.GetService<DRAWINGService>();
                        HYPDM.WinUI.DrawingDocument.DrawRegForm frm = new DrawingDocument.DrawRegForm(true);
                        frm.Document = _docService.GetDrawObjectDCID(objectID);
                        frm.StartPosition = FormStartPosition.CenterParent;
                        FrmDetail = frm;
                        break;
                    }
                default:
                    {
                        // tableName = "";
                        break;
                    }
            }
            return FrmDetail;
        }
示例#2
0
 private void tsb_DocLook_Click(object sender, EventArgs e)
 {
     Document.DocRegForm o = new Document.DocRegForm(true);
     o.StartPosition = FormStartPosition.CenterParent;
     o.ShowDialog();
 }
示例#3
0
 private void tsb_DocLook_Click(object sender, EventArgs e)
 {
     Document.DocRegForm o = new Document.DocRegForm(true);
     o.StartPosition = FormStartPosition.CenterParent;
     o.ShowDialog();
 }
示例#4
0
文件: WorkFlow.cs 项目: leedaga/HYPDM
        /// <summary>
        /// 获取form
        /// </summary>
        /// <param name="RelationObjectType"></param>
        /// <param name="objectID"></param>
        /// <returns></returns>
        public static Form GetDetaiFrm(DataType.RelationObjectType RelationObjectType, string objectID)
        {
            Form   FrmDetail = null;
            string tableName = DataType.GetTableName(RelationObjectType);

            switch (RelationObjectType)
            {
            case DataType.RelationObjectType.Document:
            {
                IDocumentService _docService        = ServiceContainer.GetService <DocumentService>();
                HYPDM.WinUI.Document.DocRegForm frm = new Document.DocRegForm(true);
                frm.Document      = _docService.GetDocListByID(objectID)[0];
                frm.StartPosition = FormStartPosition.CenterParent;
                FrmDetail         = frm;
                break;
            }

            case DataType.RelationObjectType.File:
            {
                //tableName = "DOC_FILE_LIST";
                break;
            }

            case DataType.RelationObjectType.Material:
            {
                //tableName = "PDM_MATERAIL";

                HYPDM.WinUI.ProductsAndParts.Material.MaterialConfForm frm = new ProductsAndParts.Material.MaterialConfForm(objectID, 1, true);          //2为半成品  1为成品
                //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();
                FrmDetail         = frm;
                frm.StartPosition = FormStartPosition.CenterParent;
                break;
            }

            case DataType.RelationObjectType.Product:
            {
                // tableName = "PDM_ALL_PRODUCT";  //PRODUCTLEVEL为1的时候表示是产品
                HYPDM.WinUI.ProductsAndParts.Products.ProductsConfForm frm = new ProductsAndParts.Products.ProductsConfForm(objectID, 1, true);          //2为半成品  1为成品
                //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();
                FrmDetail         = frm;
                frm.StartPosition = FormStartPosition.CenterParent;

                break;
            }

            case DataType.RelationObjectType.SemiProduct:
            {
                //tableName = "PDM_ALL_PRODUCT"; //PRODUCTLEVEL为2的时候表示是半产品
                HYPDM.WinUI.ProductsAndParts.Products.ProductsConfForm frm = new ProductsAndParts.Products.ProductsConfForm(objectID, 2, true);          //2为半成品  1为成品
                //IDocumentService _docService = ServiceContainer.GetService<DocumentService>();
                //IAllProductService m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();

                //frm.Product = m_AllProductService.GetById(objectID);

                frm.StartPosition = FormStartPosition.CenterParent;
                FrmDetail         = frm;
                break;
            }

            case DataType.RelationObjectType.Drawing:
            {
                IDRAWINGService _docService = ServiceContainer.GetService <DRAWINGService>();
                HYPDM.WinUI.DrawingDocument.DrawRegForm frm = new DrawingDocument.DrawRegForm(true);
                frm.Document      = _docService.GetDrawObjectDCID(objectID);
                frm.StartPosition = FormStartPosition.CenterParent;
                FrmDetail         = frm;
                break;
            }

            default:
            {
                // tableName = "";
                break;
            }
            }
            return(FrmDetail);
        }