public AddEditIssueLearningDialog(IssueLearning issueLearning)
        {
            InitializeComponent();

            Title = @"Edit Learning";
            AddEditIssueLearningModel viewModel = new AddEditIssueLearningModel(issueLearning);
            DataContext = viewModel;
            viewModel.ViewModelLoaded += () => Utils.ResetOriginalValues(this);
        }
Exemplo n.º 2
0
        public AddEditIssueLearningModel(Issue issue)
        {
            CompositionInitializer.SatisfyImports(this);

            mIssueLearning = new IssueLearning();
            mIssue = issue;
            mIssueLearning.InitiatedByUserId = CMS.User.Id;
            mIssueLearning.InitiatedByDate = DateTime.Now;
            mIssueLearning.IssueId = mIssue.Id;

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
Exemplo n.º 3
0
        public AddEditIssueLearningModel(IssueLearning issueLearning)
        {
            CompositionInitializer.SatisfyImports(this);

            mIssueLearning = issueLearning;

            IssueLearning = new IssueLearning();//need for the clone to work...
            IssueLearning = issueLearning;
            CommonUtils.CloneObject(mIssueLearning, IssueLearning, "Id");

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
Exemplo n.º 4
0
        private void SaveIssueLearnings(Issue issue, Issue originalIssue, CmsEntities cee)
        {
            log.Verbose("SaveIssueLearnings()");
            //Delete
            cee.DeleteWhere<IssueLearning>(cee, x => x.IssueId == issue.Id);

            cee.Configuration.AutoDetectChangesEnabled = false;
            foreach (IssueLearning issueLearning in issue.IssueLearnings.ToList())
            {
                var newIssueLearning = new IssueLearning
                {
                    IssueId = issue.Id,
                    Description = issueLearning.Description,
                    InitiatedByUserId = issueLearning.InitiatedByUserId,
                    InitiatedByDate = issueLearning.InitiatedByDate,
                    Outcome = issueLearning.Outcome,
                    Affected = issueLearning.Affected,
                    FutureLearningOpportunity = issueLearning.FutureLearningOpportunity,
                    Notes = issueLearning.Notes,
                };

                originalIssue.IssueLearnings.Add(newIssueLearning);
            }
            cee.Configuration.AutoDetectChangesEnabled = true;
        }