public Order BuildOrderForQZ(TourMembership member, string assignName, string idcardno, Ticket currentTicket, int amount, string parnterName) { #region 开始出票 //1 为身份证号创建一个用户名 TicketAssign ta = new TicketAssign(); ta.IdCard = idcardno; ta.IsUsed = false; ta.Name = assignName; OrderDetail orderdetail = new OrderDetail(); orderdetail.Quantity = amount; orderdetail.Remark = "衢州新春门票派送活动自动创建订单,请票来源:" + parnterName; orderdetail.TicketAssignList.Add(ta); TicketPrice ticketPrice = currentTicket.GetTicketPrice(PriceType.PayOnline); orderdetail.TicketPrice = ticketPrice; Order order = new Order(); order.BuyTime = DateTime.Now; order.IsPaid = true; order.TourMembership = member; order.OrderDetail.Add(orderdetail); order.PayTime = DateTime.Now; order.PriceType = PriceType.PayOnline; order.PayTime = DateTime.Now; order.TradeNo = "QZFREE"; return order; #endregion }