Ejemplo n.º 1
0
        public ActionResult Edit(Pessoa p)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 2
0
        public ActionResult Create(Pessoa p)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // TODO: Add insert logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }
            else
            {
                return View();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Pessoas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPessoas(Pessoa pessoa)
 {
     base.AddObject("Pessoas", pessoa);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new Pessoa object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="nome">Initial value of the Nome property.</param>
 public static Pessoa CreatePessoa(global::System.Int32 id, global::System.String nome)
 {
     Pessoa pessoa = new Pessoa();
     pessoa.Id = id;
     pessoa.Nome = nome;
     return pessoa;
 }