예제 #1
0
        public void DeleteCottager(Cottager cottager)
        {
            Garden garden = cottager.Garden;
            _UnitOfWork.CottagerDAO.delete(cottager);
            _UnitOfWork.GardenDAO.delete(garden);

        }
예제 #2
0
 public CottagerInfo(Cottager cottager, double price, double cons, double tariffPrice)
 {
     _tariff = tariffPrice;
     _consumption = cons;
     _cottager = cottager;
     _billMoney = price;
 }
예제 #3
0
        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);
        }
예제 #4
0
 public void EditCottager(Cottager cottager)
 {
     _UnitOfWork.CottagerDAO.update(cottager);
 }
예제 #5
0
 public EditCottagerViewModel(Cottager Cottager, EditCottagerView frame)
 {
     _Cottager = Cottager;
     _instanceWindow = frame;
 }
예제 #6
0
        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);
            }

        }