public void DeleteCottager(Cottager cottager) { Garden garden = cottager.Garden; _UnitOfWork.CottagerDAO.delete(cottager); _UnitOfWork.GardenDAO.delete(garden); }
public CottagerInfo(Cottager cottager, double price, double cons, double tariffPrice) { _tariff = tariffPrice; _consumption = cons; _cottager = cottager; _billMoney = price; }
public void CreateCottager(Cottager cottager, Garden garden) { cottager.Id = _UnitOfWork.CottagerDAO.GetNextId(); garden.Id = _UnitOfWork.GardenDAO.GetNextId(); cottager.GardenId = garden.Id; _UnitOfWork.CottagerDAO.create(cottager); }
public void EditCottager(Cottager cottager) { _UnitOfWork.CottagerDAO.update(cottager); }
public EditCottagerViewModel(Cottager Cottager, EditCottagerView frame) { _Cottager = Cottager; _instanceWindow = frame; }
private void DoAddCmd() { Cottager cottager = new Cottager(); Garden newGarden = new Garden(); cottager.Garden = newGarden; EditCottagerView editView = new EditCottagerView(); EditCottagerViewModel editViewModel = new EditCottagerViewModel(cottager, editView); editView.DataContext = editViewModel; editView.ShowDialog(); if (editView.DialogResult.HasValue && editView.DialogResult.Value) { cottager.MonthId = _selectedMonthId; _PumpStationBL.CreateCottager(cottager, newGarden); _UnitOfWork.Commit(); RefreshList(_selectedMonthId); } }