private void EditItemCommandExecuted(EventItemModel item) { RaisePropertyChanged("DisableParentWindow"); if (item.Instance.GetType() == typeof(EventCateringModel)) { var model = (EventCateringModel)item.Instance; var window = new AddCateringItemView(Event, model); window.ShowDialog(); if (window.DialogResult != null && window.DialogResult.Value) { _event.Event.LastEditDate = DateTime.Now; _event.RefreshItems(); } } else if (item.Instance.GetType() == typeof(EventGolfModel)) { var model = (EventGolfModel)item.Instance; var window = new AddEventGolfItemView(Event, model); window.ShowDialog(); if (window.DialogResult != null && window.DialogResult.Value) { _event.Event.LastEditDate = DateTime.Now; _event.RefreshItems(); } } else if (item.Instance.GetType() == typeof(EventRoomModel)) { var model = (EventRoomModel)item.Instance; var window = new AddRoomItemView(Event, model); window.ShowDialog(); if (window.DialogResult != null && window.DialogResult.Value) { _event.Event.LastEditDate = DateTime.Now; _event.RefreshItems(); } } else if (item.Instance.GetType() == typeof(EventInvoiceModel)) { var model = (EventInvoiceModel)item.Instance; var window = new AddEventInvoiceItemView(Event, model); window.ShowDialog(); if (window.DialogResult != null && window.DialogResult.Value) { _event.Event.LastEditDate = DateTime.Now; _event.RefreshItems(); } } RaisePropertyChanged("EnableParentWindow"); }
private void AddInvoiceCommandExecuted() { RaisePropertyChanged("DisableParentWindow"); var window = new AddEventInvoiceItemView(Event); window.ShowDialog(); RaisePropertyChanged("EnableParentWindow"); if (window.DialogResult != null && window.DialogResult.Value) { _event.Event.LastEditDate = DateTime.Now; _event.RefreshItems(); } }