Esempio n. 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);
            }
        }
Esempio n. 2
0
        public bool validarmaestro()
        {
            var      m    = from a in bd.MAESTROS where a.maestro_nombre == cbomaestro.SelectedItem.ToString() select a;
            MAESTROS mae  = m.First();
            string   id   = mae.maestro_id;
            int      linq = bd.CURSOS.Where
                                (c => c.maestro_id == id && c.curso_hora == cbohora.SelectedItem.ToString()).Count();

            if (linq > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
 partial void UpdateMAESTROS(MAESTROS instance);
Esempio n. 4
0
 partial void DeleteMAESTROS(MAESTROS instance);
Esempio n. 5
0
 partial void InsertMAESTROS(MAESTROS instance);