public void Guardar() { try { var m = from a in bd.MAESTROS where a.maestro_nombre == cbomaestro.SelectedItem.ToString() select a; MAESTROS mae = m.First(); string id_maestro = mae.maestro_id; var mat = from a in bd.MATERIAS where a.materia_nombre == cbomateria.SelectedItem.ToString() select a; MATERIAS mate = mat.First(); int id_materia = mate.materia_id; CURSOS C = new CURSOS(); C.maestro_id = id_maestro; C.materia_id = id_materia; C.curso_hora = cbohora.SelectedItem.ToString(); C.curso_salon = cbosalon.SelectedItem.ToString(); bd.CURSOS.InsertOnSubmit(C); bd.SubmitChanges(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void detach_CURSOS(CURSOS entity) { this.SendPropertyChanging(); entity.MAESTROS = null; }
private void attach_CURSOS(CURSOS entity) { this.SendPropertyChanging(); entity.MAESTROS = this; }
partial void DeleteCURSOS(CURSOS instance);
partial void UpdateCURSOS(CURSOS instance);
partial void InsertCURSOS(CURSOS instance);