Esempio n. 1
0
        public void DeleteDetail(string PName)
        {
            PurchaseDetail pod = PDetails.Where(x => x.ProductName == PName).FirstOrDefault();

            if (pod != null)
            {
                PDetails.Remove(pod);
                ItemAmount = PDetails.Sum(x => x.Amount);
            }
        }
Esempio n. 2
0
        public void SaveDetail()
        {
            if (PDetail.ProductId != 0)
            {
                PurchaseDetail pod = PDetails.Where(x => x.ProductId == PDetail.ProductId).FirstOrDefault();

                if (pod == null)
                {
                    pod = new PurchaseDetail();
                    PDetails.Add(pod);
                }
                else
                {
                    PDetail.Quantity += pod.Quantity;
                }
                PDetail.toCopy <PurchaseDetail>(pod);
                ClearDetail();
                ItemAmount = PDetails.Sum(x => x.Amount);
            }
        }
Esempio n. 3
0
        public void ClearDetail()
        {
            PurchaseDetail pod = new PurchaseDetail();

            pod.toCopy <PurchaseDetail>(PDetail);
        }