public bool Create(VSkuAddForm sku) { TProdSku tSku = new TProdSku(); if (sku.Code == null) { tSku.Code = sku.Barcode; } else { tSku.Code = sku.Code; } var oldSku = wmsproduct.TProdSkus.Where(x => x.Barcode == sku.Barcode).FirstOrDefault(); if (oldSku == null) { tSku.Barcode = sku.Barcode; tSku.ProductId = sku.ProductId; tSku.ProductCode = sku.ProductCode; tSku.Season = sku.Season; tSku.Style = sku.Style; tSku.Color = sku.Color; tSku.Size = sku.Size; tSku.IsLot = sku.IsLot; tSku.IsSerial = sku.IsSerial; tSku.CreatedBy = DefaultUser.UserName; tSku.CreatedTime = DateTime.UtcNow; wmsproduct.TProdSkus.Add(tSku); return(wmsproduct.SaveChanges() > 0); } else { return(false); } }
private bool DoCheckList(int whId, int custId, int brandId, TInAsnD asnDetail, TProdSku sku) { //校验asn里面的内容和sku信息是否一致. var list = strategyService.CheckList(whId, custId, brandId); var p1 = Enum.GetName(typeof(EnumCheckSku), EnumCheckSku.Product); if (list.Contains(p1)) { if (asnDetail.ProductCode != sku.ProductCode) { throw new Exception("product code is not eqals."); } } return(true); }