Exemple #1
0
        private void MDI_Load(object sender, EventArgs e)
        {
            MdiClient mdi;

            foreach (Control ctl in this.Controls)
            {
                try
                {
                    mdi           = (MdiClient)ctl;
                    mdi.BackColor = this.BackColor;
                }
                catch (Exception ex)
                {
                    Console.Write(ex);
                }
            }
            timer1.Start();
            lbl_fecha.Text = DateTime.Now.ToLongDateString();
            lbl_hora.Text  = DateTime.Now.ToLongTimeString();

            InicioSesionForm login = new InicioSesionForm();

            login.BringToFront();
            login.ShowDialog();
            Usuario user = new Usuario();

            lbl_user.Text = user.obtenerUsuario();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            MdiClient ctlMDI;

            foreach (Control ctl in this.Controls)
            {
                try
                {
                    ctlMDI           = (MdiClient)ctl;
                    ctlMDI.BackColor = this.BackColor;
                }
                catch (InvalidCastException exc)
                {
                }
            }
            DateTime fecha = DateTime.Now;

            this.labelFecha.Text = String.Format("{0:MM/dd/yyyy}", DateTime.Now);
            this.labelHora.Text  = String.Format("{0:HH:mm:ss}", DateTime.Now);
            timer1.Interval      = 1000;
            timer1.Start();
            panel2.Location    = new Point(20, this.Height - 175);
            panel3.Location    = new Point(this.Width - 300, this.Height - 115);
            Btn_close.Location = new Point(this.Width - 41, 0);
            Btn_min.Location   = new Point(this.Width - 82, 0);
            InicioSesionForm inicioSes = new InicioSesionForm();

            inicioSes.FormClosed += new FormClosedEventHandler(form2_FormClosed);
            inicioSes.ShowDialog();
            inicioSes.TopMost = true;
            inicioSes.Activate();
        }
Exemple #3
0
        private void salirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InicioSesionForm login = new InicioSesionForm();

            login.BringToFront();
            login.ShowDialog();
            Usuario user = new Usuario();

            lbl_user.Text = user.obtenerUsuario();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //this.panel1.Size = this.Size;
            InicioSesionForm inicioSes = new InicioSesionForm();

            inicioSes.FormClosed += new FormClosedEventHandler(form2_FormClosed);
            inicioSes.ShowDialog();
            inicioSes.TopMost = true;
            inicioSes.Activate();
        }
 private void Permisos()
 {
     if (InicioSesionForm.GetUsuario().Cargo != "Administrador")
     {
         usuariosToolStripMenuItem1.Enabled = false;
     }
     else
     {
         usuariosToolStripMenuItem1.Enabled = true;
     }
 }
Exemple #6
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            FormCollection formulariosApp = Application.OpenForms;

            foreach (Form f in formulariosApp)
            {
                f.Hide();
            }
            InicioSesionForm cc = new InicioSesionForm();

            cc.Show();
        }
Exemple #7
0
 private void LlenarLabel()
 {
     NombreUsuariolabel.Text = InicioSesionForm.GetUsuario().Nombres;
 }