public void iniciar_sesion() { Principal___Logueo PL = new Principal___Logueo(this.session); //PL.MdiParent = this; PL.ShowDialog(); if (PL.DialogResult == DialogResult.Yes) { DateTime f = DateTime.Now; string minutos = f.Minute.ToString(); if ((int)f.Minute < 10) { minutos = "0" + minutos; } this.session = PL.session; this.Text = "Carrito de Compras - " + this.session.username; iniciarSesionToolStripMenuItem.Enabled = false; cerrarSesionToolStripMenuItem.Enabled = true; if (this.session.tipo == "CLIENT") { productosToolStripMenuItem.Enabled = false; //herramientasToolStripMenuItem.Enabled = false; ordenesDeCompraToolStripMenuItem.Enabled = false; comprasToolStripMenuItem.Enabled = true; nuevaToolStripMenuItem.Enabled = true; toolStripStatusLabel1.Text = "Sesion Iniciada el " + f.Day + "/" + f.Month + "/" + f.Year + " a las " + Convert.ToString(f.Hour) + ":" + minutos + " - Modo Cliente"; clientesToolStripMenuItem.Enabled = false; } else { nuevaToolStripMenuItem.Enabled = false; ordenesDeCompraToolStripMenuItem.Enabled = true; productosToolStripMenuItem.Enabled = true; //herramientasToolStripMenuItem.Enabled = true; comprasToolStripMenuItem.Enabled = true; clientesToolStripMenuItem.Enabled = true; toolStripStatusLabel1.Text = "Sesion Iniciada el " + f.Day + "/" + f.Month + "/" + f.Year + " a las " + Convert.ToString(f.Hour) + ":" + minutos + " - Modo Administrador"; } } }
public void iniciar_sesion() { Principal___Logueo PL = new Principal___Logueo(this.session); //PL.MdiParent = this; PL.ShowDialog(); if(PL.DialogResult==DialogResult.Yes) { DateTime f = DateTime.Now; string minutos = f.Minute.ToString(); if ((int)f.Minute < 10) { minutos = "0" + minutos; } this.session = PL.session; this.Text = "Carrito de Compras - " + this.session.username; iniciarSesionToolStripMenuItem.Enabled = false; cerrarSesionToolStripMenuItem.Enabled = true; if (this.session.tipo == "CLIENT") { productosToolStripMenuItem.Enabled = false; //herramientasToolStripMenuItem.Enabled = false; ordenesDeCompraToolStripMenuItem.Enabled = false; comprasToolStripMenuItem.Enabled = true; nuevaToolStripMenuItem.Enabled = true; toolStripStatusLabel1.Text = "Sesion Iniciada el " + f.Day + "/" + f.Month + "/" + f.Year + " a las " + Convert.ToString(f.Hour) + ":" + minutos + " - Modo Cliente"; clientesToolStripMenuItem.Enabled = false; } else { nuevaToolStripMenuItem.Enabled = false; ordenesDeCompraToolStripMenuItem.Enabled = true; productosToolStripMenuItem.Enabled = true; //herramientasToolStripMenuItem.Enabled = true; comprasToolStripMenuItem.Enabled = true; clientesToolStripMenuItem.Enabled = true; toolStripStatusLabel1.Text = "Sesion Iniciada el " + f.Day + "/" + f.Month + "/" + f.Year + " a las " + Convert.ToString(f.Hour) + ":" + minutos + " - Modo Administrador"; } } }