Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ConcertContext db        = new ConcertContext();
            SingerContext  dw        = new SingerContext();
            Concert        concert   = new Concert();
            var            FN        = openFileDialog1.FileName.Split('\\');
            var            fileOfPic = "ConcertWallpapers\\" + FN.Last();

            pictureBox2.Image.Save(fileOfPic);
            concert.Place       = materialSingleLineTextField1.Text;
            concert.Tickets     = Convert.ToInt32(materialSingleLineTextField2.Text);
            concert.TicketPrice = Convert.ToInt32(materialSingleLineTextField3.Text);
            concert.Name        = materialSingleLineTextField4.Text;
            concert.WallPaper   = fileOfPic;
            concert.Singers     = dw.Singers.FirstOrDefault(p => p.Login == comboBox1.Text);
            concert.Date        = dateTimePicker1.Text;
            ManagerContext mc = new ManagerContext();

            concert.Manager = mc.Managers.Find(man_id);
            //concert.SingerName = comboBox1.Text;
            db.Concerts.Add(concert);
            db.SaveChanges();
        }
Beispiel #2
0
 public void InformSinger(Singer s, ref Concert c)
 {
     s.NextConcert = c.Date;
 }
Beispiel #3
0
 public void BuyTicket(ref Concert c)
 {
     c.Tickets--;
     Withdraw(c.TicketPrice);
     base.sleep();//2.6
 }