本文整理汇总了C#中Contract类的典型用法代码示例。如果您正苦于以下问题:C# Contract类的具体用法?C# Contract怎么用?C# Contract使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Contract类属于命名空间,在下文中一共展示了Contract类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
public override ContractParameter Generate(Contract contract)
{
// Get the OrbitGenerator behaviour
OrbitGenerator orbitGenerator = ((ConfiguredContract)contract).Behaviours.OfType<OrbitGenerator>().FirstOrDefault<OrbitGenerator>();
if (orbitGenerator == null)
{
LoggingUtil.LogError(this, "Could not find OrbitGenerator BEHAVIOUR to couple with ReachSpecificOrbit PARAMETER.");
return null;
}
// Get the parameter for that orbit
try
{
SpecificOrbitWrapper s = orbitGenerator.GetOrbitParameter(index);
if (deviationWindow != 0.0)
{
s.deviationWindow = deviationWindow;
}
return new VesselParameterDelegator(s);
}
catch (Exception e)
{
LoggingUtil.LogError(this, "Couldn't find orbit in OrbitGenerator with index " + index + ": " + e.Message);
return null;
}
}
示例2: ExecDetailsEventArgs
/// <summary>
/// Full Constructor
/// </summary>
/// <param name="requestId">The request Id for the Execution Details.</param>
/// <param name="orderId">The order Id that was specified previously in the call to placeOrder().</param>
/// <param name="contract">This structure contains a full description of the contract that was executed.</param>
/// <param name="execution">This structure contains addition order execution details.</param>
public ExecDetailsEventArgs(int requestId, int orderId, Contract contract, Execution execution)
{
this.requestId = requestId;
this.orderId = orderId;
this.execution = execution;
this.contract = contract;
}
示例3: CreateContract
public ActionResult CreateContract(Contract contract)
{
contract.Id = Guid.NewGuid();
Context.Contracts.Add(contract);
Context.SaveChanges();
return View();
}
示例4: ContractDetailsDialog
public ContractDetailsDialog(Contract contract)
{
InitializeComponent();
textBox1.Text = Wallet.ToAddress(contract.ScriptHash);
textBox2.Text = contract.ScriptHash.ToString();
textBox3.Text = contract.RedeemScript.ToHexString();
}
示例5: ExecutionMessage
public ExecutionMessage(int reqId, Contract contract, Execution execution)
{
Type = MessageType.ExecutionData;
ReqId = reqId;
Contract = contract;
Execution = execution;
}
示例6: OpenOrderEventArgs
///<summary>
/// Parameterless OpenOrderEventArgs Constructor
///</summary>
public OpenOrderEventArgs()
{
this.orderId = -1;
this.order = new Order();
this.contract = new Contract();
this.orderState = new OrderState();
}
示例7: addUser
private String addUser()
{
try
{
Contract contract = new Contract();
String cxnString = "Driver={SQL Server};Server=HC-sql7;Database=REVINT;Trusted_Connection=yes;";
using (OdbcConnection dbConnection = new OdbcConnection(cxnString))
{
//open OdbcConnection object
dbConnection.Open();
OdbcCommand cmd = new OdbcCommand();
cmd.CommandText = "{CALL [REVINT]." + contract.getSchema() + ".[OCP_addUser]( ?, ?, ?, ? )}";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Connection = dbConnection;
cmd.Parameters.Add("@hawkId", OdbcType.NVarChar, 400).Value = txtHealthcareID.Text;
cmd.Parameters.Add("@administrator", OdbcType.Bit).Value = chkAdmin.IsChecked;
cmd.Parameters.Add("@name", OdbcType.NVarChar, 400).Value = txtName.Text;
cmd.Parameters.Add("@numRecords", OdbcType.Int);
cmd.Parameters["@numRecords"].Direction = System.Data.ParameterDirection.ReturnValue;
cmd.ExecuteNonQuery();
dbConnection.Close();
return cmd.Parameters["@numRecords"].Value.ToString();
}
}
catch (Exception)
{
return null;
}
}
示例8: fromDomain
public ContractListItemModel fromDomain(Contract contract)
{
this.value = contract.ContractId.ToString();
this.description = contract.Description;
return this;
}
示例9: GetRandomContract
public static Contract GetRandomContract(int Tier)
{
Contract contract = new Contract();
//Get Contract element Tier lists
int indexedTier = Tier - 1;
List<ContractContent> contents = ContractManager.Contents[indexedTier];
List<ContractTargetName> targetNames = ContractManager.TargetNames[indexedTier];
List<ContractTargetImage> targetImages = ContractManager.TargetImages[indexedTier];
List<ContractTargetShipImage> targetShipImages = ContractManager.TargetShipImages[indexedTier];
ContractContent content = new ContractContent();
ContractTargetName targetName = new ContractTargetName();
ContractTargetImage targetImage = new ContractTargetImage();
ContractTargetShipImage targetShipImage = new ContractTargetShipImage();
//Get random content
if (contents != null)
content = contents[Random.Range(0, contents.Count)];
if (targetNames != null)
targetName = targetNames[Random.Range(0, targetNames.Count)];
if (targetImages != null)
targetImage = targetImages[Random.Range(0, targetImages.Count)];
if (targetShipImages != null)
targetShipImage = targetShipImages[Random.Range(0, targetShipImages.Count)];
//Build contract
contract = new Contract(targetName.TargetName, content.Description, content.Title, targetImage.TargetImagePath, targetShipImage.TargetShipImagePath, content.Objectives);
return contract;
}
示例10: getContractTxt
public static string getContractTxt(Contract con)
{
string content = "\r\n 合同详细信息:\r\n\r\n";
content += "协议类型:" + con.proCate + "\r\n";
content += "协议名称:" + con.proName + "\r\n";
content += "协议编号:" + con.proId + "\r\n";
content += "联通公司业务联系人:" + con.unicomLinkMan + "\r\n";
content += "联系电话:" + con.linkPhone + "\r\n";
content += "集团客户客户经理:" + con.groupCusManager + "\r\n";
content += "协议签署单位名称:" + con.proSignUnitName + "\r\n";
content += "单位地址:" + con.unitAdd + "\r\n";
content += "协议签署:" + con.proSign + "\r\n";
content += "签署单位联系人:" + con.signUnitLinkMan + "\r\n";
content += "联系电话:" + con.signUnitLinkPhone + "\r\n";
content += "付费号码:" + con.payPhone + "\r\n";
content += "收费标准:" + con.payStand + "\r\n";
content += "协议签订日期:" + con.proSignDate + "\r\n";
content += "协议执行日期:" + con.proSignExeDate + "\r\n";
content += "协议期限:" + con.proDeadLine + "\r\n";
content += "协议到期日期:" + con.proExpireData + "\r\n";
content += "协议内容简述:" + con.proDesc + "\r\n";
content += "备注:" + con.remark + "\r\n";
content += "电路调单号:" + con.dltdh + "\r\n";
content += "文件名:" + con.fileName + "\r\n";
return content;
}
示例11: Generate
public override ContractParameter Generate(Contract contract)
{
ReachState param = new ReachState(targetBodies, biome == null ? "" : biome.biome, situation, minAltitude, maxAltitude,
minTerrainAltitude, maxTerrainAltitude, minSpeed, maxSpeed, minRateOfClimb, maxRateOfClimb, minAcceleration, maxAcceleration, title);
param.FailWhenUnmet = failWhenUnmet;
return param;
}
示例12: Delete
/// <summary>
/// Delete the specified contract.
/// </summary>
/// <param name="contract">The contract to be deleted.</param>
/// <returns>Number of affected rows.</returns>
public static int Delete(Contract contract)
{
using (SqlConnection connection = SamenSterkerDB.GetConnection())
{
return connection.Execute(sql: deleteQuery, param: contract);
}
}
示例13: MockContract_GetAll_GotData
public void MockContract_GetAll_GotData()
{
Contract c1 = new Contract()
{
Id = 1,
FirstName = "Иван",
LastName = "Петров",
MiddleName = "Вениаминович",
Snils = "111-222-333 01"
};
Contract c2 = new Contract()
{
Id = 2,
FirstName = "Иван",
LastName = "Сидоров",
MiddleName = "Вениаминович",
Snils = "111-222-333 01"
};
List<Contract> contracts = new List<Contract> { c1, c2 };
//int total = _rep.GetAll().Count;
var mockCustomer = new Mock<Contract>();
var mockRep = new Mock<IContractRepository>();
mockRep.Setup(x => x.GetAll()).Returns(contracts);
var tmp = mockRep.Object.GetAll();
Assert.IsTrue(tmp.Count > 0);
//.IsTrue(1 > 0);
}
示例14: CreateCallListWithTwoCalls
public static IList<Call> CreateCallListWithTwoCalls(Contract contract)
{
return new List<Call>
{
new Call(1)
{
CalledFrom = "SATELLITE",
ContractId = contract.Id.Value,
Volume = 2.54M,
HasFreeCallTariff = true,
ImportedCallType = "TEST CALL",
NumberCalled = "0400000001",
PhoneNumber = contract.PhoneNumber1,
UnitCost = 1M,
UnitsOfTime = 6,
Cost = 6.5M
},
new Call(2)
{
CalledFrom = "SATELLITE",
ContractId = contract.Id.Value,
Volume = 5.23M,
HasFreeCallTariff = true,
ImportedCallType = "TEST CALL",
NumberCalled = "0400000002",
PhoneNumber = contract.PhoneNumber1,
UnitCost = 1M,
UnitsOfTime = 11,
Cost = 11.5M
}
};
}
示例15: AskForBid
public BidType AskForBid(Contract currentContract, IList<BidType> allowedBids, IList<BidType> previousBids)
{
this.Contract = currentContract;
while (true)
{
this.Draw();
var availableBidsAsString = AvailableBidsAsString(allowedBids);
ConsoleHelper.WriteOnPosition(availableBidsAsString, 0, Settings.ConsoleHeight - 2);
ConsoleHelper.WriteOnPosition("It's your turn! Please enter your bid: ", 0, Settings.ConsoleHeight - 3);
BidType bid;
var playerContract = Console.ReadLine();
if (string.IsNullOrWhiteSpace(playerContract))
{
continue;
}
playerContract = playerContract.Trim();
switch (char.ToUpper(playerContract[0]))
{
case 'A':
bid = BidType.AllTrumps;
break;
case 'N':
bid = BidType.NoTrumps;
break;
case 'S':
bid = BidType.Spades;
break;
case 'H':
bid = BidType.Hearts;
break;
case 'D':
bid = BidType.Diamonds;
break;
case 'C':
bid = BidType.Clubs;
break;
case 'P':
bid = BidType.Pass;
break;
case '2':
bid = BidType.Double;
break;
case '4':
bid = BidType.ReDouble;
break;
default:
continue;
}
if (allowedBids.Contains(bid))
{
return bid;
}
}
}