private void DeleteEPOSCommandExecuted() { bool?dialogResult = null; RaisePropertyChanged("DisableParentWindow"); RadWindow.Confirm(Properties.Resources.MESSAGE_ASK_BEFORE_DELETING_ITEM, (sender, args) => { dialogResult = args.DialogResult; }); RaisePropertyChanged("EnableParentWindow"); if (dialogResult != true) { return; } if (SelectedTreeViewObject is TillModel) { var till = SelectedTreeViewObject as TillModel; var tillDiv = TillDivisions.Where(tillDivision => tillDivision.TillDivision.ID == till.Till.TillDivision.ID).FirstOrDefault(); if (tillDiv.TillDivision.MasterTillID == till.Till.ID) { tillDiv.TillDivision.MasterTillID = null; } tillDiv.Tills.Remove(till); _adminDataUnit.TillsRepository.Delete(till.Till); _adminDataUnit.SaveChanges(); } Content = null; }
private void AddTillCommandExecuted() { RaisePropertyChanged("DisableParentWindow"); var addTillView = new AddTillView(TillDivisions); addTillView.ShowDialog(); if (addTillView.DialogResult != null && addTillView.DialogResult == true) { var tillDivision = TillDivisions.Where(p => p.TillDivision.ID == addTillView.ViewModel.Till.TillDivision.ID).FirstOrDefault(); if (tillDivision != null) { tillDivision.Tills.Add(addTillView.ViewModel.Till); } RefreshTills(addTillView.ViewModel.Till); } RaisePropertyChanged("EnableParentWindow"); }