private bool CancelDataIsDirty()
        {
            if (!IsDirty || ForecastMonthIsLocked)
            {
                return(false);
            }

            var msg = new StringBuilder()
                      .AppendLine("If you continue, unsaved data will be lost!")
                      .AppendLine()
                      .AppendLine("Continue?");

            return(!_commonDialogs.ContinueWarning(msg.ToString(), "Unsaved changes"));
        }
Example #2
0
        /// <summary>
        /// If data exists ask user to continue
        /// </summary>
        /// <param name="vm"></param>
        /// <returns></returns>
        public bool ShouldContinue(IForecastRegistrationViewModel vm)
        {
            if (vm.ProjectRegistrations.Count == 0 && vm.PresenceRegistrations.All(x => (x.SelectedForecastType.Equals(_forecastTypeProvider.Default))))
            {
                return(true);
            }

            return(_commonDialogs.ContinueWarning("Data already exists for this month!\n\nContinue with overwrite?", "Overwrite"));
        }
        public void Execute(IForecastRegistrationViewModel vm)
        {
            var msg = new StringBuilder()
                      .AppendLine("All unsaved changes will be lost!")
                      .AppendLine()
                      .AppendLine("Continue with reset?");

            if (!_commonDialogs.ContinueWarning(msg.ToString(), "Reset"))
            {
                return;
            }

            vm.RefreshViewData();
        }