Esempio n. 1
0
        private void empresaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var formulario = new frmEmpresa();

            formulario.MdiParent = this;
            Funcoes.AbrirTela(formulario);
        }
Esempio n. 2
0
        private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmEmpresa f = new frmEmpresa();

            f.MdiParent = this;
            f.Show();
            //  f.WindowState = FormWindowState.Maximized;
        }
        private void btnAgregarEmpresaContrata_Click(object sender, EventArgs e)
        {
            var frm = new frmEmpresa();

            frm.ShowDialog();


            LoadComboSoloEmpresas();
        }
Esempio n. 4
0
        private void menuConfigEmpresa_Click(object sender, EventArgs e)
        {
            frmEmpresa form = new frmEmpresa(empresa)
            {
                MdiParent = this
            };

            form.Show();
            empresa = form.empresa;
        }
Esempio n. 5
0
        private void btnContinuar_Click(object sender, EventArgs e)
        {
            try
            {
                // se ingresaron en pantalla username y password del nuevo cliente
                ValidarCampos();

                // se instancia un nuevo usuario y se setean sus atributos
                Usuario unUsuarioNuevo = new Usuario();

                unUsuarioNuevo.Username          = txtUsername.Text;
                unUsuarioNuevo.Clave             = Encryptor.GetSHA256(txtPassword.Text);
                unUsuarioNuevo.ClaveAutoGenerada = false;
                unUsuarioNuevo.Activo            = true;

                unUsuarioNuevo.guardarDatosDeUsuarioNuevo();

                // ya se inserto el nuevo usuario en la base de datos
                // segun si el rol seleccionado fue empresa o cliente muestro el formulario
                // correspondiente para el insert de los datos. Para esto necesito traerme el id
                // del nuevo usuario insertado.

                if (cmdRol.Text == "Empresa")
                {
                    frmEmpresa _frmEmpresa = new frmEmpresa();
                    _frmEmpresa.AbrirParaRegistrarNuevaEmpresa(unUsuarioNuevo.Id_Usuario);
                    this.Hide();
                }
                if (cmdRol.Text == "Cliente")
                {
                    frmCliente _frmCliente = new frmCliente();
                    _frmCliente.AbrirParaRegistrarNuevoCliente(unUsuarioNuevo.Id_Usuario);
                    this.Hide();
                }
            }
            catch (EntidadExistenteException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (ErrorConsultaException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (BadInsertException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 6
0
 private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (permitir("frmEmpresa"))
     {
         frmEmpresa f = new frmEmpresa();
         f.MdiParent = this;
         f.Show();
     }
     else
     {
         sinPermiso();
     }
     //  f.WindowState = FormWindowState.Maximized;
 }
Esempio n. 7
0
        private void empresaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmEmpresa frm = new frmEmpresa();

            frm.ShowDialog();
        }
Esempio n. 8
0
        private void frmMdi_Load(object sender, EventArgs e)
        {
            RegistryKey equipoLocal = Registry.CurrentUser;

            equipoLocal = equipoLocal.OpenSubKey(@"Software\\VeoSystem", true);
            string Licencia = string.Empty;

            if (equipoLocal == null)
            {
                this.Hide();

                equipoLocal = Registry.CurrentUser;
                equipoLocal = equipoLocal.OpenSubKey(@"Software", true);

                RegistryKey VeoSystem = equipoLocal.CreateSubKey("VeoSystem");

                VeoSystem.SetValue("Caja", 0, RegistryValueKind.String);
                VeoSystem.SetValue("Licencia", "", RegistryValueKind.String);
                VeoSystem.SetValue("FechaInst", "", RegistryValueKind.String);
                VeoSystem.SetValue("Servidor", "", RegistryValueKind.String);
                VeoSystem.SetValue("Empresa", "", RegistryValueKind.String);
                VeoSystem.SetValue("Tipo", "", RegistryValueKind.String);
                VeoSystem.SetValue("Version", "", RegistryValueKind.String);

                Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString();

                if (Sistema_Cls.GblStrLicencia == "")
                {
                    frmLicencia frmlicencias = new frmLicencia();
                    if (frmlicencias.ShowDialog() == DialogResult.OK)
                    {
                        frmServidor frmservidor = new frmServidor();
                        if (frmservidor.ShowDialog() == DialogResult.OK)
                        {
                            Empresa_Ctl objEmpresa = new Empresa_Ctl();

                            Licencia = Sistema_Cls.DesEncripta(Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString());

                            BindingSource dbEmpresa = new BindingSource();
                            dbEmpresa.DataSource = objEmpresa.DatosEmpresa(Licencia);

                            frmEmpresa frmempresa = new frmEmpresa(dbEmpresa);
                            if (frmempresa.ShowDialog() == DialogResult.OK)
                            {
                                frmInicioSesion frminiciosesion = new frmInicioSesion();
                                if (frminiciosesion.ShowDialog() == DialogResult.OK)
                                {
                                    this.Show();
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                equipoLocal = Registry.CurrentUser;
                equipoLocal = equipoLocal.OpenSubKey(@"Software", true);

                RegistryKey VeoSystem = equipoLocal.CreateSubKey("VeoSystem");

                Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString();
                Sistema_Cls.GblStrServidor = VeoSystem.GetValue("Servidor").ToString();
                Sistema_Cls.GblStrEmpresa  = VeoSystem.GetValue("Empresa").ToString();

                this.Hide();

                if (Sistema_Cls.GblStrLicencia == "")
                {
                    frmLicencia frmlicencias = new frmLicencia();
                    if (frmlicencias.ShowDialog() == DialogResult.OK)
                    {
                        frmServidor frmservidor = new frmServidor();
                        if (frmservidor.ShowDialog() == DialogResult.OK)
                        {
                            Empresa_Ctl objEmpresa = new Empresa_Ctl();

                            Licencia = Sistema_Cls.DesEncripta(Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString());

                            BindingSource dbEmpresa = new BindingSource();
                            dbEmpresa.DataSource = objEmpresa.DatosEmpresa(Licencia);

                            frmEmpresa frmempresa = new frmEmpresa(dbEmpresa);
                            if (frmempresa.ShowDialog() == DialogResult.OK)
                            {
                                frmInicioSesion frminiciosesion = new frmInicioSesion();
                                if (frminiciosesion.ShowDialog() == DialogResult.OK)
                                {
                                    this.Show();
                                }
                            }
                            else
                            {
                                this.Close();
                            }
                        }
                        else
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    if (Sistema_Cls.GblStrServidor == "")
                    {
                        frmServidor frmservidor = new frmServidor();
                        if (frmservidor.ShowDialog() == DialogResult.OK)
                        {
                            Empresa_Ctl objEmpresa = new Empresa_Ctl();

                            Licencia = Sistema_Cls.DesEncripta(Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString());

                            BindingSource dbEmpresa = new BindingSource();
                            dbEmpresa.DataSource = objEmpresa.DatosEmpresa(Licencia);

                            frmEmpresa frmempresa = new frmEmpresa(dbEmpresa);
                            if (frmempresa.ShowDialog() == DialogResult.OK)
                            {
                                frmInicioSesion frminiciosesion = new frmInicioSesion();
                                if (frminiciosesion.ShowDialog() == DialogResult.OK)
                                {
                                    this.Show();
                                }
                            }
                            else
                            {
                                this.Close();
                            }
                        }
                        else
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        if (Sistema_Cls.GblStrEmpresa == "")
                        {
                            Empresa_Ctl objEmpresa = new Empresa_Ctl();

                            Licencia = Sistema_Cls.DesEncripta(Sistema_Cls.GblStrLicencia = VeoSystem.GetValue("Licencia").ToString());

                            BindingSource dbEmpresa = new BindingSource();
                            dbEmpresa.DataSource = objEmpresa.DatosEmpresa(Licencia);

                            frmEmpresa frmempresa = new frmEmpresa(dbEmpresa);
                            if (frmempresa.ShowDialog() == DialogResult.OK)
                            {
                                frmInicioSesion frminiciosesion = new frmInicioSesion();
                                if (frminiciosesion.ShowDialog() == DialogResult.OK)
                                {
                                    this.Show();
                                }
                            }
                            else
                            {
                                this.Close();
                            }
                        }
                        else
                        {
                            frmInicioSesion frminiciosesion = new frmInicioSesion();
                            if (frminiciosesion.ShowDialog() == DialogResult.OK)
                            {
                                this.Show();
                            }
                            else
                            {
                                this.Close();
                            }
                        }
                    }
                }
            }
        }