Пример #1
0
        public void SaveDetail()
        {
            if (SODetail.ProductId != 0)
            {
                SalesOrderDetail pod = SODetails.Where(x => x.ProductId == SODetail.ProductId).FirstOrDefault();

                if (pod == null)
                {
                    pod = new SalesOrderDetail();
                    SODetails.Add(pod);
                }
                else
                {
                    SODetail.Quantity += pod.Quantity;
                }
                SODetail.toCopy<SalesOrderDetail>(pod);
                ClearDetail();
                ItemAmount = SODetails.Sum(x => x.Amount);
            }

        }