Esempio n. 1
0
 private void PictureBox5_Click(object sender, EventArgs e)
 {
     // por medio de la variable pasar muestra los modulos de configuracion y ayuda y oculta los que hay en pantalla
     if (pasar)
     {
         pn_empleados.Hide();
         Pn_pagos.Hide();
         Panel5.Hide();
         pn_configuracion.Hide();
         pasar = false;
         PictureBox5.BackgroundImage = Image.FromFile("imagenes/left.png");
         Panel1.BackgroundImage      = Image.FromFile("imagenes/ayuda (1).png");
         Label5.Text            = "Ayuda del Sistema";
         Panel4.BackgroundImage = Image.FromFile("imagenes/Acerca (2).png");
         Label8.Text            = "Acerca de";
     }
     else
     {
         pn_empleados.Show();
         Pn_pagos.Show();
         Panel5.Show();
         pn_configuracion.Show();
         pasar = true;
         PictureBox5.BackgroundImage = Image.FromFile("imagenes/right.png");
         Panel1.BackgroundImage      = Image.FromFile("imagenes/clientes 1.png");
         Label5.Text            = "Clientes";
         Panel4.BackgroundImage = Image.FromFile("imagenes/turnos 1.png");
         Label8.Text            = "Turnos";
     }
 }
Esempio n. 2
0
        private void frm_inicio_Load(object sender, EventArgs e)
        {
            // metodo pone un timer a funcionar para ir mostrado la hora en el sistema y se cambie
            timer1.Start();
            // antes de iniciar el programa implementa parametros para acomodar la interfaz dependiendo de la pantalla de computador
            PictureBox1.SetBounds(Screen.PrimaryScreen.Bounds.Width - 150, 15, PictureBox1.Width, PictureBox1.Height);
            pb_inicio.SetBounds(0, Screen.PrimaryScreen.Bounds.Height - 140, pb_inicio.Width, pb_inicio.Height);
            PictureBox3.SetBounds(Screen.PrimaryScreen.Bounds.Width - 60, 15, PictureBox3.Width, PictureBox3.Height);
            PictureBox4.SetBounds(10, 30, PictureBox4.Width, PictureBox4.Height);
            PictureBox5.SetBounds(this.Width - 200, this.Height - 100, PictureBox5.Width, PictureBox5.Height);
            Label1.SetBounds(100, 30, Label1.Width, Label1.Height);
            nombre.SetBounds(Screen.PrimaryScreen.Bounds.Width - 290, PictureBox1.Height - 40, nombre.Width, nombre.Height);
            Label4.SetBounds(Screen.PrimaryScreen.Bounds.Width - 290, PictureBox1.Height - 15, Label4.Width, Label4.Height);
            Label11.SetBounds(this.Width - 245, this.Height - 120, Label11.Width, Label11.Height);
            Label12.SetBounds(Screen.PrimaryScreen.Bounds.Width - 60, PictureBox3.Height + 15, Label12.Width, Label12.Height);
            Label4.SetBounds(Screen.PrimaryScreen.Bounds.Width - 220, PictureBox1.Height, Label4.Width, Label4.Height);
            pn_principal.SetBounds(PictureBox4.Width + 50, PictureBox4.Height + 40, Panel1.Width + pn_empleados.Width + Pn_pagos.Width + 400, Panel4.Height + Panel1.Height + 100);
            Panel1.SetBounds(PictureBox4.Width + 50, PictureBox4.Height + 40, Panel1.Width, Panel1.Height);
            pn_empleados.SetBounds(Panel1.Width + 350, PictureBox4.Height + 40, pn_empleados.Width, pn_empleados.Height);
            Pn_pagos.SetBounds(pn_empleados.Width + 800, PictureBox4.Height + 40, Pn_pagos.Width, Pn_pagos.Height);
            Panel4.SetBounds(PictureBox4.Width + 50, Panel1.Height + 200, Panel4.Width, Panel4.Height);
            Panel5.SetBounds(Panel4.Width + 350, Panel1.Height + 200, Panel5.Width, Panel5.Height);
            pn_configuracion.SetBounds(Panel5.Width + 800, Panel1.Height + 200, Panel5.Width, Panel5.Height);
            pn_principal.Hide();


            // obtiene los datos del usuario actual por medio de la variable ID

            DataSet ds = conexion.sqlconsulta("Select nombre,cedula,foto from  tbl_usuarios  where id_usuario='" + ID.ToString() + "'");

            nombre.Text = ds.Tables[0].Rows[0].ItemArray[0].ToString();
            Label4.Text = ds.Tables[0].Rows[0].ItemArray[1].ToString();

            try
            {
                PictureBox1.BackgroundImage       = Image.FromFile(ds.Tables[0].Rows[0].ItemArray[3].ToString());
                PictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
            }
            catch (Exception ex)
            {
                PictureBox1.BackgroundImage       = Image.FromFile(@"perfiles\profile.png");
                PictureBox1.BackgroundImageLayout = ImageLayout.Stretch;
            }

            var busqueda = new StreamReader("configuracion.cfg");

            String cadena;

            while ((cadena = busqueda.ReadLine()) != null)
            {
                string[] campos = cadena.Split(':');
                if (campos[0].Equals("Fondo"))
                {
                    this.BackgroundImage       = Image.FromFile("fondo/" + campos[1]);
                    this.BackgroundImageLayout = ImageLayout.Stretch;
                }
                cadena = busqueda.ReadLine();
            }


            busqueda.Close();
        }
Esempio n. 3
0
        private void PictureBox2_Click(object sender, EventArgs e)
        {
            // boton inicio por medio de la variable se pone en falso y muestra  los modulo y si la variable es verdara oculta los modulos
            if (pn_principal.Visible == true)
            {
                pn_principal.Controls.RemoveAt(0);

                pn_principal.Hide();
                if (pasar == true)
                {
                    Panel1.Show();
                    pn_empleados.Show();
                    Pn_pagos.Show();
                    Panel4.Show();
                    Panel5.Show();
                    pn_configuracion.Show();
                }
                else
                {
                    Panel1.Show();
                    Panel4.Show();
                }
                paso = false;
            }

            if (paso == true)
            {
                if (pasar == true)
                {
                    Panel1.Hide();
                    pn_empleados.Hide();
                    Pn_pagos.Hide();
                    Panel4.Hide();
                    Panel5.Hide();
                    pn_configuracion.Hide();
                }
                else
                {
                    Panel1.Hide();
                    Panel4.Hide();
                }
                paso = false;
            }
            else
            {
                if (pasar == true)
                {
                    Panel1.Show();
                    pn_empleados.Show();
                    Pn_pagos.Show();
                    Panel4.Show();
                    Panel5.Show();
                    pn_configuracion.Show();
                }
                else
                {
                    Panel1.Show();
                    Panel4.Show();
                }

                paso = true;
            }
        }