Example #1
0
 public void createticket()
 {
     DYDP mydydp = new DYDP();
     var ticket = new ticketinfo { ticketid =2, moviename = "黑衣人3", starttime = "11:30", seatid = 8, hallid = 2, movietime = 117, price = 70, seller = 1 };
     mydydp.CreateTicket(ticket);
     ticketinfo tic = mydydp.GetTicketById(2);
     int Id = tic.ticketid;
     Assert.AreEqual(2, Id);
 }
Example #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     string name = label10.Text.ToString();
     int hallid = Int32.Parse(label11.Text);
     int seatid = Int32.Parse(label12.Text);
     string starttime = label13.Text.ToString();
     int movietime = Int32.Parse(label14.Text);
     int price = Int32.Parse(label15.Text);
     int sellerid = Int32.Parse(label16.Text);
     ticketinfo ticket = new ticketinfo { moviename =name, hallid=hallid,seatid=seatid,starttime=starttime, movietime =movietime,price=price,seller=sellerid};
     mydydp.CreateTicket(ticket);
     MessageBox.Show("订票成功!");
     this.Close();
     selectform selectfo = new selectform(name,sellerid);
     selectfo.Show();
 }
Example #3
0
 //产生电影票
 public void CreateTicket(ticketinfo ticket)
 {
     Session.Save(ticket);
     Session.Flush();
 }