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


C# Contract类代码示例

本文整理汇总了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;
            }
        }
开发者ID:linuxgurugamer,项目名称:ContractConfigurator,代码行数:27,代码来源:ReachSpecificOrbitFactory.cs

示例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;
 }
开发者ID:yixin-xie,项目名称:ib-csharp,代码行数:14,代码来源:ExecDetailsEventArgs.cs

示例3: CreateContract

 public ActionResult CreateContract(Contract contract)
 {
     contract.Id = Guid.NewGuid();
     Context.Contracts.Add(contract);
     Context.SaveChanges();
     return View();
 }
开发者ID:johannesait,项目名称:webshop,代码行数:7,代码来源:CustomerController.cs

示例4: ContractDetailsDialog

 public ContractDetailsDialog(Contract contract)
 {
     InitializeComponent();
     textBox1.Text = Wallet.ToAddress(contract.ScriptHash);
     textBox2.Text = contract.ScriptHash.ToString();
     textBox3.Text = contract.RedeemScript.ToHexString();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:7,代码来源:ContractDetailsDialog.cs

示例5: ExecutionMessage

 public ExecutionMessage(int reqId, Contract contract, Execution execution)
 {
     Type = MessageType.ExecutionData;
     ReqId = reqId;
     Contract = contract;
     Execution = execution;
 }
开发者ID:conradakunga,项目名称:QuantTrading,代码行数:7,代码来源:ExecutionMessage.cs

示例6: OpenOrderEventArgs

 ///<summary>
 /// Parameterless OpenOrderEventArgs Constructor
 ///</summary>
 public OpenOrderEventArgs()
 {
     this.orderId = -1;
     this.order = new Order();
     this.contract = new Contract();
     this.orderState = new OrderState();
 }
开发者ID:yixin-xie,项目名称:ib-csharp,代码行数:10,代码来源:OpenOrderEventArgs.cs

示例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;
            }
        }
开发者ID:ep2012,项目名称:OCP-2.0,代码行数:35,代码来源:AddUser.xaml.cs

示例8: fromDomain

        public ContractListItemModel fromDomain(Contract contract)
        {
            this.value = contract.ContractId.ToString();
            this.description = contract.Description;

            return this;
        }
开发者ID:mvillaronga-medkoder,项目名称:reactjs,代码行数:7,代码来源:ContractListItemModel.cs

示例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;
    }
开发者ID:SpaceSpaceSpace,项目名称:Space,代码行数:35,代码来源:ContractUtils.cs

示例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;
        }
开发者ID:holenzh,项目名称:CSharpProjAtYC,代码行数:28,代码来源:TxtForm.cs

示例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;
 }
开发者ID:Kerbas-ad-astra,项目名称:ContractConfigurator,代码行数:7,代码来源:ReachStateFactory.cs

示例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);
     }
 }
开发者ID:pjfoi,项目名称:projectNet,代码行数:12,代码来源:ContractDB.cs

示例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);
        }
开发者ID:ninthrampart,项目名称:Learn_TDD,代码行数:30,代码来源:UnitTest1.cs

示例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
                             }
                      };
 }
开发者ID:robgray,项目名称:Tucana,代码行数:32,代码来源:FakesHelper.cs

示例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;
                }
            }
        }
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:60,代码来源:ConsoleHumanPlayer.cs


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