protected override void Execute(CodeActivityContext executionContext)
        {
            ITracingService tracingService = executionContext.GetExtension <ITracingService>();

            IWorkflowContext            context        = executionContext.GetExtension <IWorkflowContext>();
            IOrganizationServiceFactory serviceFactory = executionContext.GetExtension <IOrganizationServiceFactory>();
            IOrganizationService        service        = serviceFactory.CreateOrganizationService(context.UserId);
            string TafqitOutput =
                new ToWord(DecimalArgument.Get <Decimal>(executionContext),
                           new CurrencyInfo(
                               CurrencyInfo.GetCurrencyInfoFromOptionSetValue(
                                   TafqitTypeArgument.Get <OptionSetValue>(executionContext).Value)), false).ConvertToArabic();

            TafqitStringOutputOutArgument.Set(executionContext, TafqitOutput);
        }
Exemplo n.º 2
0
        protected override void Execute(CodeActivityContext context)
        {
            ITracingService             ITracingService             = context.GetExtension <ITracingService>();
            IWorkflowContext            IWorkflowContext            = context.GetExtension <IWorkflowContext>();
            IOrganizationServiceFactory IOrganizationServiceFactory = context.GetExtension <IOrganizationServiceFactory>();
            IOrganizationService        IOrganizationService        = IOrganizationServiceFactory.CreateOrganizationService(IWorkflowContext.UserId);

            try
            {
                int     currencyValue   = TafqitTypeArgument.Get <OptionSetValue>(context).Value;
                decimal numberInDecimal = numberToConvert.Get(context);
                double  number          = Convert.ToDouble(numberInDecimal);
                string  convertedAmount = NumberToWords(number, currencyValue);
                if (!string.IsNullOrEmpty(convertedAmount))
                {
                    convertedWord.Set(context, convertedAmount);
                }
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException(ex.Message);
            }
        }