本文整理汇总了C#中TransactionType类的典型用法代码示例。如果您正苦于以下问题:C# TransactionType类的具体用法?C# TransactionType怎么用?C# TransactionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransactionType类属于命名空间,在下文中一共展示了TransactionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: MapChange
public MapChange(long transactionId, Guid mapParameter, Descriptor descriptor, TransactionType operation)
{
TransactionId = transactionId;
MapParameter = mapParameter;
Descriptor = descriptor;
Operation = operation;
}
示例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);
}
示例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;
}
示例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 ();
}
}
示例6: DescriptionRule
public DescriptionRule(IList<string> terms, TextLookup location, TransactionType suggestedType, Weighting weighting)
{
Terms = terms;
Location = location;
SuggestedType = suggestedType;
Weighting = weighting;
}
示例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);
}
示例8: TransactionPreparation
public TransactionPreparation(Guid transactionId, TransactionType transactionType, PreparationType preparationType, decimal amount)
{
this.TransactionId = transactionId;
this.TransactionType = transactionType;
this.PreparationType = preparationType;
this.Amount = amount;
}
示例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;
}
}
示例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;
}
示例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);
}
示例12: TransactionResult
public TransactionResult(decimal paymentOut, decimal balance, bool sucess, TransactionType tt)
{
_paymentOut = paymentOut;
_balance = balance;
_sucess = sucess;
_transType = tt;
}
示例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);
}
示例14: CTransaction
public CTransaction(Guid vID, double vdAmmount, DateTime vDate, TransactionType vType)
{
_mTransactionID = vID;
_mdTransactionAmmount = vdAmmount;
_mTransactionDate = vDate;
_mTransactionType = vType;
}
示例15: Trasaction
public Trasaction(decimal balance, decimal ammount, TransactionType transactionType, Currency currency)
{
this.balance = balance;
this.ammount = ammount;
this.transactionType = transactionType;
this.currency = currency;
}