• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TransactionType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TransactionType的典型用法代码示例。如果您正苦于以下问题:C# TransactionType类的具体用法?C# TransactionType怎么用?C# TransactionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TransactionType类属于命名空间,在下文中一共展示了TransactionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Charge

 public bool Charge(UUID agentID, int amount, string text, int daysUntilNextCharge, TransactionType type, string identifer, bool chargeImmediately)
 {
     IMoneyModule moneyModule = m_registry.RequestModuleInterface<IMoneyModule>();
     if (moneyModule != null)
     {
         if (chargeImmediately)
         {
             bool success = moneyModule.Charge(agentID, amount, text, type);
             if (!success)
                 return false;
         }
         IScheduleService scheduler = m_registry.RequestModuleInterface<IScheduleService>();
         if (scheduler != null)
         {
             OSDMap itemInfo = new OSDMap();
             itemInfo.Add("AgentID", agentID);
             itemInfo.Add("Amount", amount);
             itemInfo.Add("Text", text);
             itemInfo.Add("Type", (int)type);
             SchedulerItem item = new SchedulerItem("ScheduledPayment " + identifer,
                                                    OSDParser.SerializeJsonString(itemInfo), false,
                                                    DateTime.UtcNow, daysUntilNextCharge, RepeatType.days, agentID);
             itemInfo.Add("SchedulerID", item.id);
             scheduler.Save(item);
         }
     }
     return true;
 }
开发者ID:QueenStarfinder,项目名称:WhiteCore-Dev,代码行数:28,代码来源:ScheduledPayments.cs


示例2: MapChange

 public MapChange(long transactionId, Guid mapParameter, Descriptor descriptor, TransactionType operation)
 {
     TransactionId = transactionId;
     MapParameter = mapParameter;
     Descriptor = descriptor;
     Operation = operation;
 }
开发者ID:chris-tomich,项目名称:Glyma,代码行数:7,代码来源:MapChange.cs


示例3: AddPendingOrder

        static void AddPendingOrder(LiveOpenPositionsEditor openPositionData, Symbol symbol, string orderId, long size, DateTime submittedTime,
            OrderType orderType, TransactionType transactionType, double price, string customString)
        {
            if (openPositionData.PortfolioXml.PendingOrders.Any(o => o.OrderId == orderId))
            {
                //  Order already tracked
                return;
            }

            PositionType positionType = (transactionType == TransactionType.Buy || transactionType == TransactionType.Sell) ? PositionType.Long : PositionType.Short;

            //  This assumes there is just one position per symbol.  If this isn't the case then you will need to find a way of figuring out which
            //  position a pending order corresponds to.
            PositionDataXml position = openPositionData.PortfolioXml.Positions.FirstOrDefault(pos => pos.Symbol.Equals(symbol) && pos.PositionType == positionType);

            if (position == null)
            {
                //  No existing position, so create a new one
                position = openPositionData.AddPosition(symbol, positionType);
                position.CustomString = customString;
            }

            BrokerOrder brokerOrder = new BrokerOrder();
            if (orderType == OrderType.Limit || orderType == OrderType.LimitOnClose)
            {
                brokerOrder.LimitPrice = price;
            }
            else if (orderType == OrderType.Stop || orderType == OrderType.TrailingStop)
            {
                brokerOrder.StopPrice = price;
            }
            brokerOrder.CustomString = customString;

            TradeOrderXml tradeOrder = openPositionData.AddPendingOrder(position, brokerOrder, orderId, size, submittedTime, orderType, transactionType);
        }
开发者ID:dsplaisted,项目名称:RightEdgeUtil,代码行数:35,代码来源:Program.cs


示例4: Transfer

 public bool Transfer(UUID toID, UUID fromID, UUID toObjectID, UUID fromObjectID, int amount, string description,
                      TransactionType type)
 {
     if ((type == TransactionType.ObjectPay) && (OnObjectPaid != null))
         OnObjectPaid((fromObjectID == UUID.Zero) ? toObjectID : fromObjectID, fromID, amount);
     return true;
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:7,代码来源:SampleCurrencyModule.cs


示例5: LotSerialRegister

        static void LotSerialRegister(TransactionType source, int reference, Warehouse warehouse,
		                               Product product, decimal quantity)
        {
            var query = from x in LotSerialRequirement.Queryable
                        where x.Source == source &&
                            x.Reference == reference &&
                            x.Warehouse.Id == warehouse.Id &&
                            x.Product == product
                        select x;
            var rqmt = query.SingleOrDefault ();

            if (rqmt != null) {
                rqmt.Quantity += quantity;
                rqmt.Update ();
            } else {
                rqmt = new LotSerialRequirement {
                    Source = source,
                    Reference = reference,
                    Warehouse = warehouse,
                    Product = product,
                    Quantity = quantity
                };

                rqmt.Create ();
            }
        }
开发者ID:mictlanix,项目名称:mbe,代码行数:26,代码来源:InventoryHelpers.cs


示例6: DescriptionRule

 public DescriptionRule(IList<string> terms, TextLookup location, TransactionType suggestedType, Weighting weighting)
 {
     Terms = terms;
     Location = location;
     SuggestedType = suggestedType;
     Weighting = weighting;
 }
开发者ID:EliotJones,项目名称:StatementParser,代码行数:7,代码来源:DescriptionRule.cs


示例7: CreateTransaction

        public static Transaction CreateTransaction(int userId, int points, TransactionType transactionTypeId)
        {
            var parameters = new List<SqlParameter>
            {
                new SqlParameter
                {
                    ParameterName = "userId",
                    Value = userId
                },
                new SqlParameter
                {
                    ParameterName = "points",
                    Value = points
                },
                new SqlParameter
                {
                    ParameterName = "transactionTypeId",
                    Value = transactionTypeId
                }
            };

            var dataTable = DatabaseCommon.PerformAction("AddTransaction", parameters);

            return DatabaseCommon.ConvertRow(dataTable, PopulateTransaction);
        }
开发者ID:MMP-HCKMCR,项目名称:geocar-web,代码行数:25,代码来源:TransactionRepository.cs


示例8: TransactionPreparation

 public TransactionPreparation(Guid transactionId, TransactionType transactionType, PreparationType preparationType, decimal amount)
 {
     this.TransactionId = transactionId;
     this.TransactionType = transactionType;
     this.PreparationType = preparationType;
     this.Amount = amount;
 }
开发者ID:jsonsugar,项目名称:Orleans.EventSourcing,代码行数:7,代码来源:TransactionPreparation.cs


示例9: CreateTransaction

 private static bool CreateTransaction(DateTime transactionDate,string description, decimal amount, int accountnumber, TransactionType transactionType)
 {
     try
     {
         using (var db = new CarRentalModel())
         {
             var transaction = new RentalTransaction
             {
                 CustomerNumber = accountnumber,
                 TransactionDate = transactionDate,
                 Description = description,
                 Debit = (transactionType == TransactionType.Debit)
                 ? amount : 0.0M,
                 Credit = (transactionType == TransactionType.Credit)
                 ? amount : 0.0M
             };
             db.Transactions.Add(transaction);
             db.SaveChanges();
             return true;
         }
     }
     catch (Exception)
     {
         return false;
     }
 }
开发者ID:laraiw,项目名称:CarRentalCo,代码行数:26,代码来源:CarRentalFactory.cs


示例10: Types

 // Methods
 public static List<TransactionType> Types()
 {
     List<TransactionType> list = new List<TransactionType>();
     string str = "SELECT TTID, ShortDescription FROM CodeTransactionType order by ShortDescription ";
     SqlConnection connection = new SqlConnection();
     SqlCommand command = new SqlCommand();
     connection.ConnectionString = ConfigurationManager.ConnectionStrings["ChargeProgramConnectionString"].ConnectionString;
     command.CommandText = str;
     command.Connection = connection;
     connection.Open();
     SqlDataReader reader = command.ExecuteReader(CommandBehavior.SingleResult);
     TransactionType item = new TransactionType();
     item.description = "ALL";
     item.ttid = "ALL";
     list.Add(item);
     while (reader.Read())
     {
         TransactionType type2 = new TransactionType();
         type2.Ttid = reader["TTID"].ToString();
         type2.Description = reader["ShortDescription"].ToString();
         list.Add(type2);
     }
     reader.Close();
     connection.Close();
     return list;
 }
开发者ID:geoffritchey,项目名称:cafeteria,代码行数:27,代码来源:TransactionType.cs


示例11: Save_DifferentTransactionTypes_CorrectlySaved

        public void Save_DifferentTransactionTypes_CorrectlySaved(TransactionType type)
        {
            var accountRepoSetup = new Mock<IDataAccess<Account>>();
            accountRepoSetup.Setup(x => x.LoadList(null)).Returns(new List<Account>());

            var transactionDataAccessMock = new TransactionDataAccessMock();
            var repository = new TransactionRepository(transactionDataAccessMock,
                new RecurringTransactionDataAccessMock());

            var account = new Account
            {
                Name = "TestAccount"
            };

            var transaction = new FinancialTransaction
            {
                ChargedAccount = account,
                TargetAccount = null,
                Amount = 20,
                Type = (int) type
            };

            repository.Save(transaction);

            transactionDataAccessMock.FinancialTransactionTestList[0].ShouldBeSameAs(transaction);
            transactionDataAccessMock.FinancialTransactionTestList[0].ChargedAccount.ShouldBeSameAs(account);
            transactionDataAccessMock.FinancialTransactionTestList[0].TargetAccount.ShouldBeNull();
            transactionDataAccessMock.FinancialTransactionTestList[0].Type.ShouldBe((int) type);
        }
开发者ID:jgodinez,项目名称:MoneyManager,代码行数:29,代码来源:TransactionRepositoryTests.cs


示例12: TransactionResult

 public TransactionResult(decimal paymentOut, decimal balance, bool sucess, TransactionType tt)
 {
     _paymentOut = paymentOut;
     _balance = balance;
     _sucess = sucess;
     _transType = tt;
 }
开发者ID:michaljaros84,项目名称:OneBigPlayground,代码行数:7,代码来源:TransactionResult.cs


示例13: AddOrder

 public void AddOrder()
 {
     Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
     // Make API call.
     ApiException gotException = null;
     try
     {
     AddOrderCall api = new AddOrderCall(this.apiContext);
     OrderType order = new OrderType();
     api.Order = order;
     TransactionType t1 = new TransactionType();
     t1.Item = TestData.NewItem;
     t1.TransactionID = "0";
     TransactionType t2 = new TransactionType();
     t2.Item = TestData.NewItem;
     t2.TransactionID = "0";
     TransactionTypeCollection tary = new TransactionTypeCollection();
         tary.Add(t1); tary.Add(t2);
     order.TransactionArray = tary;
     api.Order = order;
     // Make API call.
     /*AddOrderResponseType resp =*/ api.Execute();
     }
     catch(ApiException ex)
     {
         gotException = ex;
     }
     Assert.IsNotNull(gotException);
 }
开发者ID:fudder,项目名称:cs493,代码行数:29,代码来源:T_070_AddOrderLibrary.cs


示例14: CTransaction

 public CTransaction(Guid vID, double vdAmmount, DateTime vDate, TransactionType vType)
 {
     _mTransactionID = vID;
     _mdTransactionAmmount = vdAmmount;
     _mTransactionDate = vDate;
     _mTransactionType = vType;
 }
开发者ID:AnotherByte,项目名称:Banking,代码行数:7,代码来源:CTransaction.cs


示例15: Trasaction

 public Trasaction(decimal balance, decimal ammount, TransactionType transactionType, Currency currency)
 {
     this.balance = balance;
     this.ammount = ammount;
     this.transactionType = transactionType;
     this.currency = currency;
 }
开发者ID:alexcompton,项目名称:BankConsole,代码行数:7,代码来源:Transaction.cs


示例16: Transaction

 public Transaction(TransactionType transactionType, double amount, double final)
 {
     _transactionType = transactionType;
     _amount = amount;
     _final = final;
     _date = DateTime.Now;
 }
开发者ID:davericher,项目名称:cst8253,代码行数:7,代码来源:Transaction.cs


示例17: SearchResult

 public SearchResult(String jsonString, String searchString, String searchUri, JsonResultType jsonResultType, TransactionType transactionType)
 {
     this.TransactionType = transactionType;
     this.JsonResultType = jsonResultType;
     this.SearchUri = searchUri;
     this.JsonString = jsonString;
     this.Text = searchString;
 }
开发者ID:mercutiodesign,项目名称:TradingPostNotifier,代码行数:8,代码来源:SearchResult.cs


示例18: LoanTransaction

 /// <summary>
 /// Initializes a new instance of the <see cref="LoanTransaction"/> class.
 /// </summary>
 /// <param name="date">The date.</param>
 /// <param name="type">The type.</param>
 /// <param name="credit">The credit.</param>
 /// <param name="debit">The debit.</param>
 /// <param name="balance">The balance.</param>
 public LoanTransaction(DateTime date, TransactionType type, double credit, double debit, double balance)
 {
     Date = date;
     Type = type;
     Credit = credit;
     Debit = debit;
     Balance = balance;
 }
开发者ID:retroburst,项目名称:Kata,代码行数:16,代码来源:LoanTransaction.cs


示例19: AddTransactionPreparationCommand

 public AddTransactionPreparationCommand(string accountId, string transactionId, TransactionType transactionType, PreparationType preparationType, double amount)
     : base(accountId)
 {
     TransactionId = transactionId;
     TransactionType = transactionType;
     PreparationType = preparationType;
     Amount = amount;
 }
开发者ID:ulswww,项目名称:enode,代码行数:8,代码来源:BankAccountCommands.cs


示例20: Transaction

 public Transaction()
 {
     this._BatchSteps = new BatchStepCollection();
     this._TCode = "";
     this._Type = TransactionType.Multiple;
     this._Returns = new BatchReturnCollection();
     this._CustomFunctionName = "";
 }
开发者ID:SyedMdKamruzzaman,项目名称:sap_interface,代码行数:8,代码来源:Transaction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Transceiver类代码示例发布时间:2022-05-24
下一篇:
C# TransactionStatus类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap