示例#1
0
 public ActionResult Edit(Cliente cliente)
 {
     if (ModelState.IsValid)
     {
         db.Cliente.Attach(cliente);
         db.ObjectStateManager.ChangeObjectState(cliente, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(cliente);
 }
示例#2
0
        public ActionResult Create(Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                db.Cliente.AddObject(cliente);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(cliente);
        }
 /// <summary>
 /// Create a new Cliente object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Cliente CreateCliente(global::System.Int32 id)
 {
     Cliente cliente = new Cliente();
     cliente.Id = id;
     return cliente;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Cliente EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCliente(Cliente cliente)
 {
     base.AddObject("Cliente", cliente);
 }