public ObservableCollection<Location> GetBySiteIDComboBox(int siteID) { var locations = new UnitOfWork().LocationRepository.Get(o => o.SiteID == siteID); _list = new ObservableCollection<Location>(locations); Location all = new Location(); all.LocationName = "All Loactions"; all.row_id = -1; _list.Insert(0, all); return _list; }
private void LoadCustomerRadioButtonList() { List<CustomRadioButton> list = new List<CustomRadioButton>(); var customers = new UnitOfWork().CustomerRepository.Get(); foreach (var customer in customers) { if (customer.row_id == _selectedCustomer.row_id) { list.Add(new CustomRadioButton(customer.row_id, customer.BusinessName, true)); } else { list.Add(new CustomRadioButton(customer.row_id, customer.BusinessName)); } } RadioButtonList = list; }
private void OnSave(object obj) { var unitOfWork = new UnitOfWork(); unitOfWork.SiteRepository.Update(_site); unitOfWork.Save(); OnClose(null); }
private void OnSave(object obj) { var unitOfWork = new UnitOfWork(); unitOfWork.CustomerRepository.Update(_customer); unitOfWork.Save(); OnClose(null); }
// by Fred, 2-5-2013 #region Command Method // command function, called by the xxxCommand.Execute.cs private void OnSave(object o) { var unitOfWork = new UnitOfWork(); unitOfWork.EquipmentRepository.Update(o as Equipment); unitOfWork.Save(); BackToSiteTabEquipment(); }