Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        private void BtnSaveChanges_Click(object sender, EventArgs e)
        {
            if (CheckFields())
            {
                DateTime deadline = dateTimeIncident.Value.Date;
                if (dropDownDeadline.Text == "7 days")
                {
                    deadline = DateTime.Today.AddDays(7);
                }
                else if (dropDownDeadline.Text == "14 days")
                {
                    deadline = DateTime.Today.AddDays(14);
                }
                else if (dropDownDeadline.Text == "28 days")
                {
                    deadline = DateTime.Today.AddDays(28);
                }
                else if (dropDownDeadline.Text == "6 months")
                {
                    deadline = DateTime.Today.AddDays(182);
                }

                Model.Ticket newTicket = new Model.Ticket
                {
                    Date        = dateTimeIncident.Value.Date,
                    Subject     = txtSubject.Text,
                    User        = dropDownUsers.Text,
                    Priority    = dropDownPriority.Text,
                    Deadline    = deadline,
                    Description = txtDescription.Text,
                    Type        = dropDownIncidents.Text,
                    Status      = (TicketStatus)cmbStatus.SelectedIndex
                };

                ticketService.ReplaceTicket(id, newTicket);

                MessageBox.Show("Edits saved!");

                // Return form readonly state
                dateTimeIncident.Enabled  = false;
                txtSubject.Enabled        = false;
                dropDownUsers.Enabled     = false;
                txtDescription.Enabled    = false;
                dropDownIncidents.Enabled = false;
                dropDownPriority.Enabled  = false;
                dropDownDeadline.Enabled  = false;
                cmbStatus.Enabled         = false;
                btnEditTicket.Show();
                btnSaveChanges.Hide();
                btnCancelEditTicket.Hide();
            }
        }
Exemplo n.º 3
0
        private void btn_SendFeedback_Click(object sender, EventArgs e)
        {
            if (CheckFeedbackFields())
            {
                Model.Ticket newTicket = new Model.Ticket
                {
                    Date        = ticket.Date,
                    Subject     = ticket.Subject,
                    User        = ticket.User,
                    Priority    = ticket.Priority,
                    Deadline    = ticket.Deadline,
                    Description = ticket.Description,
                    Type        = ticket.Type,
                    Status      = ticket.Status,
                    Feedback    = txt_Feedback.Text
                };

                ticketService.SendFeedback(id, newTicket);

                MessageBox.Show("Feedback saved!");
                this.Close();
            }
        }