コード例 #1
0
        public void Create(Disciplinas pDisciplina)
        {
            string sql = "insert into disciplinas values (";
            sql += pDisciplina.Id + ",'" + pDisciplina.Nome + "')";

            conn.executarComando(sql);
        }
コード例 #2
0
        public Disciplinas GetOne(int pId)
        {
            string sql = "select * from disciplinas where Id =" + pId;
            MySqlDataReader dr = conn.executarConsulta(sql);

            dr.Read();
            Disciplinas DisciplinasEditar = new Disciplinas((int)dr["id"], (string)dr["nome"]);

            return DisciplinasEditar;
        }
コード例 #3
0
 public void Update(Disciplinas pDisciplina)
 {
     string sql = "update disciplinas set nome ='" + pDisciplina.Nome + "' where id =" + pDisciplina.Id;
     conn.executarComando(sql);
 }
コード例 #4
0
 public ActionResult UpdateDisciplina(Disciplinas aDisciplina)
 {
     disciplinaRepositorio.Update(aDisciplina);
     return RedirectToAction("Disciplina");
 }