public ActionResult Alta(Profesionales models, String ComboEsp )
        {
            IEnumerable<int>  Id = (from Desc in BaseDeDatos.Especialidades
                                    where ComboEsp.Equals(Desc.Descripcion)
                                    select Desc.IdEspec);

            ProfEsp proes = new ProfEsp();

            proes.IdProfesional = models.IdProfesional;
            proes.IdEspec = Id.FirstOrDefault();
            proes.Estado = "Habilitado";

            BaseDeDatos.AddToProfEsp(proes);
            BaseDeDatos.AddToProfesionales(models);
            BaseDeDatos.SaveChanges();

            return View();
        }
Example #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ProfEsp EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProfEsp(ProfEsp profEsp)
 {
     base.AddObject("ProfEsp", profEsp);
 }
Example #3
0
 /// <summary>
 /// Create a new ProfEsp object.
 /// </summary>
 /// <param name="idProfesional">Initial value of the IdProfesional property.</param>
 /// <param name="idEspec">Initial value of the IdEspec property.</param>
 public static ProfEsp CreateProfEsp(global::System.Int32 idProfesional, global::System.Int32 idEspec)
 {
     ProfEsp profEsp = new ProfEsp();
     profEsp.IdProfesional = idProfesional;
     profEsp.IdEspec = idEspec;
     return profEsp;
 }