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


C# IQueryable.GetArticlesByProductPartPrintableArticle方法代码示例

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


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

示例1: GetCostFromList

        public override void GetCostFromList(IQueryable<Article> articles)
        {
            //questo dovrebbe far ottenere il costo!!!!!!
            var extract = articles.GetArticlesByProductPartPrintableArticle(ProductPart.ProductPartPrintableArticles.FirstOrDefault(x => x.CodProductPartPrintableArticle == this.TaskCost.CodProductPartPrintableArticle));

            if (extract.FirstOrDefault() == null)
            {
                //se non trovo il
                throw (new NullReferenceException());
            }

            TypeOfQuantity = (int)extract.FirstOrDefault().TypeOfQuantity;
            var article = extract.FirstOrDefault();

            var aCost = article.ArticleCosts.OfType<SheetPrintableArticlePakedCost>().FirstOrDefault();
            CostPerKg = ((SheetPrintableArticleCost)aCost).CostPerKg;
            CostPerSheet = ((SheetPrintableArticleCost)aCost).CostPerSheet;
        }
开发者ID:algola,项目名称:backup,代码行数:18,代码来源:PrintedSheetArticleCostDetail.cs

示例2: GetCostFromList

        public override void GetCostFromList(IQueryable<Article> articles)
        {
            //questo dovrebbe far ottenere il costo!!!!!!
            var extract = articles.GetArticlesByProductPartPrintableArticle(ProductPart.ProductPartPrintableArticles.FirstOrDefault(x => x.CodProductPartPrintableArticle == this.TaskCost.CodProductPartPrintableArticle));

            if (extract.FirstOrDefault() == null)
            {
                //se non trovo il
                throw (new NullReferenceException());
            }

            TypeOfQuantity = (int)extract.FirstOrDefault().TypeOfQuantity;
            var article = extract.FirstOrDefault();

            var aCost = article.ArticleCosts.OfType<RigidPrintableArticleStandardCost>().FirstOrDefault();
            CostPerMq = ((RigidPrintableArticleCost)aCost).CostPerMq;

            //devo gestire qui se c'è una quadratura minima e se l'articolo deve essere arrotondato al mq successivo

        }
开发者ID:algola,项目名称:backup,代码行数:20,代码来源:PrintedRigidArticleCostDetail.cs

示例3: GetCostFromList

        public override void GetCostFromList(IQueryable<Article> articles)
        {

            List<Article> extract;

            try
            {
                var p = ProductPart.ProductPartPrintableArticles.FirstOrDefault(x => x.CodProductPartPrintableArticle == this.TaskCost.CodProductPartPrintableArticle);
                //questo dovrebbe far ottenere il costo!!!!!!
                extract = articles.GetArticlesByProductPartPrintableArticle(p).ToList();
                
                if (extract.FirstOrDefault() == null)
                {
                    throw new Exception();
                }

                TypeOfQuantity = (int)extract.FirstOrDefault().TypeOfQuantity;

                var art = extract.OfType<RollPrintableArticle>().FirstOrDefault();


                var aCost = art.ArticleCosts.OfType<RollPrintableArticleStandardCost>().FirstOrDefault();
                CostPerMq = ((RollPrintableArticleCost)aCost).GetCostPerMq();   //.CostPerMq;
                CostPerMl = ((RollPrintableArticleCost)aCost).CostPerMl;

            }
            catch (Exception)
            {
             
                //se non trovo il
                //    throw (new NullReferenceException());
                TypeOfQuantity = 3;

                CostPerMq = "0";
                CostPerMl = "0";
            }

        }
开发者ID:algola,项目名称:backup,代码行数:38,代码来源:PrintedRollArticleCostDetail.cs

示例4: CreateRelatedPrintedCostDetail

        public override List<CostDetail> CreateRelatedPrintedCostDetail(IQueryable<Article> articles, IQueryable<Cost> costs)
        {
            List<CostDetail> lst = new List<CostDetail>();

            foreach (var item in this.ProductPart.ProductPartPrintableArticles)
            {

                var xx = articles.GetArticlesByProductPartPrintableArticle(item).FirstOrDefault();

                PrintedArticleCostDetail x;

                switch (xx.TypeOfArticle)
                {
                    case Article.ArticleType.SheetPrintableArticle:
                        x = new PrintedSheetArticleCostDetail();
                        break;
                    case Article.ArticleType.RollPrintableArticle:
                        x = new PrintedRollArticleCostDetail();
                        break;
                    case Article.ArticleType.RigidPrintableArticle:
                        x = new PrintedRigidArticleCostDetail();
                        break;
                    case Article.ArticleType.ObjectPrintableArticle:
                        throw new NotImplementedException();
                        break;
                    default:
                        throw new NotImplementedException();
                        break;
                }


                x.ComputedBy = this;
                x.ProductPart = this.ProductPart;

                //devo pescare il costo e associarlo al dettaglio
                if (x.CodCost == null)
                {
                    var xxxx = costs.ToList();

                    var cost = costs.Where(pp => pp.CodProductPartPrintableArticle == item.CodProductPartPrintableArticle).FirstOrDefault();
                    //da non usare MAIIII                    x.TaskCost = cost;
                    x.CodCost = cost.CodCost;
                    x.CodCostDetail = cost.CodCost;

                    x.CostDetailCostCodeRigen();

                }

                //GUID
                x.Guid = this.Guid;
                this.Computes.Add(x);
                lst.Add(x);

            }

            return lst;
        }
开发者ID:algola,项目名称:backup,代码行数:57,代码来源:PrintingSheetCostDetail.cs


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