当前位置: 首页>>代码示例>>C#>>正文


C# IProduct.AddPart方法代码示例

本文整理汇总了C#中IProduct.AddPart方法的典型用法代码示例。如果您正苦于以下问题:C# IProduct.AddPart方法的具体用法?C# IProduct.AddPart怎么用?C# IProduct.AddPart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProduct的用法示例。


在下文中一共展示了IProduct.AddPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: combineCDSI

        private void combineCDSI(Session session,IProduct product, IPart part, string checkItemType, string avPartNo )
            {
                var prodRep = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

                string AST1 = "";
                CdsiastInfo cdi = new CdsiastInfo();
                cdi.tp = "ASSET_TAG";
                cdi.snoId = product.ProId;
                IList<CdsiastInfo> cdsiastInfoList = prodRep.GetCdsiastInfoList(cdi);
                if (cdsiastInfoList != null && cdsiastInfoList.Count > 0)
                {
                    AST1 = cdsiastInfoList[0].sno;
                }

                string AST2 = "";
                CdsiastInfo cdi2 = new CdsiastInfo();
                cdi2.tp = "ASSET_TAG2";
                cdi2.snoId = product.ProId;
                IList<CdsiastInfo> cdsiastInfoList2 = prodRep.GetCdsiastInfoList(cdi2);
                if (cdsiastInfoList2 != null && cdsiastInfoList2.Count > 0)
                {
                    AST2 = cdsiastInfoList2[0].sno;
                }

                if ((AST1 == "") && (AST2 == ""))
                {
                    List<string> errpara = new List<string>();
                    throw new FisException("CHK203", errpara);
                }
                else
                {
                    //不为空则存入
                    //保存product和Asset SN的绑定关系
                   if (AST1 != "")
                   {
                           IProductPart assetTag1 = new ProductPart();
                            assetTag1.ProductID = product.ProId;
                            assetTag1.PartID = part.PN;
                            assetTag1.PartType = part.Descr;
                            assetTag1.Iecpn = "";
                            assetTag1.CustomerPn = avPartNo;
                            assetTag1.PartSn = AST1;
                            assetTag1.Station = this.Station;
                            assetTag1.Editor = this.Editor;
                            assetTag1.Cdt = DateTime.Now;
                            assetTag1.Udt = DateTime.Now;
                            assetTag1.BomNodeType = part.BOMNodeType;
                            assetTag1.CheckItemType = checkItemType;

                            product.AddPart(assetTag1);
                            prodRep.Update(product, session.UnitOfWork);
                    }

                    if (AST2 != "")
                    {
                        IProductPart assetTag2 = new ProductPart();
                        assetTag2.ProductID = product.ProId;
                        assetTag2.PartID = part.PN;
                        assetTag2.PartType = part.Descr;
                        assetTag2.Iecpn = "";
                        assetTag2.CustomerPn = avPartNo;
                        assetTag2.PartSn = AST2;
                        assetTag2.Station = this.Station;
                        assetTag2.Editor = this.Editor;
                        assetTag2.Cdt = DateTime.Now;
                        assetTag2.Udt = DateTime.Now;
                        assetTag2.BomNodeType = part.BOMNodeType;
                        assetTag2.CheckItemType = checkItemType;

                        product.AddPart(assetTag2);
                        prodRep.Update(product, session.UnitOfWork);
                    }

                    session.AddValue("AST1", AST1);
                    session.AddValue("AST2", AST2);

                    //2012-5-2
                    string ASTinfo = "";
                    if (!string.IsNullOrEmpty(AST1) && !string.IsNullOrEmpty(AST2))
                    {
                        ASTinfo += AST1 + ", " + AST2;
                    }
                    else if (!string.IsNullOrEmpty(AST1) && string.IsNullOrEmpty(AST2))
                    {
                        ASTinfo = AST1;
                    }
                    else if (string.IsNullOrEmpty(AST1) && !string.IsNullOrEmpty(AST2))
                    {
                        ASTinfo = AST2;
                    }
                    session.AddValue("ASTInfo", ASTinfo);
                }
            }
开发者ID:wra222,项目名称:testgit,代码行数:93,代码来源:CheckAndGenerateATSN.cs


注:本文中的IProduct.AddPart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。