protected void btnaceptar_Click(object sender, EventArgs e) { var carrera = ddlMateria.SelectedValue; DateTime fechact = DateTime.Now; TblNota nota = new TblNota(); nota.strTitulo = txtTitulo.Text.ToUpper(); nota.strDescripcion = txtDescripcion.Text.ToUpper(); nota.fecha = fechact; nota.idMateria = int.Parse(carrera); nota.idProfesor = int.Parse(lbProfe.Text); ControllerMaestro ctrlGrupo = new ControllerMaestro(); ctrlGrupo.InsertarNota(nota); this.Response.Redirect("./NotaInfo.aspx", true); }
public bool InsertarNota(TblNota _TBL_Nota) { bool respuesta = false; try { contexto.TblNota.InsertOnSubmit(_TBL_Nota); contexto.SubmitChanges(); respuesta = true; } catch (Exception ex) { System.Console.WriteLine(ex.ToString()); respuesta = false; } return(respuesta); }