Пример #1
0
 public UserForm()
 {
     InitializeComponent();
     th               = new Theatre(db);
     custormer        = new Customer(dg_tickets);
     btn_cupon.Click += new EventHandler(cuponClick);
     try
     {
         cmd = new SQLiteCommand("Select * from ELOADASOK", db.GetConnecton());
         sda = new SQLiteDataAdapter(cmd);
         sda.Fill(dt);
         foreach (DataRow row in dt.Rows)
         {
             int    id   = int.Parse(row[0].ToString());
             String date = row[1].ToString();
             String name = row[2].ToString();
             Play   p    = new Play(id, date, name);
             listofPlays.Add(p);
             cmb_eloadasok.Items.Add(p.printOut());
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.StackTrace);
     }
 }
Пример #2
0
        public AdminForm()
        {
            InitializeComponent();
            th = new Theatre(db);
            try
            {
                dt  = new DataTable();
                cmd = new SQLiteCommand("Select * from ELOADASOK", db.GetConnecton());
                sda = new SQLiteDataAdapter(cmd);
                sda.Fill(dt);
                foreach (DataRow row in dt.Rows)
                {
                    int    id   = int.Parse(row[0].ToString());
                    String date = row[1].ToString();
                    String name = row[2].ToString();
                    Play   p    = new Play(id, date, name);
                    listofPlays.Add(p);
                    cmb_eloadasok.Items.Add(p.printOut());
                }

                dt  = new DataTable();
                cmd = new SQLiteCommand(
                    "SELECT id, ertek FROM KEDVEZMENYEK ", db.GetConnecton()
                    );
                sda = new SQLiteDataAdapter(cmd);
                sda.Fill(dt);
                foreach (DataRow r in dt.Rows)
                {
                    int id  = int.Parse(r[0].ToString());
                    int dsc = int.Parse(r[1].ToString());
                    discounts.Add(id, dsc);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.StackTrace);
            }
        }