public StatusOfFollowUpView(FollowUpStatus followUpStatus) { InitializeComponent(); DataContext = _viewModel = new StatusOfFollowUpViewModel(followUpStatus); Loaded += OnCRMViewLoaded; Unloaded += StatusOfFollowUpView_Unloaded; }
public StatusOfFollowUpViewModel(FollowUpStatus followUpStatus) { IsDirty = false; var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>(); _adminDataUnit = dataUnitLocator.ResolveDataUnit<IAdminDataUnit>(); _followUpStatus = followUpStatus; SaveChangesCommand = new RelayCommand(SaveChangesCommandExecuted, SaveChangesCommandCanExecute); FollowUpStatus.PropertyChanged += StatusOfFollowUp_PropertyChanged; }
/// <summary> /// Deprecated Method for adding a new object to the FollowUpStatuses EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToFollowUpStatuses(FollowUpStatus followUpStatus) { base.AddObject("FollowUpStatuses", followUpStatus); }
/// <summary> /// Create a new FollowUpStatus object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="status">Initial value of the Status property.</param> /// <param name="numberOfDays">Initial value of the NumberOfDays property.</param> /// <param name="color">Initial value of the Color property.</param> /// <param name="priority">Initial value of the Priority property.</param> /// <param name="statusType">Initial value of the StatusType property.</param> public static FollowUpStatus CreateFollowUpStatus(global::System.Guid id, global::System.String status, global::System.Int32 numberOfDays, global::System.String color, global::System.Int32 priority, global::System.Int32 statusType) { FollowUpStatus followUpStatus = new FollowUpStatus(); followUpStatus.ID = id; followUpStatus.Status = status; followUpStatus.NumberOfDays = numberOfDays; followUpStatus.Color = color; followUpStatus.Priority = priority; followUpStatus.StatusType = statusType; return followUpStatus; }
private async void AddTODOStatusCommandExecuted() { var status = new FollowUpStatus { Color = "#808080", ID = Guid.NewGuid(), NumberOfDays = 0, Priority = 1, Status = "New TODO Status", StatusType = Convert.ToInt32(StatusType.ToDosStatus) }; _adminDataUnit.FollowUpStatusesRepository.Add(status); await _adminDataUnit.SaveChanges(); TODOStatuses.Add(status); SelectedObject = status; IsToDoStatusesTreeExpanded = true; }