Exemplo n.º 1
0
        public Boolean Guardar(clsPerfil Info, ref int IdPerfil)
        {
            try
            {
                using (TECAv8Entities Context = new TECAv8Entities())
                {
                    var contact = Perfil.CreatePerfil(0);
                    var address = new Perfil();
                    address.IdEstado = Info.IdEstado;
                    address.Descripcion = Info.Descripcion;
                    address.IdPerfil = IdPerfil = GetId();

                    contact = address;
                    Context.Perfil.AddObject(contact);
                    Context.SaveChanges();
                }

                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }
 /// <summary>
 /// Método desusado para agregar un nuevo objeto al EntitySet Perfil. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet&lt;T&gt; asociada.
 /// </summary>
 public void AddToPerfil(Perfil perfil)
 {
     base.AddObject("Perfil", perfil);
 }
 /// <summary>
 /// Crear un nuevo objeto Perfil.
 /// </summary>
 /// <param name="idPerfil">Valor inicial de la propiedad IdPerfil.</param>
 public static Perfil CreatePerfil(global::System.Int32 idPerfil)
 {
     Perfil perfil = new Perfil();
     perfil.IdPerfil = idPerfil;
     return perfil;
 }