Ejemplo n.º 1
0
        public void DeleteDetail(string PName)
        {
            SalesReturnDetail pod = SRDetails.Where(x => x.ProductName == PName).FirstOrDefault();

            if (pod != null)
            {
                SRDetails.Remove(pod);
                ItemAmount = SRDetails.Sum(x => x.Amount);
            }
        }
Ejemplo n.º 2
0
        public void SaveDetail()
        {
            if (SRDetail.ProductId != 0)
            {
                SalesReturnDetail pod = SRDetails.Where(x => x.ProductId == SRDetail.ProductId).FirstOrDefault();

                if (pod == null)
                {
                    pod = new SalesReturnDetail();
                    SRDetails.Add(pod);
                }
                else
                {
                    SRDetail.Quantity += pod.Quantity;
                }
                SRDetail.toCopy <SalesReturnDetail>(pod);
                ClearDetail();
                ItemAmount = SRDetails.Sum(x => x.Amount);
            }
        }