Beispiel #1
0
        private void frmEmpresa_Load(object sender, EventArgs e)
        {
            string[] emp = Globales.Empresa.CapturarEmpresa();
            this.Hide();
            if (emp[0] == "No Autenticado")
            {
                MessageBox.Show("Debe crear una empresa", "Seguridad SAD",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                Empresas frm = new Empresas();
                frm.txtCod.ReadOnly     = true;
                frm.txtCod.Visible      = false;
                frm.btnEditar.Enabled   = false;
                frm.btnEliminar.Enabled = false;
                frm.txtCod.ReadOnly     = true;
                frm.ShowInTaskbar       = false;
                frm.StartPosition       = FormStartPosition.CenterScreen;
                frm.ShowDialog(mostrarEmpresa.ActiveForm);

                Empleados frm2 = new Empleados();
                frm2.ShowInTaskbar = false;
                frm2.StartPosition = FormStartPosition.CenterScreen;
                frm2.ShowDialog(mostrarEmpresa.ActiveForm);
                this.Show();
            }
            ActualizarGridView();
        }
Beispiel #2
0
        private void gvEmpresas_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var    dataIndexNo = gvEmpresas.Rows[e.RowIndex].Index.ToString();
            string cellValue   = gvEmpresas.Rows[e.RowIndex].Cells[1].Value.ToString();

            id             = gvEmpresas.Rows[e.RowIndex].Cells[0].Value.ToString();
            Empresa        = gvEmpresas.Rows[e.RowIndex].Cells[1].Value.ToString();
            idSede         = gvEmpresas.Rows[e.RowIndex].Cells[2].Value.ToString();
            idMoneda       = gvEmpresas.Rows[e.RowIndex].Cells[4].Value.ToString();
            razon          = gvEmpresas.Rows[e.RowIndex].Cells[6].Value.ToString();
            direccion      = gvEmpresas.Rows[e.RowIndex].Cells[7].Value.ToString();
            telefono       = gvEmpresas.Rows[e.RowIndex].Cells[8].Value.ToString();
            identificacion = gvEmpresas.Rows[e.RowIndex].Cells[9].Value.ToString();

            Empresas frm = new Empresas();

            frm.txtCod.Text            = id;
            frm.txtEmpresa.Text        = Empresa;
            frm.txtActivo.Text         = "1";
            frm.txtRazon.Text          = razon;
            frm.txtDireccion.Text      = direccion;
            frm.txtTelefono.Text       = telefono;
            frm.txtIdentificacion.Text = identificacion;
            frm.btnEditar.Enabled      = true;
            frm.btnEliminar.Enabled    = true;
            frm.btnGuardar.Enabled     = false;
            frm.txtCod.ReadOnly        = true;
            frm.ShowInTaskbar          = false;
            frm.StartPosition          = FormStartPosition.CenterParent;
            frm.ShowDialog(mostrarMenu.ActiveForm);
        }