示例#1
0
        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);
            }
        }
示例#2
0
 private void detach_CURSOS(CURSOS entity)
 {
     this.SendPropertyChanging();
     entity.MAESTROS = null;
 }
示例#3
0
 private void attach_CURSOS(CURSOS entity)
 {
     this.SendPropertyChanging();
     entity.MAESTROS = this;
 }
示例#4
0
 partial void DeleteCURSOS(CURSOS instance);
示例#5
0
 partial void UpdateCURSOS(CURSOS instance);
示例#6
0
 partial void InsertCURSOS(CURSOS instance);