예제 #1
0
        public void AddSaleItems(Mehsul mehsul, int count)
        {
            Mehsul     mehsul1    = new Mehsul(mehsul.Name, mehsul.Price, mehsul.Kateqoriya, mehsul.Count, mehsul.Kod);
            SalesItems salesItems = new SalesItems(mehsul1)
            {
                Count = count
            };


            foreach (var item in Sales)
            {
                if (item.No == Helper.FindSalesNo())
                {
                    item.SalesItems.Add(salesItems);
                    item.TotalAmount += mehsul.Price * count;
                    mehsul.Count     -= count;
                    foreach (var salesitems in item.SalesItems)
                    {
                        if (salesitems.No == Helper.FindSalesItemDynamicNo())
                        {
                            salesitems.Count = count;
                        }
                    }
                }
            }
        }
예제 #2
0
        public static SalesItems FindSalesItemsBySalesNo(int no, int salesitemno)
        {
            Satis satis = Program.MarketMenu.Sales.Find(n => n.No == no);

            SalesItems salesItems = satis.SalesItems.Find(n => n.No == salesitemno);

            return(salesItems);
        }
예제 #3
0
        public void AddNewSale(Mehsul mehsuls, int count)
        {
            Mehsul mehsul = new Mehsul(mehsuls.Name, mehsuls.Price, mehsuls.Kateqoriya, mehsuls.Count, mehsuls.Kod);

            if (count > 0 && Products.Exists(p => p.Kod == mehsul.Kod))
            {
                SalesItems salesItems = new SalesItems(mehsul)
                {
                    Count = count
                };
                List <SalesItems> salesItemsList = new List <SalesItems>();
                salesItemsList.Add(salesItems);
                Satis satis = new Satis(salesItemsList);

                Sales.Add(satis);
                mehsuls.Count -= count;
            }
        }