public ActionResult Edit_post(int id) { Control_Alumno control_Alumno = ncontrol_Alumno.Control_Alumno.Single(per => per.id_control == id); UpdateModel <Control_Alumno>(control_Alumno); if (ModelState.IsValid) { ncontrol_Alumno.ActualizarControlAlumno("Actualizar", control_Alumno); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Create_post() { Control_Alumno control_Alumno = new Control_Alumno(); TryUpdateModel(control_Alumno); if (ModelState.IsValid) { ncontrol_Alumno.AgregarControlAlumno("Agregar", control_Alumno); return(RedirectToAction("Index")); } return(View()); }
public void ActualizarControlAlumno(string caso, Control_Alumno Control_Alumno) { string ConexionString = ConfigurationManager.ConnectionStrings["CadenaConexion"].ConnectionString; using (SqlConnection con = new SqlConnection(ConexionString)) { SqlCommand cmd = new SqlCommand("metodo_Control_Alumno", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("Caso", caso); cmd.Parameters.AddWithValue("id_control", Control_Alumno.id_control); cmd.Parameters.AddWithValue("id_periodo", Control_Alumno.id_periodo); cmd.Parameters.AddWithValue("id_clase", Control_Alumno.id_clase); cmd.Parameters.AddWithValue("id_estudiante", Control_Alumno.id_estudiante); cmd.Parameters.AddWithValue("calificacion_final", Control_Alumno.calificacion_final); con.Open(); cmd.ExecuteNonQuery(); } }
public ActionResult Edit(int id) { Control_Alumno control_Alumno = ncontrol_Alumno.Control_Alumno.Single(per => per.id_control == id); return(View(control_Alumno)); }