本文整理汇总了C#中ProductRepository.GetNewCode方法的典型用法代码示例。如果您正苦于以下问题:C# ProductRepository.GetNewCode方法的具体用法?C# ProductRepository.GetNewCode怎么用?C# ProductRepository.GetNewCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProductRepository
的用法示例。
在下文中一共展示了ProductRepository.GetNewCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditProductJustDocument
public void EditProductJustDocument()
{
var inizio = DateTime.Now;
IDocumentRepository docRep = new DocumentRepository();
IProductRepository prodRep = new ProductRepository();
PapiroService p = new PapiroService();
p.DocumentRepository = docRep;
p.CostDetailRepository = new CostDetailRepository();
p.TaskExecutorRepository = new TaskExecutorRepository();
p.ArticleRepository = new ArticleRepository();
Document doc = docRep.GetEstimateEcommerce("000001");
doc.EstimateNumber = "0";
DocumentProduct dp = docRep.GetDocumentProductsByCodProduct("").FirstOrDefault();
//work with product
Product prod = p.InitProduct("SuppRigidi", new ProductTaskNameRepository(), new FormatsNameRepository(), new TypeOfTaskRepository());
//------passaggio del prodotto inizializzato all'ecommerce o alla view
prod.CodProduct = prodRep.GetNewCode(prod);
prod.ProductParts.FirstOrDefault().Format = "15x21";
prod.ProductParts.FirstOrDefault().SubjectNumber = 1;
var art = prod.ProductParts.FirstOrDefault().ProductPartPrintableArticles.FirstOrDefault();
#region Printable Article
IArticleRepository artRep = new ArticleRepository();
var artFormList = artRep.GetAll().OfType<RigidPrintableArticle>().FirstOrDefault();
art.TypeOfMaterial = artFormList.TypeOfMaterial;
art.NameOfMaterial = artFormList.NameOfMaterial;
art.Weight = artFormList.Weight;
art.Color = artFormList.Color;
#endregion
//------ritorno del prodotto modificato!!!!
//rigenero
prodRep.Add(prod);
prodRep.Save();
#region ViewModel
ProductViewModel pv = new ProductViewModel();
pv.Product = prod;
// prod.ProductCodeRigen();
pv.Quantity = 10;
#endregion
p.EditOrCreateAllCost(dp.CodDocumentProduct);
var fine = DateTime.Now.Subtract(inizio).TotalSeconds;
Assert.IsTrue(fine < 4);
}