public IHttpActionResult PutAccounts(Guid id, Accounts accounts) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != accounts.id_account) { return(BadRequest()); } dbAppApaymenstsContext.Entry(accounts).State = EntityState.Modified; try { dbAppApaymenstsContext.SaveChanges(); } catch (DbUpdateConcurrencyException e) { if (!AccountsExists(id)) { return(Content(HttpStatusCode.NotFound, string.Format("No es posible obtener informacion de la cuenta {0} en este momento, intente de nuevo!", id.ToString()))); } else { throw new DbUpdateConcurrencyException(string.Format("No es posible obtener informacion en este momento, intente de nuevo!"), e); } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Create([Bind(Include = "id_account,number_account,id_customer,current_account_balance,bank_account,exemption_gmf")] Accounts accounts) { if (ModelState.IsValid) { accounts.id_account = Guid.NewGuid(); db.Accounts.Add(accounts); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_customer = new SelectList(db.Clients, "id_customer", "customer_code", accounts.id_customer); return(View(accounts)); }