本文整理汇总了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();
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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"));
}
示例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));
}
}
}
}
示例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);
}
示例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"));
}
}