Esempio n. 1
0
        public SqlDataReader iniciarsesion(string user, string pass)
        {
            string     sql     = "select*from usuarios where NombreUsuario='" + user + "' and Contrasenia='" + pass + "'";
            SqlCommand comando = new SqlCommand();

            comando.Connection  = Conexion.AbrirConexion();
            comando.CommandText = sql;
            leer = comando.ExecuteReader();
            return(leer);
        }
Esempio n. 2
0
        public static int Promediomescomp(promediomescomp pPromediomescomp)
        {
            int       retorno3 = 0;
            conection a        = new conection();

            using (SqlConnection conn = a.AbrirConexion())
            {
                SqlCommand comando = new SqlCommand(String.Format("insert into PromedioMensualComp(IdAlumnoPre,CalificacionComp,NombreMes) values('{0}','{1}','{2}') ",
                                                                  pPromediomescomp.IdAlumnoPre, pPromediomescomp.CalificacionComp, pPromediomescomp.NombreMes), conn);
                retorno3 = comando.ExecuteNonQuery();
                //retorno2 = comando.ExecuteNonQuery();
            }
            return(retorno3);
        }
Esempio n. 3
0
        public static int Calificaciongral1(Calificaciongral1 pPromediogeneral)
        {
            int       retorno4 = 0;
            conection a        = new conection();

            using (SqlConnection conn = a.AbrirConexion())
            {
                SqlCommand comando = new SqlCommand(String.Format("insert into PromedioGeneral(IdAlumnoPre,PromedioGeneral,TotalPuntos,Inasistencias,NombreMes) values('{0}','{1}','{2}','{3}','{4}') ",
                                                                  pPromediogeneral.IdAlumnoPre, pPromediogeneral.PromedioGeneral, pPromediogeneral.TotalPuntos, pPromediogeneral.Inasistencias, pPromediogeneral.NombreMes), conn);
                retorno4 = comando.ExecuteNonQuery();
                //retorno2 = comando.ExecuteNonQuery();
            }
            return(retorno4);
        }
Esempio n. 4
0
        public static int Agregarcalif(llenadomes pCalifica)
        {
            conection a        = new conection();
            int       retorno1 = 0;

            using (SqlConnection conn = a.AbrirConexion())
            {
                // paso 2
                // Conexion e insercion de datos en la tabla de calificaciones
                SqlCommand comando = new SqlCommand(String.Format("insert into CalificacionMensual(IdAlumnoPre,IdMaterias,Calificacion,NombreMes) values('{0}','{1}','{2}','{3}') ",
                                                                  pCalifica.IdAlumnoPre, pCalifica.IdMaterias, pCalifica.Calificacion, pCalifica.NombreMes), conn);
                retorno1 = comando.ExecuteNonQuery();
            }
            return(retorno1);
        }
Esempio n. 5
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            comando.Connection = conexion.AbrirConexion();
            SqlCommand cmd = new SqlCommand("buscar2", conectar);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Curp", textBox1.Text);
            conectar.Close();
            conectar.Open();

            SqlDataReader reader = cmd.ExecuteReader();

            // SqlDataReader leer = comando.ExecuteReader();

            if (reader.Read())
            {
                gradotxt.Text = Convert.ToString(reader["Grado"]);


                // if (reader.Read() == true)
                {
                    gradotxt.Text = reader["Grado"].ToString();


                    if (gradotxt.Text == "6°A")
                    {
                        boleta4_6 frm = this.FormInstance;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                    if (gradotxt.Text == "2°A")
                    {
                        Boleta1_2 frm = this.FormInstan;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                    if (gradotxt.Text == "3°A")
                    {
                        boletas3AS frm = this.FormInstanc;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                    if (gradotxt.Text == "4°A")
                    {
                        boleta4_6 frm = this.FormInstance;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                    if (gradotxt.Text == "5°A")
                    {
                        boleta4_6 frm = this.FormInstance;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                    if (gradotxt.Text == "1°A")
                    {
                        Boleta1_2 frm = this.FormInstan;
                        frm.curp = Convert.ToString(textBox1.Text);
                        if (frm.WindowState == FormWindowState.Minimized)
                        {
                            frm.WindowState = FormWindowState.Normal;
                        }
                        AddOwnedForm(frm);
                        frm.FormBorderStyle = FormBorderStyle.FixedSingle;
                        //frm.TopLevel = false;
                        frm.StartPosition = FormStartPosition.CenterScreen;
                        //frm.Dock = DockStyle.Fill;
                        //this.Controls.Add(frm);
                        this.Tag = frm;
                        frm.BringToFront();
                        frm.Enabled = true;
                        frm.Visible = true;
                        frm.Show();
                    }
                }
            }
        }
Esempio n. 6
0
        //public SqlConnection conectar = new SqlConnection("Data Source = DESKTOP-MIH3BF9\\MSSQLSERVER01;Initial Catalog = ControlEscolar;Integrated Security = true");
        ////public DataSet ds;
        //private ConexionBD conexion = new ConexionBD();
        //private SqlCommand comando = new SqlCommand();
        //private readonly CDUsuarios objDato = new CDUsuarios();
        //private SqlDataReader LeerFilas;


        public void insertarAlumno(string Curp, string Nombre, string Paterno, string Materno, int Edad, string FechaNacimiento, string Grado, string Sexo, string sangre, string Alergia)
        {
            Comando.Connection  = Conexion.AbrirConexion();
            Comando.CommandText = "insertaralumno";
            Comando.CommandType = CommandType.StoredProcedure;
            Comando.Parameters.AddWithValue("@Curp", Curp);
            Comando.Parameters.AddWithValue("@Nombre", Nombre);
            Comando.Parameters.AddWithValue("@Paterno", Paterno);
            Comando.Parameters.AddWithValue("@Materno", Materno);
            Comando.Parameters.AddWithValue("@Edad", Edad);
            Comando.Parameters.AddWithValue("@FechaNacimiento", FechaNacimiento);
            Comando.Parameters.AddWithValue("@Grado", Grado);
            Comando.Parameters.AddWithValue("@Sexo", Sexo);
            Comando.Parameters.AddWithValue("@Tipo_Sangre", sangre);
            Comando.Parameters.AddWithValue("@Alergia", Alergia);
            Comando.ExecuteNonQuery();
            Comando.Parameters.Clear();
        }