当前位置: 首页>>代码示例>>C#>>正文


C# ActionData.GetAsInteger方法代码示例

本文整理汇总了C#中ActionData.GetAsInteger方法的典型用法代码示例。如果您正苦于以下问题:C# ActionData.GetAsInteger方法的具体用法?C# ActionData.GetAsInteger怎么用?C# ActionData.GetAsInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActionData的用法示例。


在下文中一共展示了ActionData.GetAsInteger方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process

        public override void Process(ActionData actionData)
        {
            var settingName = actionData.GetAsString("SettingName");
            var updateType = actionData.GetAsString("UpdateType");
            if (!string.IsNullOrEmpty(settingName))
            {
                var isLocal = actionData.GetAsBoolean("IsLocal");
                var setting = isLocal
                    ? _settingService.ReadLocalSetting(settingName)
                    : _settingService.ReadGlobalSetting(settingName);

                if (updateType == Resources.Increase)
                {
                    var settingValue = actionData.GetAsInteger("SettingValue");
                    if (string.IsNullOrEmpty(setting.StringValue))
                        setting.IntegerValue = settingValue;
                    else
                        setting.IntegerValue = setting.IntegerValue + settingValue;
                }
                else if (updateType == Resources.Decrease)
                {
                    var settingValue = actionData.GetAsInteger("SettingValue");
                    if (string.IsNullOrEmpty(setting.StringValue))
                        setting.IntegerValue = settingValue;
                    else
                        setting.IntegerValue = setting.IntegerValue - settingValue;
                }
                else if (updateType == Resources.Toggle)
                {
                    var settingValue = actionData.GetAsString("SettingValue");
                    var parts = settingValue.Split(',');
                    if (string.IsNullOrEmpty(setting.StringValue))
                    {
                        setting.StringValue = parts[0];
                    }
                    else
                    {
                        for (var i = 0; i < parts.Length; i++)
                        {
                            if (parts[i] == setting.StringValue)
                            {
                                setting.StringValue = (i + 1) < parts.Length ? parts[i + 1] : parts[0];
                                break;
                            }
                        }
                    }
                }
                else
                {
                    var settingValue = actionData.GetAsString("SettingValue");
                    setting.StringValue = settingValue;
                }
                if (!isLocal) _settingService.SaveProgramSettings();
            }
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:55,代码来源:UpdateProgramSetting.cs

示例2: Process

 public override void Process(ActionData actionData)
 {
     var ticket = actionData.GetDataValue<Ticket>("Ticket");
     var orders = Helper.GetOrders(actionData, ticket);
     if (orders.Any())
     {
         var stateName = actionData.GetAsString("StateName");
         var currentState = actionData.GetAsString("CurrentState");
         var groupOrder = actionData.GetAsInteger("GroupOrder");
         var state = actionData.GetAsString("State");
         var stateOrder = actionData.GetAsInteger("StateOrder");
         var stateValue = actionData.GetAsString("StateValue");
         _ticketService.UpdateOrderStates(ticket, orders.ToList(), stateName, currentState, groupOrder, state, stateOrder, stateValue);
     }
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:15,代码来源:UpdateOrderState.cs

示例3: Process

 public override void Process(ActionData actionData)
 {
     var ticketId = actionData.GetAsInteger("TicketId");
     var ticket = _ticketService.OpenTicket(ticketId);
     actionData.DataObject.Ticket = ticket;
     ticket.PublishEvent(EventTopicNames.SetSelectedTicket);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:LoadTicket.cs

示例4: Process

 public override void Process(ActionData actionData)
 {
     var ticketId = actionData.GetAsInteger("TicketId");
     if (ticketId > 0)
         ExtensionMethods.PublishIdEvent(ticketId, EventTopicNames.DisplayTicket);
     else
     {
         if (_applicationState.IsLocked)
             EventServiceFactory.EventService.PublishEvent(EventTopicNames.RefreshSelectedTicket);
     }
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:11,代码来源:DisplayTicket.cs

示例5: Process

 public override void Process(ActionData actionData)
 {
     var ticket = actionData.GetDataValue<Ticket>("Ticket");
     if (ticket != null)
     {
         var stateName = actionData.GetAsString("StateName");
         var currentState = actionData.GetAsString("CurrentState");
         var state = actionData.GetAsString("State");
         var stateValue = actionData.GetAsString("StateValue");
         var quantity = actionData.GetAsInteger("Quantity");
         _ticketService.UpdateTicketState(ticket, stateName, currentState, state, stateValue, quantity);
     }
 }
开发者ID:khriza,项目名称:SambaPOS-3,代码行数:13,代码来源:UpdateTicketState.cs

示例6: Process

 public override void Process(ActionData actionData)
 {
     var entityId = actionData.GetAsInteger("EntityId");
     var entity = entityId > 0 ? _cacheService.GetEntityById(entityId) : actionData.GetDataValue<Entity>("Entity");
     if (entity == null) return;
     var printerName = actionData.GetAsString("PrinterName");
     var printerTemplateName = actionData.GetAsString("PrinterTemplateName");
     var printer = _cacheService.GetPrinters().FirstOrDefault(x => x.Name == printerName);
     var printerTemplate = _cacheService.GetPrinterTemplates().FirstOrDefault(y => y.Name == printerTemplateName);
     if (printer == null) return;
     if (printerTemplate == null) return;
     _printerService.PrintObject(entity, printer, printerTemplate);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:13,代码来源:PrintEntity.cs

示例7: Process

 public override void Process(ActionData actionData)
 {
     _emailService.SendEMailAsync(actionData.GetAsString("SMTPServer"),
          actionData.GetAsString("SMTPUser"),
          actionData.GetAsString("SMTPPassword"),
          actionData.GetAsInteger("SMTPPort"),
          actionData.GetAsString("ToEMailAddress"),
          actionData.GetAsString("CCEmailAddresses"),
          actionData.GetAsString("FromEMailAddress"),
          actionData.GetAsString("Subject"),
          actionData.GetAsString("EMailMessage"),
          actionData.GetAsString("FileName"),
          actionData.GetAsBoolean("DeleteFile"),
          actionData.GetAsBoolean("BypassSslErrors"));
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:15,代码来源:SendEmail.cs

示例8: Process

        public override void Process(ActionData actionData)
        {
            var ticket = actionData.GetDataValue<Ticket>("Ticket");
            var pjName = actionData.GetAsString("PrintJobName");
            if (!string.IsNullOrEmpty(pjName))
            {
                var j = _cacheService.GetPrintJobByName(pjName);
                if (j != null)
                {
                    var copies = actionData.GetAsInteger("Copies");
                    var printTicket = actionData.GetAsBoolean("PrintTicket", true);
                    var priority = actionData.GetAsBoolean("HighPriority");
                    if (ticket != null && printTicket)
                    {
                        var orderTagName = actionData.GetAsString("OrderTagName");
                        var orderTagValue = actionData.GetAsString("OrderTagValue");
                        var orderStateName = actionData.GetAsString("OrderStateName");
                        var orderState = actionData.GetAsString("OrderState");
                        var orderStateValue = actionData.GetAsString("OrderStateValue");

                        Expression<Func<Order, bool>> expression = ex => true;
                        if (!string.IsNullOrWhiteSpace(orderTagName))
                        {
                            expression =
                                ex => ex.OrderTagExists(y => y.TagName == orderTagName && y.TagValue == orderTagValue);
                        }
                        if (!string.IsNullOrWhiteSpace(orderStateName))
                        {
                            expression = expression.And(ex => ex.IsInState(orderStateName, orderState));
                            if (!string.IsNullOrWhiteSpace(orderStateValue))
                                expression = expression.And(ex => ex.IsAnyStateValue(orderStateValue));
                        }
                        _ticketService.UpdateTicketNumber(ticket, _applicationState.CurrentTicketType.TicketNumerator);
                        ExecuteByCopies(copies, () => _printerService.PrintTicket(ticket, j, expression.Compile(), priority));
                    }
                    else
                    {
                        ExecuteByCopies(copies, () => _printerService.ExecutePrintJob(j, priority));
                    }
                }
            }
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:42,代码来源:ExecutePrintJob.cs

示例9: Process

 public override void Process(ActionData actionData)
 {
     var documentId = actionData.GetAsInteger("DocumentId");
     var document = _accountService.GetAccountTransactionDocumentById(documentId);
     if (document == null) return;
     var printerName = actionData.GetAsString("PrinterName");
     var printerTemplateName = actionData.GetAsString("PrinterTemplateName");
     var printer = _cacheService.GetPrinters().FirstOrDefault(x => x.Name == printerName);
     var printerTemplate = _cacheService.GetPrinterTemplates().FirstOrDefault(y => y.Name == printerTemplateName);
     if (printer == null)
     {
         printer = _applicationState.GetTransactionPrinter();
     }
     if (printerTemplate == null)
     {
         var documentType = _cacheService.GetAccountTransactionDocumentTypeById(document.DocumentTypeId);
         printerTemplate = _cacheService.GetPrinterTemplates().First(x => x.Id == documentType.PrinterTemplateId);
     }
     if (printer == null) return;
     if (printerTemplate == null) return;
     _printerService.PrintObject(document, printer, printerTemplate);
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:22,代码来源:PrintAccountTransactionDocument.cs

示例10: Process

        public override void Process(ActionData actionData)
        {
            Account account = null;
            var accountId = actionData.GetAsInteger("AccountId");
            if (accountId > 0)
            {
                account = _accountService.GetAccountById(accountId);
            }

            if (account == null)
            {
                var accountName = actionData.GetAsString("AccountName");
                if (!string.IsNullOrEmpty(accountName))
                {
                    account = _accountService.GetAccountByName(accountName);
                }
            }

            if (account != null)
            {
                _reportServiceClient.PrintAccountTransactions(account, actionData.GetAsString("AccountTransactionsFilter"));
            }
        }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:23,代码来源:PrintAccountTransactions.cs


注:本文中的ActionData.GetAsInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。