public Main() { try { IconoBueno = new Icon(Path.Combine(Application.StartupPath + "\\" + Application.ProductName, @"..\Datos\IconoLibre.ico")); IconoRegular = new Icon(Path.Combine(Application.StartupPath + "\\" + Application.ProductName, @"..\Datos\IconoElegido.ico")); IconoMalo = new Icon(Path.Combine(Application.StartupPath + "\\" + Application.ProductName, @"..\Datos\IconoVendido.ico")); } catch { } InitializeComponent(); if (Login.Usuario() != "admin") { tabControl1.TabPages.Remove(tabPage2); tabControl1.TabPages.Remove(tabPage3); tabControl1.TabPages.Remove(tabPage4); } else { if (tabControl1.TabPages.Count == 1) { tabControl1.TabPages.Add(tabPage2); tabControl1.TabPages.Add(tabPage3); tabControl1.TabPages.Add(tabPage4); } } basedatos = new BaseDatos(); lbEmpleado.Text = Login.Usuario(); tablilla = new int[filas, butacas]; tickets = new Ticketss(); misPeliculas = new Peliculas(); pelicula = new Pelicula(); precio = new Precio(-1, -1, 1, 2, 0.5f, 0.18f, 4.25f); precios = new ArrayList(); comp = new Compra(); empleados = new Empleados(); individualIVA = precio.PrecioBase + (precio.PrecioBase * precio.Iva); individual = individualIVA; grafico = tabPage1.CreateGraphics(); esquinaInferiorX = ox + (tamaño * butacas) + tamaño; esquinaInferiorY = oy + (tamaño * filas) + tamaño; }
public void cargaPeliculas(ref Peliculas p) { p = new Peliculas(); command.CommandText = "select * from Pelicula where fechaInicio<='" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "' and fechaFin>='" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "'"; try { abreConexion(); reader = command.ExecuteReader(); while (reader.Read()) { string[] s = reader.GetString(5).Split(','); Pelicula pe = new Pelicula(reader.GetString(1), reader.GetInt32(10), reader.GetInt32(19), Path.Combine(Application.StartupPath + "\\" + Application.ProductName, @"\Datos\fotos\") + reader.GetString(3), numeroFV(reader.GetInt32(11)), numeroFV(reader.GetInt32(14)), numeroFV(reader.GetInt32(15)), numeroFV(reader.GetInt32(13)), numeroFV(reader.GetInt32(12)), numeroFV(reader.GetInt32(16)), reader.GetString(2), ref s, reader.GetString(6), reader.GetDateTime(17), reader.GetDateTime(18), reader.GetString(7), reader.GetString(8), reader.GetString(9), Path.Combine(Application.StartupPath + "\\" + Application.ProductName, @"\Datos\carteles\") + reader.GetString(4)); pe.IdPelicula = reader.GetInt32(0); p.ActualizaPelicula(ref pe, reader.GetInt32(19) - 1); } reader.Close(); cierraConexion(); } catch { } }
public Form3() { InitializeComponent(); peli = new Peliculas(); }