Пример #1
0
 private void buscarNombre()
 {
     if (this.txtBuscar.Text == "")
     {
         this.mostrar();
     }
     else
     {
         this.dataListado.DataSource = N_PRMVAR.Buscar(this.txtBuscar.Text);
         this.OcultarColumnas();
         lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count);
     }
 }
Пример #2
0
        //-----------------------------------------------------------------------------------
        // Actualiza Registros
        //-----------------------------------------------------------------------------------
        private void ActualizaRegistro()
        {
            string Rta = string.Empty;

            try
            {
                Rta = N_PRMVAR.Editar(this.txtGRP_id.Text, this.txtGRPid_variable.Text, this.txtPRM_descripcion.Text, this.txtPRM_valor.Text, this.txtPRM_estado.Text, this.txtPRM_frmnombre.Text);
                if (Rta.Equals("OK"))
                {
                    this.MensajeOk("Regsitro Actualizado Correctamente");
                }
                else
                {
                    this.MensajeError("Error al Actualizar Registro ");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Пример #3
0
 private void mostrar()
 {
     this.Configura();
     this.Activo = 1;
     this.tomaTab();
     this.Botones(true);
     this.dataListado.DataSource = N_PRMVAR.Mostrar();
     OcultarColumnas();
     lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count);
     if (dataListado.Rows.Count == 0)
     {
         BotonesSinReg(false);
     }
     else
     {
         BotonesSinReg(true);
         this.toolStripAgregar.Enabled = true;
     }
     this.dataListado.Select();
     this.dataListado.Focus();
 }
Пример #4
0
        //-----------------------------------------------------------------------------------
        // Elimina Registros
        //-----------------------------------------------------------------------------------
        private void borrauno()
        {
            string       Rta = string.Empty;
            DialogResult Opcion;

            Opcion = MessageBox.Show("Realmente Desea Eliminar los Registros", "Sistema de escolar", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (Opcion == DialogResult.OK)
            {
                string Codigo;
                Codigo = Convert.ToString(this.dataListado.CurrentRow.Cells[1].Value);
                Rta    = N_PRMVAR.Eliminar(Codigo);

                if (Rta.Equals("OK"))
                {
                    this.MensajeOk("Se Eliminó Correctamente el registro");
                }
                else
                {
                    this.MensajeError("Error al Eliminar el Registro ");
                }
            }
        }
Пример #5
0
        private void borramuchos()
        {
            try
            {
                DialogResult Opcion;
                Opcion = MessageBox.Show("Realmente Desea Eliminar los Registros", "Sistema de escolar", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                if (Opcion == DialogResult.OK)
                {
                    string Codigo;
                    string Rta = string.Empty;

                    foreach (DataGridViewRow row in dataListado.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[0].Value))
                        {
                            Codigo = Convert.ToString(row.Cells[1].Value);
                            Rta    = N_PRMVAR.Eliminar(Codigo);

                            if (Rta.Equals("OK"))
                            {
                                this.MensajeOk("Se Eliminó Correctamente el registro");
                            }
                            else
                            {
                                this.MensajeError("Error al Eliminar el Registro ...");
                            }
                        }
                    }
                    this.mostrar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Пример #6
0
        private void BotonImprimir()
        {
            FrmReportes rptalu = new FrmReportes("Reportes\\Rpt_ACTactividad.rdlc", N_PRMVAR.Mostrar(), "ip");

            rptalu.ShowDialog();
        }
Пример #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            var cadena = textBox1.Text;

            if (cadena.Length < 4)
            {
                MessageBox.Show("La fecha debe contener 4 caracteres", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int    mes, anio;
                string mes1;
                mes = comboBox1.SelectedIndex + 1;
                if (mes < 10)
                {
                    mes1 = 0 + Convert.ToString(mes);
                }
                else
                {
                    mes1 = Convert.ToString(mes);
                }

                anio = Convert.ToInt32(textBox1.Text);
                string variable = Convert.ToString(anio) + mes1;
                MessageBox.Show(Convert.ToString(variable));


                try
                {
                    DataTable dat = N_PRMVAR.variabledepre();
                    //if (dat.Rows.Count > 0)
                    //{
                    DataRow row = dat.Rows[0];
                    variabledepre = Convert.ToString(row["PRM_valor"]);
                    //}
                    //else
                    //MessageBox.Show("No Existe", "Registro");
                }
                catch (Exception ex)
                {
                    //MessageBox.Show(ex.Message + ex.StackTrace);
                }

                MessageBox.Show(Convert.ToString(variabledepre));

                if (Convert.ToInt32(variable) > Convert.ToInt32(variabledepre))
                {
                    MessageBox.Show("Procesando Actualización", "Proceso");
                    //ejecutamos el procedimiento almacenado
                    string Rta = string.Empty;
                    try
                    {
                        int x = comboBox1.SelectedIndex + 1;
                        //MessageBox.Show(Convert.ToString(x));
                        Rta = NacfACFp_Activo_Fijo.depreciacion(
                            Convert.ToString(x)
                            , textBox1.Text
                            , variable
                            );

                        if (Rta.Equals("OK"))
                        {
                            this.timer1.Start();
                            this.MensajeOk("Regsitro Actualizado Correctamente");
                            button1.Enabled = false;
                        }
                        else
                        {
                            this.MensajeError("Error: " + Rta);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message + ex.StackTrace);
                    }
                }
                else
                {
                    MessageBox.Show("El registro ya fue Actualizado Anteriormente, Imposible Procesar", "Proceso");
                }
            }
        }