コード例 #1
0
        private void Editar()
        {
            try
            {
                if (Validar())
                {
                    PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

                    pui.keyCveFoliador = txtClaveClase.Text;
                    pui.cmpDescripcion = txtDescripcion.Text;
                    pui.cmpCveModulo   = Convert.ToString(cboCfgModuloSys.SelectedValue);
                    pui.cmpUso         = txtUso.Text;

                    if (pui.ActualizaCfgCatFoliador() >= 0)
                    {
                        MessageBoxAdv.Show("Registro Actualizado", "Confirmacion", MessageBoxButtons.OK,
                                           MessageBoxIcon.Information);
                        this.Size = this.MinimumSize;
                    }
                    LlenaGridView();
                    //grdView.CurrentRow.Index = idxG;
                }
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show("Tienes que seleccionar un registro \n" + ex.Message + " " + ex.StackTrace.ToString(),
                                   "Error al editar", MessageBoxButtons.OK,
                                   MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void cmEditar_Click(object sender, EventArgs e)
        {
            //if (AcCOPEdit == 1)
            //{
            LimpiarControles();
            OpcionControles(true);
            this.Size = this.MaximumSize;
            opcion    = 2;

            idxG = grdView.CurrentRow.Index;

            PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

            pui.keyCveFoliador = grdView[0, grdView.CurrentRow.Index].Value.ToString();
            pui.EditarCfgCatFoliador();
            txtClaveClase.Text            = pui.keyCveFoliador;
            txtDescripcion.Text           = pui.cmpDescripcion;
            cboCfgModuloSys.SelectedValue = pui.cmpCveModulo;
            txtUso.Text = pui.cmpUso;

            txtClaveClase.Enabled = false;

            /*
             * }
             * else
             * {
             *  MessageBoxAdv.Show("No tienes privilegios suficientes",
             *  "Error al editar registro", MessageBoxButtons.OK,
             *  MessageBoxIcon.Exclamation);
             * }
             */
        }
コード例 #3
0
        private void LlecboCfgCatFoliadores(int EnUso)
        {
            PuiCatCfgCatFoliadores lin = new PuiCatCfgCatFoliadores(db);

            cboCfgCatFoliadores.DataSource    = lin.cboCfgCatFoliadores(EnUso);
            cboCfgCatFoliadores.ValueMember   = "CveFoliador";
            cboCfgCatFoliadores.DisplayMember = "Descripcion";
        }
コード例 #4
0
        private void LleCboModuloSys()
        {
            PuiCatCfgCatFoliadores lin = new PuiCatCfgCatFoliadores(db);

            cboCfgModuloSys.DataSource    = lin.CboCfgModuloSys();
            cboCfgModuloSys.ValueMember   = "CveModulo";
            cboCfgModuloSys.DisplayMember = "Descripcion";
        }
コード例 #5
0
        private void cmdBuscar_Click(object sender, EventArgs e)
        {
            PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

            DatosTbl = pui.BuscaClase(txtBuscar.Text);
            DataSet ds = new DataSet();

            DatosTbl.Fill(ds);

            grdView.Rows.Clear();
            for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
            {
                object[] tmp = ds.Tables[0].Rows[j].ItemArray;
                grdView.Rows.Add(tmp);
            }
        }
コード例 #6
0
        private void Agregar()
        {
            if (Validar())
            {
                PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

                pui.keyCveFoliador = txtClaveClase.Text;
                pui.cmpDescripcion = txtDescripcion.Text;
                pui.cmpCveModulo   = Convert.ToString(cboCfgModuloSys.SelectedValue);
                pui.cmpUso         = txtUso.Text;

                if (pui.AgregarClase() >= 1)
                {
                    MessageBoxAdv.Show("Registro agregado", "Confirmacion", MessageBoxButtons.OK,
                                       MessageBoxIcon.Information);
                    LlenaGridView();
                    this.Size = this.MinimumSize;
                }
            }
        }
コード例 #7
0
 private void cmdEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         if (MessageBoxAdv.Show("Esta seguro de eliminar el registro " + grdView[0, grdView.CurrentRow.Index].Value.ToString(),
                                "Pregunta", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);
             pui.keyCveFoliador = grdView[0, grdView.CurrentRow.Index].Value.ToString();
             pui.EliminaCfgCatFoliador();
             LlenaGridView();
             this.Size = this.MinimumSize;
         }
     }
     catch (Exception ex)
     {
         MessageBoxAdv.Show("Tienes que seleccionar un registro\n" + ex.Message, "Alerta", MessageBoxButtons.OK,
                            MessageBoxIcon.Exclamation);
     }
 }
コード例 #8
0
        private void cmdConsultar_Click(object sender, EventArgs e)
        {
            LimpiarControles();
            OpcionControles(true);
            this.Size = this.MaximumSize;
            opcion    = 3;

            idxG = grdView.CurrentRow.Index;

            PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

            pui.keyCveFoliador = grdView[0, grdView.CurrentRow.Index].Value.ToString();
            pui.EditarCfgCatFoliador();
            txtClaveClase.Text            = pui.keyCveFoliador;
            txtDescripcion.Text           = pui.cmpDescripcion;
            cboCfgModuloSys.SelectedValue = pui.cmpCveModulo;
            txtUso.Text = pui.cmpUso;

            OpcionControles(false);
        }
コード例 #9
0
        private void LlenaGridView()
        {
            PuiCatCfgCatFoliadores pui = new PuiCatCfgCatFoliadores(db);

            DatosTbl = pui.ListarCfgCatFoliadores();
            DataSet Ds = new DataSet();

            try
            {
                DatosTbl.Fill(Ds);
                grdView.Rows.Clear();

                for (int j = 0; j < Ds.Tables[0].Rows.Count; j++)
                {
                    object[] tmp = Ds.Tables[0].Rows[j].ItemArray;
                    grdView.Rows.Add(tmp);
                }
            }
            catch (Exception ex)
            {
                MessageBoxAdv.Show(ex.Message, "Error al cargar listado", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }