public void add(orderitem o) { chacera_.Insert(new archeuliproduqti() { Name = o.name, Price = o.pric, Raodenoba = o.raodenoba, Gadaxdistarigi = DateTime.Now, Gadaxdilitanxa = o.raodenoba * o.pric }); }
//totalCount() funqcia unda daiceros romelic daajamebs archeul produqtebis fass //buy() unda daiceros funqcia romelic sheadarebs gadaxdil tanxas totalcountis tanxas /// <summary> /// es funqcia aketebs produqtis damatebas /// </summary> /// <param name="p">produqtis agwera</param> /// <returns></returns> public List <orderitem> DamatebaProduqtis(Product p) { if (produqtisdamateba.Any(o => o.Producti == p)) { var ProduqtisRaodenobisGazrda = produqtisdamateba.SingleOrDefault(o => o.Producti == p); ProduqtisRaodenobisGazrda.raodenoba++; //TODO gavaketo washlis punqcia } else { orderitem o = new orderitem(); o.Producti = p; produqtisdamateba.Add(o); o.name = p.Name; } return(produqtisdamateba); }
public List <orderitem> removeproduqts(orderitem p, int cbraodenoba) { produqtisdamateba.Remove(p); return(produqtisdamateba); }