示例#1
0
        /// <summary>
        ///     创建交易
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="description">描述</param>
        /// <param name="startDate">开始日期</param>
        /// <param name="tradeType">交易类型</param>
        /// <returns>创建的交易</returns>
        public static Trade CreateTrade(string name, string description, DateTime startDate, string tradeType)
        {
            const string tradeTypes = "购买飞机、租赁飞机、购买发动机、租赁发动机、购买BFE";
            if (!tradeTypes.Contains(tradeType))
            {
                throw new ArgumentException("交易类型错误!");
            }

            var trade = new Trade
            {
                Name = name,
                Description = description,
                CreateDate = DateTime.Now,
                StartDate = startDate,
                TradeType = tradeType
            };

            return trade;
        }
示例#2
0
文件: Order.cs 项目: unicloud/FRP
        /// <summary>
        ///     设置交易
        /// </summary>
        /// <param name="trade">交易</param>
        public void SetTrade(Trade trade)
        {
            if (trade == null || trade.IsTransient())
            {
                throw new ArgumentException("交易参数为空!");
            }

            Trade = trade;
            TradeId = trade.Id;
        }