//public AddEditEmailNotificationRuleModel()
        //{
        //    mEmailNotificationRule = new EmailNotificationRule();
        //    OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
        //    CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        //}
        public AddEditEmailNotificationRuleModel(string code)
        {
            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.GetPluginEmailRuleCompleted += (s1, e1) =>
            {
                cmsWebServiceClient.GetEmailTokensCompleted += (s2, e2) =>
                {
                    mEmailNotificationRule = e1.Result;
                    mEmailNotificationRuleTokens = e2.Result;
                    RaisePropertyChanged("Code");
                    RaisePropertyChanged("Name");
                    RaisePropertyChanged("SubjectText");
                    ValidateSubjectText(SubjectText);

                    RaisePropertyChanged("SendTo");
                    ValidateSentTo(SendTo);

                    RaisePropertyChanged("CcTo");
                    ValidateCC(CcTo);

                    RaisePropertyChanged("IsActive");
                    RaisePropertyChanged("AllowCCIgnore");
                    RaisePropertyChanged("Ordinal");
                    RaisePropertyChanged("SendTo");
                    RaisePropertyChanged("SendTo");
                    if (DataLoaded != null) DataLoaded();

                };
                    cmsWebServiceClient.GetEmailTokensAsync();
                };
            cmsWebServiceClient.GetPluginEmailRuleAsync(code);

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
Exemplo n.º 2
0
        public EmailNotificationRuleTokens GetIssueEmailTokens()
        {
            EmailNotificationRuleTokens tokens = new EmailNotificationRuleTokens();
            foreach (IssueEmailRecipientTextTokens token in Enum.GetValues(typeof(IssueEmailRecipientTextTokens)))
            {
                tokens.EmailRecipientTextTokens.Add(token.ToString());
            }

            foreach (IssueEmailSubjectTextTokens token in Enum.GetValues(typeof(IssueEmailSubjectTextTokens)))
            {
                tokens.EmailSubjectTextTokens.Add(token.ToString());
            }
            return tokens;
        }