Exemplo n.º 1
0
        private void btn_altaEspecialidad_Click_1(object sender, EventArgs e)
        {
            AccesoDatos aq      = new AccesoDatos();
            SqlCommand  comando = new SqlCommand();

            try
            {
                if (DatosEspecialidad(txb_NombreE.Text, numericUpDown1.Text) == true)
                {
                    string IDConseguido;
                    int    id = ObtenerID();

                    IDConseguido = "00" + id.ToString();
                    comando      = DatosSP.EspecialidadCarga(IDConseguido, txb_NombreE.Text, numericUpDown1.Text);
                    aq.EjecutarProcedimientoAlmacenado(comando, "CrearEspecialidad");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void btn_altaMateria_Click(object sender, EventArgs e)
        {
            AccesoDatos aq      = new AccesoDatos();
            SqlCommand  comando = new SqlCommand();

            try
            {
                if (DatosMateria(txb_NombreM.Text, txb_PrecioM.Text) == true)
                {
                    string IDConseguido;
                    int    id = ObtenerID();

                    IDConseguido = "00" + id.ToString();
                    comando      = DatosSP.MateriasCarga(IDConseguido, txb_NombreM.Text, txb_PrecioM.Text);
                    aq.EjecutarProcedimientoAlmacenado(comando, "CrearMateria");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 3
0
        private void btn_altaMateria_Click(object sender, EventArgs e)
        {
            AccesoDatos aq      = new AccesoDatos();
            SqlCommand  comando = new SqlCommand();

            try
            {
                if (DatosMateria(txb_NombreM.Text, txb_PrecioM.Text) == true)
                {
                    string IDConseguido;
                    int    id = ObtenerID() + 1;

                    IDConseguido = "00" + id.ToString();
                    // MessageBox.Show(IDConseguido);
                    string  doble    = txb_PrecioM.Text;
                    decimal doblesss = Convert.ToDecimal(doble);
                    int     number   = Decimal.ToInt32(doblesss);


                    if (number > 0)
                    {
                        comando = DatosSP.MateriasCarga(IDConseguido, txb_NombreM.Text, number.ToString(), int.Parse(n1.Value.ToString()), int.Parse(n2.Value.ToString()), int.Parse(textBox1.Text));
                        aq.EjecutarProcedimientoAlmacenado(comando, "CrearMateria");
                        MessageBox.Show("Materia creada correctamente");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Tiene que ser un numero positivo.");
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Ingrese un numero correcto");
            }
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (MEDUSA == true)
            {
                try
                {
                    Preinscripciones.Confirmacion conf = new Preinscripciones.Confirmacion();
                    int registros_ok = 0;
                    if (conf.ShowDialog() == DialogResult.OK)
                    {
                        AccesoDatos aq = new AccesoDatos();

                        SqlCommand comando = new SqlCommand();



                        SqlCommand  comando2 = new SqlCommand();
                        AccesoDatos aq2      = new AccesoDatos();
                        string      codcurso = "";

                        aq2.ConfigurarProcedure(ref comando, "ExistenciaCurso");
                        comando.Connection = aq.ObtenerConexion();

                        SqlDataReader reader = comando.ExecuteReader();

                        while (reader.Read())
                        {
                            if (reader[0].ToString() != "-1")
                            {
                                bool asd = false;
                                // MessageBox.Show(comboBox1.Items[comboBox1.SelectedIndex].ToString());

                                //    MessageBox.Show(comboBox1.Text);

                                if (textBox1.Text != "")
                                {
                                    asd = true;
                                    if (asd == true)
                                    {
                                        //      MessageBox.Show(reader[0].ToString());
                                        codcurso = reader[0].ToString();

                                        for (int i = 0; i < dataGridView1.Rows.Count; i++)
                                        {
                                            try
                                            {
                                                comando = DatosSP.Preinscriptos(int.Parse(dataGridView1.Rows[i].Cells[10].Value.ToString()), codcurso, "0",
                                                                                dataGridView1.Rows[i].Cells[8].Value.ToString(), dataGridView1.Rows[i].Cells[7].Value.ToString(),
                                                                                dataGridView1.Rows[i].Cells[20].Value.ToString(), dataGridView1.Rows[i].Cells[19].Value.ToString(),
                                                                                dataGridView1.Rows[i].Cells[6].Value.ToString(), dataGridView1.Rows[i].Cells[5].Value.ToString(),
                                                                                codespe(textBox1.Text)
                                                                                );


                                                aq.EjecutarProcedimientoAlmacenado(comando, "CargaPreinscripto");
                                                registros_ok++;
                                                dataGridView1.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.Green;
                                            }
                                            catch (Exception ex)
                                            {
                                            }
                                        }

                                        MessageBox.Show("Registros cargados correctamente: " + registros_ok);
                                    }
                                    else
                                    {
                                        MessageBox.Show("Esa especialidad no existe.");
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("Tiene que seleccionar una especialidad.");
                                }
                            }
                            else
                            {
                                MessageBox.Show("No hay un curso que sea el actual, antes de cargar preinscriptos favor de crear curso actual.");
                            }
                        }
                    }
                }
                catch (Exception ex) {
                    //  MessageBox.Show(ex.ToString());
                }
            }
            else
            {
                MessageBox.Show("Recuerde que tiene que cargar antes el excel.");
            }
        }
Exemplo n.º 5
0
        private void bt_Aceptar_Click(object sender, EventArgs e)
        {
            try {
                int.Parse(tb_DNI.Text);
                if (tb_DNI.Text != string.Empty)
                {
                    if (listBox1.SelectedIndex >= 0)
                    {
                        switch (listBox1.Items[listBox1.SelectedIndex].ToString())
                        {
                        case "Comprobante de alumno regular.":
                            listBox1.SelectedIndex = 0;
                            analitico = true;

                            break;

                        case "Comprobante de Titulo en tramite.":
                            listBox1.SelectedIndex = 1;
                            analitico = true;

                            break;

                        case "Comprobante de Titulo legalizado.":
                            listBox1.SelectedIndex = 2;
                            analitico = true;


                            break;

                        case "No trajo comprobante.":
                            listBox1.SelectedIndex = 3;
                            analitico = false;

                            break;

                        case "vencido.":

                            break;

                        default:
                            listBox1.SelectedIndex = 3;
                            analitico = false;
                            break;
                        }



                        if (Tabla == 1)
                        {
                            fecha = DateTime.Parse(tb_Fecha.Text);

                            tb_Fecha.Text = fecha.ToString();


                            AccesoDatos aq = new AccesoDatos();

                            SqlCommand comando = new SqlCommand();

                            string codcurso = "";
                            try
                            {
                                codcurso = "select CodCurso from Cursos where actual =1";
                                AccesoDatos aff = new AccesoDatos();
                                aff.cargaTabla("5:35AM..", codcurso, ref ds);

                                codcurso = ds.Tables["5:35AM.."].Rows[0][0].ToString();
                            }
                            catch (Exception)
                            {
                                MessageBox.Show("No hay curso asignado como el actual");
                            }



                            try
                            {
                                comando = DatosSP.Inscriptos(ds.Tables["TablaSelecionado"].Rows[0][0].ToString(), int.Parse(tb_DNI.Text), textBox2.Text, textBox1.Text, codcurso, tb_Email.Text, tb_Telefono.Text, true
                                                             , analitico, cb_cuil.Checked, cb_Dni.Checked, cb_4x4.Checked, cb_ConstanciaTrabajo.Checked, fecha, tb_Observaciones.Text,
                                                             listBox1.Items[listBox1.SelectedIndex].ToString(), cb_naci.Checked, codespe(textBox3.Text));
                                aq.EjecutarProcedimientoAlmacenado(comando, "ModificarInscripto");

                                if (CursarCursoActual.Checked == true)
                                {
                                    string  asd = "select COUNT(legajo) from AlumnosxMateriasxCursos where legajo=" + saberlegajo(tb_DNI.Text) + "and codcurso=" + codcurso;
                                    DataSet dt  = new DataSet();
                                    aq.cargaTabla("queseyo222", asd, ref dt);
                                    if (dt.Tables["queseyo222"].Rows[0][0].ToString() == "0")
                                    {
                                        CargaCursoAcutal();
                                    }
                                }
                                MessageBox.Show("Alumno modificado correctamente");

                                apagar(1);
                                //this.Close();
                            }
                            catch (Exception ex)
                            {
                                //     az(ex.ToString());
                            }
                        }
                        else
                        {
                            AccesoDatos aq = new AccesoDatos();

                            SqlCommand comando = new SqlCommand();

                            DateTime fecha = new DateTime();
                            fecha         = DateTime.Today;
                            tb_Fecha.Text = fecha.ToString();
                            string codcurso = "";
                            int    error    = 0;
                            try
                            {
                                codcurso = "select CodCurso from Cursos where actual =1";
                                AccesoDatos aff = new AccesoDatos();
                                aff.cargaTabla("5:35AM..", codcurso, ref ds);

                                codcurso = ds.Tables["5:35AM.."].Rows[0][0].ToString();
                                error    = 1;

                                comando = DatosSP.Inscriptos(ds.Tables["TablaSelecionado"].Rows[0][0].ToString(), int.Parse(tb_DNI.Text), textBox2.Text, textBox1.Text, codcurso, tb_Email.Text, tb_Telefono.Text, true
                                                             , analitico,
                                                             cb_cuil.Checked, cb_Dni.Checked, cb_4x4.Checked, cb_ConstanciaTrabajo.Checked, fecha, tb_Observaciones.Text,
                                                             listBox1.Items[listBox1.SelectedIndex].ToString(), cb_naci.Checked, codespe(textBox3.Text));
                                // aq.EjecutarProcedimientoAlmacenado(comando, "ModificarInscripto");
                                aq.EjecutarProcedimientoAlmacenado(comando, "CargaInscripto");

                                if (CursarCursoActual.Checked == true)
                                {
                                    string  asd = "select COUNT(legajo) from AlumnosxMateriasxCursos where legajo=" + saberlegajo(tb_DNI.Text);
                                    DataSet dt  = new DataSet();
                                    aq.cargaTabla("queseyo222", asd, ref dt);
                                    if (dt.Tables["queseyo222"].Rows[0][0].ToString() == "0")
                                    {
                                        CargaCursoAcutal();
                                    }
                                }


                                MessageBox.Show("Alumno Inscripto correctamente.");
                                apagar(1);

                                //  this.Close();
                            }
                            catch (Exception ex)
                            {
                                if (error == 0)
                                {
                                    MessageBox.Show("No hay un curso asignado como el actual.");
                                }
                                else
                                {
                                    MessageBox.Show(ex.ToString());
                                }
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Debe seleccionar un comprobante.");
                        textBox4.Visible = true;
                    }
                }
                else
                {
                    az("El campo DNI esta mal.");
                }
            }
            catch (Exception ex) {
                //     az(ex.ToString());
            }
        }
Exemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool        passame  = false;
            AccesoDatos conexion = new AccesoDatos();

            string     consulta = "VerificarUsuario";
            SqlCommand comando  = new SqlCommand();


            comando = Usuario_class.Usuarios_completo(Formularios.Usuario, txt_passAnterior.Text, 2);
            conexion.ConfigurarProcedure(ref comando, consulta);
            comando.Connection = conexion.ObtenerConexion();

            SqlDataReader reader = comando.ExecuteReader();


            while (reader.Read())
            {
                if (int.Parse(reader[0].ToString()) == 1)
                {
                    passame = true;
                }
            }


            if (passame == true)
            {
                if (txt_passNueva.TextLength >= 5)
                {
                    if (txt_passNuevaConfirm.Text == txt_passNueva.Text)
                    {
                        if (txt_passNueva.Text != txt_passAnterior.Text)
                        {
                            comando = Usuario_class.Usuarios_completo(Formularios.Usuario, txt_passNueva.Text);
                            if (conexion.EjecutarProcedimientoAlmacenado(comando, "UsuarioCambioContra") != 0)
                            {
                                MessageBox.Show("Se ha cambiado correctamente la contraseña.");
                            }
                        }
                        else
                        {
                            MessageBox.Show("La contraseña nueva es igual a la anterior. Porfavor cambiela. ");
                        }
                    }
                    else
                    {
                        MessageBox.Show("No coinciden la nueva contraseña con la verificacion.");
                    }
                }
                else
                {
                    MessageBox.Show("Recuerde que la contraseña tiene que tener minimo 5 caracteres.");
                }
            }
            else
            {
                MessageBox.Show("Contraseña actual incorrecta.");
            }
            txt_passAnterior.Clear();
            txt_passNueva.Clear();
            txt_passNuevaConfirm.Clear();
        }