private void AddActivityCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddActivityView(Enquiry);
            window.ShowDialog();
            if (window.DialogResult != null && window.DialogResult.Value)
            {
                Enquiry.Activities = new ObservableCollection<ActivityModel>(Enquiry.Activities.OrderByDescending(x => x.Date));
            }
            RaisePropertyChanged("EnableParentWindow");
        }
 private void EditActivityCommandExecuted(ActivityModel item)
 {
     RaisePropertyChanged("DisableParentWindow");
     _originalActivity = item.Clone();
     var window = new AddActivityView(Enquiry, item);
     window.ShowDialog();
     if (window.DialogResult != null && !window.DialogResult.Value)
     {
         item.ActivityType.ID = _originalActivity.ActivityType.ID;
         item.Details = _originalActivity.Details;
         item.Direction = _originalActivity.Direction;
         item.Length = _originalActivity.Length;
         item.Date = _originalActivity.Date;
         //item.FollowUp = _originalActivity.FollowUp;
         
         item.Refresh();
     }
     else
     {
         Enquiry.Activities = new ObservableCollection<ActivityModel>(Enquiry.Activities.OrderByDescending(x => x.Date));
     }
     RaisePropertyChanged("EnableParentWindow");
 }
Example #3
0
        private void EditActivityCommandExecute(ActivityModel item)
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddActivityView(_allEnquiries, item);
            window.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            item.Refresh();

            if (window.DialogResult == null || window.DialogResult != true) return;

            ReloadEnquiries();
        }
Example #4
0
        private void AddActivityCommandExecuted()
        {
            RaisePropertyChanged("DisableParentWindow");

            var window = new AddActivityView(_allEnquiries, null);
            window.ShowDialog();

            RaisePropertyChanged("EnableParentWindow");

            if (window.DialogResult != null && window.DialogResult == true)
            {
                _allActivities.Add(window.ViewModel.Activity);
                Activities = new ObservableCollection<ActivityModel>(_allActivities);

                if (window.ViewModel.Activity.HasFollowUp)
                    FollowUps.Add(window.ViewModel.Activity.FollowUp);

                var enquiry =
                _allEnquiries.First(x => x.Enquiry.ID == window.ViewModel.Activity.Activity.EnquiryID);
                enquiry.Activities.Add(window.ViewModel.Activity);

            }
        }