Beispiel #1
0
        public int Modificar(DetalleInscripcion pDetalle)
        {
            int result = 0;

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string ssql      = @"update DetallesInscripcion set MatriculaId={0},
                                                            ModuloId={1},
                                                            Nota1={2},
                                                            Nota2={3},
                                                            Nota3={4},
                                                            Nota4={5},
                                                            Nota5={6},
                                                            NotaFinal={7},
                                                            Status={8}
                                                            where Id={9}";
                string sentencia = string.Format(ssql, pDetalle.MatriculaId.Id, pDetalle.ModuloId.Id, pDetalle.Nota1, pDetalle.Nota2,
                                                 pDetalle.Nota3, pDetalle.Nota4, pDetalle.Nota5, pDetalle.NotaFinal, pDetalle.Status, pDetalle.Id);
                SqlCommand comando = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                result = comando.ExecuteNonQuery();
                con.Close();
            }
            return(result);
        }
Beispiel #2
0
        public static DetalleInscripcion obtenerPorId(Int64 pId)
        {
            DetalleInscripcion detalle = new DetalleInscripcion();

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = "select * from DetallesInscripcion where Id={0}";
                string     sentencia = string.Format(ssql, pId);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                if (lector.Read())
                {
                    detalle.Id          = lector.GetInt64(0);
                    detalle.MatriculaId = MatriculaDAL.ObtenerPorId(lector.GetInt64(1));
                    detalle.ModuloId    = ModuloDAL.ObtenerPorId(lector.GetInt64(2));
                    detalle.Nota1       = lector.GetDecimal(3);
                    detalle.Nota2       = lector.GetDecimal(4);
                    detalle.Nota3       = lector.GetDecimal(5);
                    detalle.Nota4       = lector.GetDecimal(6);
                    detalle.Nota5       = lector.GetDecimal(7);
                    detalle.NotaFinal   = lector.GetDecimal(8);
                    detalle.Status      = lector.GetInt64(9);
                }
                con.Close();
            }
            return(detalle);
        }
Beispiel #3
0
        public int ModificarStatus(DetalleInscripcion pDetalle)
        {
            int result = 0;

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = "update DetallesInscripcion set Status={0} where MatriculaId={1}";
                string     sentencia = string.Format(ssql, pDetalle.Status, pDetalle.MatriculaId.Id);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                result = comando.ExecuteNonQuery();
                con.Close();
            }
            return(result);
        }
Beispiel #4
0
        public int Agregar(DetalleInscripcion pDetalle)
        {
            int result = 0;

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = @"insert into DetallesInscripcion(MatriculaId,ModuloId,Nota1,Nota2,Nota3,Nota4,Nota5,NotaFinal,Status)
                                values({0},{1},{2},{3},{4},{5},{6},{7},{8})";
                string     sentencia = string.Format(ssql, pDetalle.MatriculaId.Id, pDetalle.ModuloId.Id, pDetalle.Nota1, pDetalle.Nota2, pDetalle.Nota3, pDetalle.Nota4, pDetalle.Nota5, pDetalle.NotaFinal, pDetalle.Status);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                result = comando.ExecuteNonQuery();
                con.Close();
            }
            return(result);
        }
Beispiel #5
0
        public int moduloNoExist(DetalleInscripcion pDetalle)
        {
            int result = 0;

            using (SqlConnection con = ConexionBD.Conectar())
            {
                con.Open();
                string     ssql      = "select * from DetallesInscripcion where MatriculaId={0} and ModuloId={1} ";
                string     sentencia = string.Format(ssql, pDetalle.MatriculaId.Id, pDetalle.ModuloId.Id);
                SqlCommand comando   = new SqlCommand(sentencia, con);
                comando.CommandType = CommandType.Text;
                IDataReader lector = comando.ExecuteReader();
                if (lector.Read())
                {
                    result = 1;
                }
                else
                {
                    result = 0;
                }
                con.Close();
            }
            return(result);
        }
Beispiel #6
0
 public JsonResult verificarModulos(DetalleInscripcion pDetalle)
 {
     return(Json(bl.verificarModulo(pDetalle), JsonRequestBehavior.AllowGet));
 }
Beispiel #7
0
 public JsonResult Modificar(DetalleInscripcion pDetalle)
 {
     return(Json(bl.Modificar(pDetalle), JsonRequestBehavior.AllowGet));
 }
Beispiel #8
0
 public JsonResult modificarStatus(DetalleInscripcion pDetalle)
 {
     return(Json(bl.modificarStatus(pDetalle), JsonRequestBehavior.AllowGet));
 }
Beispiel #9
0
 public int modificarStatus(DetalleInscripcion pDetalle)
 {
     return(dal.ModificarStatus(pDetalle));
 }
Beispiel #10
0
 public int Modificar(DetalleInscripcion pDet)
 {
     return(dal.Modificar(pDet));
 }
Beispiel #11
0
 public int Agregar(DetalleInscripcion pDet)
 {
     return(dal.Agregar(pDet));
 }
Beispiel #12
0
 public int verificarModulo(DetalleInscripcion pDetalle)
 {
     return(dal.moduloNoExist(pDetalle));
 }