Exemple #1
0
        public string m_matricula(DTOmatriculas dto)
        {
            try
            {
                colegiobdEntities bds = new colegiobdEntities();
                tblmatriculas     b   = bds.tblmatriculas.Where(t => t.Idcurso == dto.Idcurso && t.Idest == dto.Idestudiante).FirstOrDefault();

                if (b != null)
                {
                    b.Idest   = dto.Idestudiante;
                    b.Idcurso = dto.Idcurso;
                    b.Nota    = dto.Nota;
                    bds.SaveChanges();
                    return("matricula actualizada");
                }
                else
                {
                    return("Esta matricula no existe");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message.ToString());
            }
        }
Exemple #2
0
 public string r_matricula(DTOmatriculas dto)
 {
     try
     {
         colegiobdEntities bds = new colegiobdEntities();
         tblmatriculas     b   = new tblmatriculas();
         b.Idcurso = dto.Idcurso;
         b.Idest   = dto.Idestudiante;
         b.Nota    = dto.Nota;
         bds.tblmatriculas.Add(b);
         bds.SaveChanges();
         return("La matricula ha sido agregada");
     }
     catch (Exception bb)
     {
         return(bb.Message.ToString());
     }
 }
Exemple #3
0
       public string r_matricula(DTOmatriculas dto)
       {
           try
           {

               colegiobdEntities bds = new colegiobdEntities();
               tblmatriculas b = new tblmatriculas();
               b.Idcurso = dto.Idcurso;
               b.Idest = dto.Idestudiante;
               b.Nota = dto.Nota;
               bds.tblmatriculas.Add(b);
               bds.SaveChanges();
               return "La matricula ha sido agregada";
           }
           catch (Exception bb)
           {

               return bb.Message.ToString();
           }
           }
Exemple #4
0
        public string e_matricula(DTOmatriculas dto)
        {
            try
            {
                colegiobdEntities bds = new colegiobdEntities();
                tblmatriculas     b   = bds.tblmatriculas.Where(t => t.Idcurso == dto.Idcurso && t.Idest == dto.Idestudiante).FirstOrDefault();

                if (b != null)
                {
                    bds.tblmatriculas.Remove(b);
                    return("matricula eliminada");
                }
                else
                {
                    return("Esta matricula no existe");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message.ToString());
            }
        }