コード例 #1
0
ファイル: OrderDetail.cs プロジェクト: phiree/testttt
 public OrderDetail(int quantity, TicketPrice ticketPrice, string remark)
     : this()
 {
     this.Quantity = quantity;
     this.TicketPrice = ticketPrice;
     this.Remark = remark;
 }
コード例 #2
0
ファイル: BLLTicketSellerTest.cs プロジェクト: phiree/testttt
        public void BuildOrderForQZTest()
        {
            BLL.BLLQZTicketSeller seller = new BLLQZTicketSeller();

            TourMembership member = new TourMembership();
            member.IdCard = "idcard";

            Ticket currentTicket = new TicketNormal();
            TicketPrice tp = new TicketPrice();
            tp.Price = 1;
            tp.PriceType = PriceType.PreOrder;
            tp.Ticket = currentTicket;
            currentTicket.TicketPrice.Add(tp);
            Model.Order order = seller.BuildOrderForQZ(member,"yuanfei","",currentTicket, 1, "浙江旅游信息中心网站");

            Assert.AreEqual(order.TotalPrice, 1);
        }
コード例 #3
0
ファイル: TicketEdit.aspx.cs プロジェクト: phiree/testttt
    private bool UpdateForm(Ticket ticket)
    {
        ticket.IsMain = cbxIsMain.Checked;
        ticket.BeginDate = Convert.ToDateTime(tbxBeginDate.Text);
        ticket.EndDate = Convert.ToDateTime(tbxEndDate.Text);
        ticket.Enabled = cbxLock.Checked;
        ticket.Name = tbxName.Text;
        //ticket.OrderNumber = Convert.ToDecimal(tbxOrder.Text);
        ticket.ProductCode = tbxProductCode.Text;
        //ticket.Remark = tbxRemark.Text;

        DJ_TourEnterprise ent = bllEnterprise.GetEntByName(tbxOwner.Text);
        if (ent == null) return false;
        ticket.Scenic = ent;

        //价格 以后把价格类型改成字典表
        IList<TicketPrice> tpList = ticket.TicketPrice;
        if (tpList == null || tpList.Count == 0)
        {
            tpList = new List<TicketPrice>();
            TicketPrice tp1 = new TicketPrice();
            tp1.PriceType = PriceType.Normal;
            tp1.Price = Convert.ToDecimal(tbxPriceNormal.Text);
            tp1.Ticket = ticket;
            tpList.Add(tp1);

            TicketPrice tp2 = new TicketPrice();
            tp2.PriceType = PriceType.PayOnline;
            tp2.Price = Convert.ToDecimal(tbxPricePayOnline.Text);
            tp2.Ticket = ticket;
            tpList.Add(tp2);

            TicketPrice tp3 = new TicketPrice();
            tp3.PriceType = PriceType.PreOrder;
            tp3.Price = Convert.ToDecimal(tbxPricePreOrder.Text);
            tp3.Ticket = ticket;
            tpList.Add(tp3);
            ticket.TicketPrice = tpList;
        }
        else
        {
            tpList[0].Price = Convert.ToDecimal(tbxPriceNormal.Text);
            tpList[1].Price = Convert.ToDecimal(tbxPricePayOnline.Text);
            tpList[2].Price = Convert.ToDecimal(tbxPricePreOrder.Text);
        }

        return true;
    }
コード例 #4
0
    protected void rptSearchScenics_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "addscenic")
        {

            int scenicId = Convert.ToInt32(e.CommandArgument);
            //为联票创建一张门票
            DJ_TourEnterprise ent = bllEnt.GetOne(scenicId);
            //如果该拥有者已经有一张门票属于该套票 则不做任何操作
            if (CurrentTicket.TicketList.Where(x => x.Scenic.Id == scenicId).Count() > 0)
            {
                CommonLibrary.Notification.Show(this, "", "该套票已经包含此景区的门票,不需要创建", "");
            }
            else
            {
                TicketNormal t = new TicketNormal();
                t.BeginDate = DateTime.Today;
                t.EndDate = DateTime.MaxValue;
                t.IsMain = false;
                t.Lock = true;
                t.Name = CurrentTicket.Name + "-" + ent.Name;
                t.Scenic = ent;
                //获得主票的原价信息,赋值给自动创建的门票
                decimal originalPrice = 0;
                if (ent.Tickets.Count > 0)
                {

                    if (ent.Tickets.Where(x => x.IsMain).Count() > 0)
                    {
                        originalPrice = ent.Tickets.Where(x => x.IsMain).ToList()[0].GetPrice(PriceType.Normal);
                    }
                    else
                    {
                        originalPrice = ent.Tickets[0].GetPrice(PriceType.Normal);
                    }
                }
                IList<TicketPrice> tpList = new List<TicketPrice>();
                TicketPrice tp1 = new TicketPrice();
                tp1.Price = 0;
                tp1.PriceType = PriceType.PayOnline;

                TicketPrice tp2 = new TicketPrice();
                tp2.Price = 0;
                tp2.PriceType = PriceType.PreOrder;

                TicketPrice tp3 = new TicketPrice();
                tp3.Price = originalPrice;
                tp3.PriceType = PriceType.Normal;

                tpList.Add(tp1);
                tpList.Add(tp2);
                tpList.Add(tp3);
                t.TicketPrice = tpList;
                t.TicketUnion = CurrentTicket;
                bllTicket.SaveOrUpdateTicket(t);
            }

            BindTickets();
        }
    }
コード例 #5
0
ファイル: TicketXmlParser.cs プロジェクト: phiree/testttt
        private Scenic ParseTicket(tourism_item item)
        {
            Scenic s = new Scenic();
            s.Name = item.title;
            s.MipangId = item.mipang_id;
            s.Phone = item.photo;
            s.Type = EnterpriseType.景点;
            s.IsHide = true;
            s.Area = new BLLArea().GetAreaByCode("330000");

            ///构造景点的area对象
            ///现有数据: 浙江/江苏/All/杭州/建德
            ///目标数据:浙江省杭州市
            s.Desec = item.city;

            foreach (ticket ticket in item.tickets)
            {
                Ticket t = new TicketNormal();
                t.IsMain = true;
                t.Name = ticket.ticket_name;

                TicketPrice tp1 = new TicketPrice();
                TicketPrice tp2= new TicketPrice();
                TicketPrice tp3 = new TicketPrice();
                tp1.Price = ticket.ticket_price;
                tp1.PriceType = PriceType.Normal;
                tp1.Ticket = t;

                tp2.Price = ticket.ticket_price;
                tp2.PriceType = PriceType.PreOrder;
                tp2.Ticket = t;

                tp3.Price = ticket.ticket_price;
                tp3.PriceType = PriceType.PayOnline;
                tp3.Ticket = t;

                t.TicketPrice.Add(tp1);
                t.TicketPrice.Add(tp2);
                t.TicketPrice.Add(tp3);

              //  t.TicketPrice = tps;
                t.Scenic = s;
                s.Tickets.Add(t);
            }

            return s;
        }
コード例 #6
0
ファイル: EditTicket.aspx.cs プロジェクト: phiree/testttt
    private void UpdateForm()
    {
        IList<TicketPrice> prices = new List<TicketPrice>();
        TicketPrice priceOriginal = new TicketPrice
        { PriceType= Model.PriceType.Normal, Ticket=CurrentTicket, Price= Convert.ToDecimal(tbxOriginal.Text) };
        TicketPrice pricePreOrder = new TicketPrice
        { PriceType = Model.PriceType.PreOrder, Ticket = CurrentTicket, Price = Convert.ToDecimal(tbxPayOffline.Text) };
        TicketPrice pricePayonline = new TicketPrice
        { PriceType = Model.PriceType.PayOnline, Ticket = CurrentTicket, Price = Convert.ToDecimal(tbxPayOnline.Text) };
        prices.Add(priceOriginal);
        prices.Add(pricePreOrder);
        prices.Add(pricePayonline);
        CurrentTicket.IsMain = cbxIsMainPrice.Checked;
        CurrentTicket.Name = tbxName.Text;
        CurrentTicket.Scenic = Scenic;

        CurrentTicket.TicketPrice = prices;
    }