private void lbGrupos_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Cargar los Derechos del Grupo Seleccionado
            parametros = "|V2=" + nodoActual.Tag.ToString() + "|V7=" + lbGrupos.SelectedValue.ToString() + "|";
            validar    = "204";
            Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!Datos.bOk)
            {
                chkAgregar.Checked   = false;
                chkEliminar.Checked  = false;
                chkExportar.Checked  = false;
                chkImprimir.Checked  = false;
                chkLectura.Checked   = false;
                chkModificar.Checked = false;
            }
            else
            {
                chkAgregar.Checked   = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightAdd"]);
                chkEliminar.Checked  = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightDelete"]);
                chkExportar.Checked  = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightExport"]);
                chkImprimir.Checked  = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightPrint"]);
                chkLectura.Checked   = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightRead"]);
                chkModificar.Checked = Convert.ToBoolean(Datos.ds.Tables[0].Rows[0]["RightModify"]);
            }

            bRead   = chkLectura.Checked;
            bPrint  = chkImprimir.Checked;
            bExport = chkExportar.Checked;
            bAdd    = chkAgregar.Checked;
            bModify = chkModificar.Checked;
            bDelete = chkEliminar.Checked;

            gbDerechos.Visible = true;
        }
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            frmAgregarGrupo nuevoGrupo = new frmAgregarGrupo();

            nuevoGrupo.idNodoActual  = nodoActual == null ? "0" : nodoActual.Tag.ToString();
            nuevoGrupo.StartPosition = FormStartPosition.CenterParent;

            if (nuevoGrupo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //Obtner lo que selecciono el usuario
                var x = nuevoGrupo.cboGrupos.SelectedValue;

                //Grabar los Datos del Grupo en la B.D.
                parametros = "|V2=" + nodoActual.Tag.ToString() + "|V7=" + x.ToString() + "|L1=0|L2=0|L3=0|L4=0|L5=0|L6=0|";
                validar    = "203";
                Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
                if (!Datos.bOk)
                {
                    MessageBox.Show("Problemas al afectar los Derechos del Grupo\n\r" + parametros + "\n\r" + Datos.sResultado);
                    return;
                }

                //Recargar Derechos
                CargarDerechos();
            }
        }
Esempio n. 3
0
        void cargarDatos(string idExpediente)
        {
            this.datosRegistro     = new ClsDatosComunesRegistro();
            this.datosModificacion = new ClsDatosComunesRegistro();
            this.datosEliminacion  = new ClsDatosComunesRegistro();

            if (idExpediente == "*" || idExpediente == "0" || idExpediente == "")
            {
                //Iniciar todas las variables por ser elemento nuevo
                this._id            = "0";
                this.idPadre        = "0";
                this.idFormulario   = "";
                this.idLlave        = "";
                datosRegistro.fecha = DateTime.Now;
            }
            else
            {
                //Cargar los Datos desde la B.D.
                this.validar    = "1";
                this.parametros = "|V1=" + idExpediente.ToString().Trim() + "|";
                regreso         = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
                if (regreso.bOk)
                {
                    //Regreso el Dato de Manera Correcta
                    cargarDatos(regreso.ds.Tables[0].Rows[0]);
                }
                else
                {
                    throw new System.InvalidOperationException("Error al Cargar Datos \r\nNo Existe el registro en la Base de Datos");
                }
            }
        }
Esempio n. 4
0
        void cargarDatos(string idFormulario)
        {
            this.datosRegistro     = new ClsDatosComunesRegistro();
            this.datosModificacion = new ClsDatosComunesRegistro();
            this.datosEliminacion  = new ClsDatosComunesRegistro();

            if (idFormulario == "*" || idFormulario == "0" || idFormulario == "")
            {
                //Iniciar todas las variables para el elemento nuevo
                this._id               = "0";
                this.descripcion       = "";
                this.clasificacion     = 0;
                this.tipoFormulario    = 1;
                this.camposAutomaticos = false;
                this.consultaExterna   = "";
            }
            else
            {
                //Cargar los datos desde la B.D.
                this.validar    = "2";
                this.parametros = "|V1=" + idFormulario + "|";
                regreso         = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
                if (regreso.bOk)
                {
                    //Regreso el Dato de Manera Correcta
                    cargarDatos(regreso.ds.Tables[0].Rows[0]);
                }
                else
                {
                    throw new System.InvalidOperationException("Error al Cargar Datos \r\nNo Existe el registro en la Base de Datos");
                }
            }
        }
Esempio n. 5
0
        void cargarDatos(string idClasificacion)
        {
            this.datosRegistro     = new ClsDatosComunesRegistro();
            this.datosModificacion = new ClsDatosComunesRegistro();
            this.datosEliminacion  = new ClsDatosComunesRegistro();

            if (idClasificacion == "*" || idClasificacion == "0" || idClasificacion == "")
            {
                //Iniciar todas la variables
                this._id         = "0";
                this.descripcion = "";
            }
            else
            {
                //Cargar los Datos desde la Base de Datos
                this.validar    = "2";
                this.parametros = "|V1=" + idClasificacion.ToString() + "|";
                regreso         = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
                if (regreso.bOk)
                {
                    //Regreso el Dato de Manera Correcta
                    cargarDatos(regreso.ds.Tables[0].Rows[0]);
                }
                else
                {
                    throw new System.InvalidOperationException("Error al Cargar Datos \r\nNo Existe un registro en la Base de Datos");
                }
            }
        }
Esempio n. 6
0
        private void btnAgregarCategoria_Click(object sender, EventArgs e)
        {
            frmNewCategoria frm = new frmNewCategoria();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                //Se procede a guadar una nueva Categoria
                //sin repetir en caso de existir otra igual
                validar    = "12";
                parametros = "|V11=" + frm.txtNombre.Text.Trim() + "|V12=" + frm.txtDescripcion.Text.Trim() + "|";
                datos      = acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
                if (!datos.bOk)
                {
                    MessageBox.Show("Problemas al accesar los Datos");
                    this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                    this.Close();
                    return;
                }

                //Cargar de nuevo el combo Box
                validar = "11";
                datos   = acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
                if (!datos.bOk)
                {
                    //Problemas al Accesar los Datos
                    MessageBox.Show("Problemas al accesar los Datos");
                    this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                    this.Close();
                    return;
                }

                cboCategorias.DataSource = datos.ds.Tables[0];
            }
        }
Esempio n. 7
0
 public bool guardarDatos(string user = "******")
 {
     //Guardar los Datos del Formulario
     this.validar    = "4";
     this.parametros = "|V1=" + this._id.ToString() + "|V2=" + this.descripcion.ToString().Trim() + "|V4=" + this.tipoFormulario.ToString()
                       + "|V5=" + Convert.ToByte(this.camposAutomaticos).ToString() + "|V6=" + this.consultaExterna.ToString()
                       + "|C1=" + user.ToString() +
                       "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString() + "|";
     regreso = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
     if (regreso.bOk)
     {
         //Grabación de Cabezera correcta, seguir con campos
         foreach (clsFormularioCampo c in campos)
         {
             c.idFormulario = this._id;
             if (!c.guardarDatos())
             {
                 throw new System.InvalidOperationException("Error al Guardar Datos \r\nProblemas con el registro a guadar ");
             }
         }
         cargarDatos(regreso.ds.Tables[0].Rows[0]);
         return(true);
     }
     else
     {
         throw new System.InvalidOperationException("Error al Guardar Datos \r\nProblemas con el registro a guadar " + this._id);
     }
 }
Esempio n. 8
0
        public bool guardarDatos(string user = "******")
        {
            enc.key = this.key;
            enc.IV  = this.IV;

            //Preparar Datos de Envio a SQL Server
            this.validar    = "4";
            this.parametros = "|V1=" + this.loginName.ToString() + "|V2=" + this.nombreCompleto +
                              "|V3=" + this.puesto + "|V4=" + enc.CryptoDecryptor(this.claveAcceso, clsSeguridad.Crypto.CryptoAction.Encrypt) +
                              "|V5=" + this.correo + "|V6=" + this.idGrupo.ToString() +
                              "|V7=" + Convert.ToByte(this.activo) + "|V8=" + this._id.ToString() +
                              "|C1=" + user.ToString() +
                              "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString() + "|";

            //Envio de Datos y Lectura de Resultados
            regreso = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
            if (regreso.bOk)
            {
                cargarDatos(regreso.ds.Tables[0].Rows[0]);
                return(true);
            }
            else
            {
                throw new System.InvalidOperationException("Error al intentar guardar Datos \r\nRevisar acceso a Base de Datos");
            }
        }
Esempio n. 9
0
        public bool guardarDatos(string user = "******")
        {
            //Preparar Datos de Envio a SQL Server
            this.validar    = "4";
            this.parametros = "|V1=" + this._id + "|V2=" + this.descripcion + "|V3=" + this.explicacion +
                              "|V4=" + this.tipoCampo.id + "|V5=" + this.clasificacion.id +
                              "|V6=" + this.longitud + "|V7=" + this.campo_Valor +
                              "|V8=" + this.campo_Valor +
                              "|V9=" + this.consulta +
                              "|V10=" + this.obligatorio.ToString() +
                              "|C1=" + user.ToString() +
                              "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString() + "|";

            //Envio de Datos y Lectura de Resultados
            regreso = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
            if (regreso.bOk)
            {
                cargarDatos(regreso.ds.Tables[0].Rows[0]);
                return(true);
            }
            else
            {
                throw new System.InvalidOperationException("Error al intentar guardar Datos \r\nRevisar acceso a Base de Datos");
            }
        }
Esempio n. 10
0
        public bool guardarDatos(string user = "******")
        {
            if (this._tipoCampo == TipoCampo.Expediente)
            {
                procedimiento = "sp_Datos_Expedientes_Campos";
            }
            else if (this._tipoCampo == TipoCampo.Documento)
            {
                procedimiento = "sp_Datos_Documentos_Campos";
            }
            validar    = "2";
            parametros = "|V1=" + _idPadre.ToString() +
                         "|V2=" + _campo.id.ToString() +
                         "|V3=" + this.valor.ToString() + "|" +
                         "|C1=" + user.ToString() +
                         "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();

            //Invocar el WebService
            regreso = AccesoDatos.ivkProcedimiento(procedimiento, validar, parametros, vGlobales.conexion, null);
            if (regreso.bOk)
            {
                this._msgError = regreso.sResultado;
                return(true);
            }

            return(false);
        }
Esempio n. 11
0
        private void frmAgregarNodo_Load(object sender, EventArgs e)
        {
            validar    = "2";
            parametros = "|V2=" + idNodoPadre + "|";
            Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (Datos.bOk)
            {
                if (Convert.ToInt16(Datos.ds.Tables[0].Rows[0]["Tipo"]) == 0)
                {
                    cboTipo.Items.Add("Carpeta");
                    cboTipo.Items.Add("Expediente");
                }
                else if (Convert.ToInt16(Datos.ds.Tables[0].Rows[0]["Tipo"]) == 1)
                {
                    cboTipo.Items.Add("Documento Final");
                }
                cboFormularios.Enabled = true;
                label2.Enabled         = true;
            }
            else
            {
                cboTipo.Items.Add("Carpeta");
                cboFormularios.Enabled = false;
                label2.Enabled         = false;
            }

            cboTipo.SelectedItem = cboTipo.Items[0];
        }
Esempio n. 12
0
        private void frmGuardar_Load(object sender, EventArgs e)
        {
            //Cargar el Catalogo de Categorias
            validar = "11";

            datos = acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!datos.bOk)
            {
                //Problemas al Accesar los Datos
                MessageBox.Show("No Existen Categorias, Favor de Agregar alguna");
                return;
            }

            cboCategorias.DataSource = datos.ds.Tables[0];
            this.txtReporte.Text     = cNombre;
            this.txtDescripcion.Text = cDescripcion;
            if (idReporte == "" || chkNuevo.Checked == true)
            {
                this.Text = "Guardando Reporte ...";
            }
            else
            {
                this.Text = "Guardando Reporte - " + idReporte.ToString();
            }
        }
Esempio n. 13
0
        private void cboTipo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (((ComboBox)sender).Text == "Carpeta")
            {
                cboFormularios.Enabled  = false;
                iTXTDescripcion.Enabled = true;
            }
            else
            {
                cboFormularios.Enabled  = true;
                iTXTDescripcion.Enabled = false;

                //Cargar el combo de los tipos de formularios
                //Expedientes o Documentos finales

                procedimiento = "sp_ConfigFormularios"; validar = "1"; parametros = "|V4=" + (((ComboBox)sender).Text == "Expediente" ? "1" : "2");
                Datos         = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
                if (Datos.bOk)
                {
                    cboFormularios.DataSource    = Datos.ds.Tables[0];
                    cboFormularios.ValueMember   = "Id";
                    cboFormularios.DisplayMember = "Descripcion";
                    cboFormularios.SelectedValue = Datos.ds.Tables[0].Rows[0]["Id"];
                }
            }
        }
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            //Guardar los Cambios
            //Grabar los Datos del Grupo en la B.D.
            parametros = "|V2=" + nodoActual.Tag.ToString() + "|V7=" + lbGrupos.SelectedValue.ToString()
                         + "|L1=" + Convert.ToSByte(chkLectura.Checked).ToString()
                         + "|L2=" + Convert.ToSByte(chkImprimir.Checked).ToString()
                         + "|L3=" + Convert.ToSByte(chkExportar.Checked).ToString()
                         + "|L4=" + Convert.ToSByte(chkModificar.Checked).ToString()
                         + "|L5=" + Convert.ToSByte(chkAgregar.Checked).ToString()
                         + "|L6=" + Convert.ToSByte(chkEliminar.Checked).ToString() + "|"
                         + "|C1=" + Clases.vGlobales.id_User
                         + "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();;
            validar = "203";
            Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!Datos.bOk)
            {
                MessageBox.Show("Problemas al afectar los Derechos del Grupo\n\r" + parametros + "\n\r" + Datos.sResultado);
                return;
            }

            //Cambiar los Estus
            bRead   = chkLectura.Checked;
            bPrint  = chkImprimir.Checked;
            bExport = chkExportar.Checked;
            bAdd    = chkAgregar.Checked;
            bModify = chkModificar.Checked;
            bDelete = chkEliminar.Checked;

            btnGuardar.Visible = false;
        }
        private void agregarNodoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Agregar nuevo Nodo
            frmAgregarNodo frmNewNodo = new frmAgregarNodo();

            frmNewNodo.idNodoPadre = nodoActual == null ? "0" : nodoActual.Tag.ToString();
            if (frmNewNodo.ShowDialog() == DialogResult.OK)
            {
                //Agregar el nodo nuevo en la base de datos y en el TreeNode de Pantalla
                string tipoArbol   = "";
                string formulario  = "";
                string descripcion = "";

                formulario = (frmNewNodo.cboFormularios.SelectedValue == null ? "0" : frmNewNodo.cboFormularios.SelectedValue.ToString());

                if (frmNewNodo.cboTipo.Text == "Documento Final")
                {
                    tipoArbol   = "2";
                    descripcion = frmNewNodo.cboFormularios.Text;
                }

                if (frmNewNodo.cboTipo.Text == "Expediente")
                {
                    tipoArbol   = "1";
                    descripcion = frmNewNodo.cboFormularios.Text;
                }

                if (frmNewNodo.cboTipo.Text == "Carpeta")
                {
                    tipoArbol   = "0";
                    formulario  = "0";
                    descripcion = frmNewNodo.iTXTDescripcion.Text.ToString();
                }

                parametros = "V1=" + frmNewNodo.idNodoPadre + "|V3=" + descripcion
                             + "|V4=" + tipoArbol + "|V5=" + formulario + "|"
                             + "|C1=" + Clases.vGlobales.id_User
                             + "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();
                validar = "3";
                Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);

                MessageBox.Show(Clases.clsCadenas.obtenerValor("2M", Datos.sResultado, "|"));

                if (Datos.bOk)
                {
                    //Actualizar el TreeView
                    if (nodoActual != null)
                    {
                        nodoActual.Nodes.Clear();
                    }
                    else
                    {
                        tvArbolGeneral.Nodes.Clear();
                    }

                    cargarArbol(Convert.ToInt16(frmNewNodo.idNodoPadre), nodoActual);
                }
            }
        }
        private void tvArbolGeneral_MouseUp(object sender, MouseEventArgs e)
        {
            //Saber si existe un nodo en la posición Actual
            nodoActual = this.tvArbolGeneral.GetNodeAt(e.X, e.Y);

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                if (nodoActual == null)
                {
                    //Quitar opciones del menu contextual
                    this.deshabilitarNodoToolStripMenuItem.Enabled = false;
                    this.habilitarNodoToolStripMenuItem.Enabled    = false;
                    this.eliminarNodoToolStripMenuItem.Enabled     = false;
                    this.copiarToolStripMenuItem.Enabled           = false;
                }
                else
                {
                    //Cargar Datos del Nodo para comportamiento de menu contextual
                    parametros = "|V2=" + nodoActual.Tag.ToString() + "|" +
                                 "|C1=" + Clases.vGlobales.id_User +
                                 "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();;
                    validar = "2";
                    Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);

                    if (Datos.bOk)
                    {
                        //Consulta correcta
                        if ((bool)Datos.ds.Tables[0].Rows[0]["Activo"])
                        {
                            this.deshabilitarNodoToolStripMenuItem.Enabled = true;
                            this.habilitarNodoToolStripMenuItem.Enabled    = false;
                        }
                        else
                        {
                            this.deshabilitarNodoToolStripMenuItem.Enabled = false;
                            this.habilitarNodoToolStripMenuItem.Enabled    = true;
                        }

                        if ((int)Datos.ds.Tables[0].Rows[0]["Tipo"] == 2)
                        {
                            this.agregarNodoToolStripMenuItem.Enabled = false;
                        }
                        else
                        {
                            this.agregarNodoToolStripMenuItem.Enabled = true;
                        }
                    }

                    //Poner Opciones
                    this.eliminarNodoToolStripMenuItem.Enabled = true;
                    this.copiarToolStripMenuItem.Enabled       = true;
                }
                //Se presiono el Boton de Menu Contextual
                this.cmsContextual.Show(this.tvArbolGeneral, new Point(e.X, e.Y));
            }
        }
        void cargarArbol(int idInicial, TreeNode nodoInicial = null, bool cargaDoc = false)
        {
            parametros = "|V1=" + idInicial.ToString() + "|";
            validar    = "7";
            Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);

            if (Datos.bOk)
            {
                //Se obtuvieron Datos
                foreach (DataRow r in Datos.ds.Tables[0].Rows)
                {
                    if ((Clases.clsEnums.TipoNodo)r["Tipo"] != Clases.clsEnums.TipoNodo.Documento || cargaDoc)
                    {
                        TreeNode newNodo = new TreeNode();
                        newNodo.Text = r["Descripcion"].ToString();
                        newNodo.Tag  = new Clases.clsNodoTiny(r["idNodo"].ToString(), (Clases.clsEnums.TipoNodo)r["Tipo"]);

                        if ((int)r["Tipo"] == 0)
                        {
                            newNodo.ImageIndex         = 1;
                            newNodo.StateImageIndex    = 1;
                            newNodo.SelectedImageIndex = 1;
                        }
                        if ((int)r["Tipo"] == 1)
                        {
                            newNodo.ImageIndex         = 2;
                            newNodo.StateImageIndex    = 2;
                            newNodo.SelectedImageIndex = 2;
                        }

                        if ((int)r["Tipo"] == 2)
                        {
                            newNodo.ImageIndex         = 3;
                            newNodo.StateImageIndex    = 3;
                            newNodo.SelectedImageIndex = 3;
                        }

                        //Se Cambia al DoubleClick del Nodo
                        //cargarArbol(Convert.ToInt16(r["idNodo"]), newNodo);

                        if (nodoInicial == null)
                        {
                            tvArbolGeneral.Nodes.Add(newNodo);
                        }
                        else
                        {
                            nodoInicial.Nodes.Add(newNodo);
                        }
                    }
                }
            }
        }
        private void generarExpedientesPDFsToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var carpeta = new FolderBrowserDialog
            {
                Description         = "Carpeta de Salida",
                ShowNewFolderButton = true,
            };

            if (carpeta.ShowDialog() == DialogResult.OK)
            {
                Cursor = System.Windows.Forms.Cursors.WaitCursor;

                parametros = "|V2=" + ((Clases.clsNodoTiny)nodoActual.Tag).idNodo + "|";
                validar    = "10";
                Datos      = Acceso.ivkProcedimiento("sp_Datos_Expedientes", validar, parametros, Clases.vGlobales.conexion, null);

                if (Datos.bOk)
                {
                    // Iniciar el Proceso de Generación de PDF's
                    PBGeneral.Style   = ProgressBarStyle.Continuous;
                    PBGeneral.Minimum = 1;
                    PBGeneral.Maximum = Datos.ds.Tables[0].Rows.Count;
                    PBGeneral.Value   = 1;
                    PBGeneral.Step    = 1;

                    PBGeneral.Visible = true;

                    foreach (DataRow r in Datos.ds.Tables[0].Rows)
                    {
                        //parametros = "|V2=" + r[0].ToString() +"|";
                        //validar = "42";
                        //Datos2 = Acceso.ivkProcedimiento("sp_Datos_Documentos", validar, parametros, Clases.vGlobales.conexion, null);

                        if (!File.Exists(carpeta.SelectedPath + "\\" + r[1].ToString() + ".pdf"))
                        {
                            Clases.clsPDFExport pdfExport = new Clases.clsPDFExport();
                            pdfExport.Exportar(carpeta.SelectedPath + "\\" + r[1].ToString() + ".pdf", r[0].ToString());
                        }

                        PBGeneral.PerformStep();
                        Application.DoEvents();
                    }

                    PBGeneral.Visible = false;
                    PBGeneral.Style   = ProgressBarStyle.Marquee;
                }

                ShowNotify("Generación de PDF", "Termino el proceso de generación de PDF's", ToolTipIcon.Info, 2000);
                Cursor = Cursors.Default;
            }
        }
Esempio n. 19
0
 void cargarCampos()
 {
     //Cargar los campos definidos en el formulario
     this.validar    = "3";
     this.parametros = "|V1=" + this._id + "|";
     regreso         = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
     if (regreso.bOk)
     {
         foreach (DataRow r in regreso.ds.Tables[0].Rows)
         {
             campos.Add(new clsFormularioCampo(r["idFormulario"].ToString(), r["idCampo"].ToString()));
         }
     }
 }
Esempio n. 20
0
        //private void btnGuardar_Click(object sender, EventArgs e)
        //{
        //    validar = "2";
        //    parametros = "|V1=" + (chkNuevo.Checked == true ? "" : idReporte) + "|V2=" + txtReporte.Text.Trim() +
        //                 "|V3=" + txtDescripcion.Text.Trim() + "|V4=" + cboCategorias.SelectedValue.ToString() +
        //                 "|V5=" + rpxBase64 + "|";
        //    datos = acceso.ivkProcedimiento(procedimiento, validar, parametros, null);
        //    if (!datos.bOk)
        //    {
        //        //Problemas al Accesar los Datos
        //        MessageBox.Show("Problemas al accesar los Datos");
        //        this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        //        this.Close();
        //        return;
        //    }

        //    idReporte = datos.ds.Tables[0].Rows[0]["idReporte"].ToString();
        //    cNombre = datos.ds.Tables[0].Rows[0]["cNombre"].ToString();
        //    cDescripcion = datos.ds.Tables[0].Rows[0]["cDescripcion"].ToString();
        //}

        private void cboCategorias_SelectedIndexChanged(object sender, EventArgs e)
        {
            validar    = "3";
            parametros = "|V4=" + cboCategorias.SelectedValue.ToString() + "|";
            datos      = acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!datos.bOk)
            {
                //Consulta con Error
                MessageBox.Show("No existen Registro, o no se puede acccesar la B.D.");
                return;
            }

            cboReportes.DataSource = datos.ds.Tables[0];
        }
        void cargarArbol(int idInicial, TreeNode nodoInicial = null)
        {
            parametros = "|V1=" + idInicial.ToString() + "|" +
                         "|C1=" + Clases.vGlobales.id_User +
                         "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();;
            validar = "1";
            Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);

            if (Datos.bOk)
            {
                //Se obtuvieron Datos
                foreach (DataRow r in Datos.ds.Tables[0].Rows)
                {
                    TreeNode newNodo = new TreeNode();
                    newNodo.Text = r["Descripcion"].ToString();
                    newNodo.Tag  = r["idNodo"].ToString();
                    if ((int)r["Tipo"] == 0)
                    {
                        newNodo.ImageIndex         = 1;
                        newNodo.StateImageIndex    = 1;
                        newNodo.SelectedImageIndex = 1;
                    }
                    if ((int)r["Tipo"] == 1)
                    {
                        newNodo.ImageIndex         = 2;
                        newNodo.StateImageIndex    = 2;
                        newNodo.SelectedImageIndex = 2;
                    }

                    if ((int)r["Tipo"] == 2)
                    {
                        newNodo.ImageIndex         = 3;
                        newNodo.StateImageIndex    = 3;
                        newNodo.SelectedImageIndex = 3;
                    }

                    //Se pondra en el evento de doubleClick del Nodo
                    //cargarArbol(Convert.ToInt16(r["idNodo"]), newNodo);

                    if (nodoInicial == null)
                    {
                        tvArbolGeneral.Nodes.Add(newNodo);
                    }
                    else
                    {
                        nodoInicial.Nodes.Add(newNodo);
                    }
                }
            }
        }
Esempio n. 22
0
        private void frmCargar_Load(object sender, EventArgs e)
        {
            //Cargar el Catalogo de Categorias
            validar = "11";

            datos = acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!datos.bOk)
            {
                //Problemas al Accesar los Datos
                MessageBox.Show("No Existen Categorias, Favor de Agregar alguna");
                return;
            }

            cboCategorias.DataSource = datos.ds.Tables[0];
        }
Esempio n. 23
0
 void cargarDatos(string idFormulario, string idCampo)
 {
     validar    = "2";
     parametros = "|V1=" + idFormulario + "|V2=" + idCampo + "|";
     regreso    = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
     if (regreso.bOk)
     {
         //Regreso el Dato de Manera Correcta
         cargarDatos(regreso.ds.Tables[0].Rows[0]);
     }
     else
     {
         throw new System.InvalidOperationException("Error al Cargar Datos \r\nNo Existe el registro en la Base de Datos");
     }
 }
Esempio n. 24
0
        private void frmAgregarGrupo_Load(object sender, EventArgs e)
        {
            //Cargar los Grupos Disponibles
            validar    = "202";
            parametros = "|V2=" + idNodoActual.ToString().Trim() + "|";
            Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!Datos.bOk)
            {
                MessageBox.Show("No Existen Grupos disponibles para este Nodo");
                this.Close();
            }

            cboGrupos.DataSource    = Datos.ds.Tables[0];
            cboGrupos.SelectedIndex = 0;
            cboGrupos.Focus();
        }
 private void cboClasificacionCampos_SelectedIndexChanged(object sender, EventArgs e)
 {
     procedimiento = "sp_ConfigCampos";
     parametros    = "|V5=" + cboClasificacionCampos.SelectedValue.ToString() + "|";
     Datos         = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
     if (Datos.bOk != true)
     {
         MessageBox.Show("Problemas al accesar la base de datos");
         this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
         this.Close();
     }
     else
     {
         this.cboCampos.DataSource = Datos.ds.Tables[0];
     }
 }
Esempio n. 26
0
 public bool guardarDatos(string user = "******")
 {
     this.validar    = "4";
     this.parametros = "|V1=" + this._idFormulario + "|V2=" + this._idCampo + "|V3=" + Convert.ToByte(this.obligatorio).ToString() +
                       "|C1=" + user.ToString() +
                       "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString() + "|";
     regreso = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
     if (regreso.bOk)
     {
         return(true);
     }
     else
     {
         throw new System.InvalidOperationException("Error al Guardar Datos \r\nProblemas con el registro a guadar " + this._idFormulario + "|" + this.idCampo);
     }
 }
Esempio n. 27
0
        private void frmUsuarioEdit_Load(object sender, EventArgs e)
        {
            //Cargar Datos del ComboBox
            procedimiento = "sp_Grupos";
            validar       = "1";
            parametros    = "";

            Datos = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (Datos.bOk != true)
            {
                MessageBox.Show("Problemas al accesar la base de datos");
                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                this.Close();
            }
            else
            {
                cboGrupo.DataSource = Datos.ds.Tables[0];
            }

            this.Text                    = "Edición de usuario --> " + (usuario.id == "0" ? "Nuevo Usuario" : usuario.loginName.ToString());
            this.iTXTUsuario.Text        = usuario.loginName;
            this.iTXTNombreCompleto.Text = usuario.nombreCompleto;
            this.iTXTPuesto.Text         = usuario.puesto;
            this.iTXTCorreo.Text         = usuario.correo;
            this.iTXTPwd1.Text           = usuario.claveAcceso;
            this.iTXTPwd2.Text           = usuario.claveAcceso;
            cboGrupo.SelectedValue       = usuario.idGrupo;

            if (!this.usuario.activo)
            {
                if (MessageBox.Show("Usuario Descativado,\n\rDesea Activarlo?", "Activacion?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    //Activar el Registro actual
                    this.usuario.activo = true;
                    usuario.guardarDatos();
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
                else
                {
                    this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                    this.Close();
                }
                iTXTUsuario.Focus();
            }
        }
        void cargarExpedientes(int idInicial, TreeNode nodoInicial = null)
        {
            PBGeneral.Visible = true;
            Cursor            = System.Windows.Forms.Cursors.AppStarting;

            parametros = "|V1=" + idInicial.ToString() + "|";
            validar    = "100";
            Datos      = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);

            if (Datos.bOk)
            {
                nodoInicial.Nodes.Clear();

                TreeNode[] nuevosNodos = new TreeNode[Datos.ds.Tables[0].Rows.Count];
                int        c           = 0;

                foreach (DataRow r in Datos.ds.Tables[0].Rows)
                {
                    this.BeginInvoke(new Action <DataRow>((rr) =>
                    {
                        TreeNode newNodo = new TreeNode();
                        newNodo.Text     = rr["idLlaveBusqueda"].ToString();
                        newNodo.Tag      = new Clases.clsNodoTiny(rr["idUnicoExpediente"].ToString(), Clases.clsEnums.TipoNodo.Expediente);

                        newNodo.ImageIndex         = 2;
                        newNodo.StateImageIndex    = 2;
                        newNodo.SelectedImageIndex = 2;

                        //Cargar Tipos de Documentos en Base a Nodo Padre del Expediente
                        cargarArbol(idInicial, newNodo, true);
                        //nodoInicial.Nodes.Add(newNodo);
                        nuevosNodos[c] = (TreeNode)newNodo.Clone();
                        c++;
                    }), r);

                    Application.DoEvents();
                }

                nodoInicial.Nodes.AddRange(nuevosNodos);

                //tvArbolGeneral.EndUpdate();
            }

            PBGeneral.Visible = false;
            Cursor            = System.Windows.Forms.Cursors.Default;
        }
        private void tvArbolGeneral_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                return;
            }

            //Se cambio el Nombre dentro del Arbol
            parametros = "V2=" + e.Node.Tag.ToString() + "|V3=" + e.Label + "|" +
                         "|C1=" + Clases.vGlobales.id_User +
                         "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString();;
            validar = "31";
            Datos   = Acceso.ivkProcedimiento(procedimiento, validar, parametros, Clases.vGlobales.conexion, null);
            if (!Datos.bOk)
            {
                MessageBox.Show("No se puedo renombrar el Nodo", "Protección del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Esempio n. 30
0
        public bool desactivar(string user = "******")
        {
            this.validar    = "4";
            this.parametros = "V1=" + this._id.ToString() + "|" +
                              "|C1=" + user.ToString() +
                              "|C3=" + Environment.UserName.ToString() + "/" + Environment.MachineName.ToString() + "|";

            regreso = AccesoDatos.ivkProcedimiento(this.procedimiento, this.validar, this.parametros, Clases.vGlobales.conexion, null);
            if (regreso.bOk)
            {
                cargarDatos(regreso.ds.Tables[0].Rows[0]);
                return(true);
            }
            else
            {
                throw new System.InvalidOperationException("Error al intentar desactivar el Registro \r\nRevisar acceso a Base de Datos");
            }
        }