示例#1
0
 public EventCreationViewModel(long channelId, ObservableCollection <ImportanceDto> importanceScale, SchedulerClient client)
 {
     _client          = client;
     _importanceScale = importanceScale;
     _errors          = new EventErrors();
     _event           = new EventCrDto();
     _event.EventTime = DateTime.Now;
     _event.ChannelId = channelId;
 }
示例#2
0
        private void DisplayResult(CrResultOfEventDtoGvCn2ESm res)
        {
            if (res.ActionResult != Auth.ActionResult.Success)
            {
                ForegroundColor = System.Windows.Media.Brushes.Red;
                ActionResult    = res.ActionResult.ToString();
                if (res.ActionResult == Auth.ActionResult.IncorrectParameter)
                {
                    foreach (var error in res.Errors)
                    {
                        switch (error.Variable)
                        {
                        case "Title":
                            Errors.TitleError = error.CheckStatus.ToString(); break;

                        case "Description":
                            Errors.DescriptionError = error.CheckStatus.ToString(); break;

                        case "EventTime":
                            Errors.EventTimeError = error.CheckStatus.ToString(); break;

                        case "Importance":
                            Errors.ImportanceError = error.CheckStatus.ToString(); break;

                        default: Errors.ImportanceError = error.CheckStatus.ToString(); break;
                        }
                    }
                }
            }
            else
            {
                ForegroundColor = System.Windows.Media.Brushes.Green;
                ActionResult    = "Creation successful";
                Errors          = new EventErrors();
            }
        }
示例#3
0
 public TalkValidator(ITalkPluginConfigurationProvider config)
 {
     If(x => x[config.DateField].HasValue() && !x[config.DateField].IsDate())
     .AddNotification(EventErrors.InvalidDate(config.DateField));
 }