public IHttpActionResult PutFlujo_Fijo(int id, Flujo_Fijo flujo_Fijo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != flujo_Fijo.flujofijoid) { return(BadRequest()); } db.Entry(flujo_Fijo).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Flujo_FijoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutITEM_FACTURABLE(Guid id, ITEM_FACTURABLE iTEM_FACTURABLE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iTEM_FACTURABLE.GUID) { return(BadRequest()); } db.Entry(iTEM_FACTURABLE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ITEM_FACTURABLEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutTHERAPIST(int id, THERAPIST tHERAPIST) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tHERAPIST.ID) { return(BadRequest()); } db.Entry(tHERAPIST).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!THERAPISTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutUbicacion_de_Negocio_Pequeño(int id, Ubicacion_de_Negocio_Pequeño ubicacion_de_Negocio_Pequeño) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ubicacion_de_Negocio_Pequeño.negocioid) { return(BadRequest()); } db.Entry(ubicacion_de_Negocio_Pequeño).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Ubicacion_de_Negocio_PequeñoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutTips_Financieros(int id, Tips_Financieros tips_Financieros) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tips_Financieros.tipsid) { return(BadRequest()); } db.Entry(tips_Financieros).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Tips_FinancierosExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPromocion(int id, Promocion promocion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != promocion.promocionid) { return(BadRequest()); } db.Entry(promocion).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PromocionExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutInterno(long id, Interno interno) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != interno.Id) { return(BadRequest()); } db.Entry(interno).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!InternoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutJob(int id, Job job) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != job.JobID) { return(BadRequest()); } db.Entry(job).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!JobExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutEmpresa(int id, Empresa empresa) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != empresa.empresaid) { return(BadRequest()); } db.Entry(empresa).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EmpresaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public Boolean bookReturnedUpdate(Issue_Detail issue) { BookController bookController = new BookController(); int bookID = (int)issue.book_id; Book_Detail book = bookController.findByBookID(bookID); int noOfCopies = (int)book.no_of_copies; book.no_of_copies = ++noOfCopies; Console.WriteLine("Issue ID" + issue.issue_id); Boolean status = false; try { using (var db = new ModelDB()) { bookController.updateBook(book); var entry = db.Entry(issue); entry.State = EntityState.Modified; db.SaveChanges(); status = true; } } catch (Exception ex) { Console.WriteLine("Book return update error " + ex.InnerException); } return(status); }
public async Task <IHttpActionResult> PutProduct(int id, Product product) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != product.ProductId) { return(BadRequest()); } db.Entry(product).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutStudent(int id, Student student) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != student.StudentId) { return(BadRequest()); } db.Entry(student).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "Id,Numero,Tipo,Tn,PuestoTel,Estado,NoMostrar,Observacion,SubArea_id,Puesto_id")] Interno interno) { if (ModelState.IsValid) { db.Entry(interno).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(interno)); }
public ActionResult Edit([Bind(Include = "Id,Nombre")] Area area) { if (ModelState.IsValid) { db.Entry(area).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(area)); }
public ActionResult Edit([Bind(Include = "Id,Numero")] Piso piso) { if (ModelState.IsValid) { db.Entry(piso).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(piso)); }
public ActionResult Edit([Bind(Include = "id,name,address,lat,lng,photo")] Person person) { if (ModelState.IsValid) { MapManager.SetCoord(person); db1.Entry(person).State = EntityState.Modified; db1.SaveChanges(); return(RedirectToAction("Index")); } return(View(person)); }
public async Task <ActionResult> Edit([Bind(Include = "id_application,phone_number_NTCworker,email_NTCworker")] Application application) { if (ModelState.IsValid) { db.Entry(application).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(application)); }
public ActionResult Edit([Bind(Include = "Id,Numero,Estado,NoMostrar,Observacion,SubArea_id,Puesto_id")] Directo directo) { if (ModelState.IsValid) { db.Entry(directo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Puesto_id = new SelectList(db.Puesto, "Id", "NumeroTipo", directo.Puesto_id); ViewBag.SubArea_id = new SelectList(db.SubArea, "Id", "Nombre", directo.SubArea_id); return(View(directo)); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCworker,name_NTCworker,phone_number_NTCworker," + "email_NTCworker,skype_NTCworker,experience,salary")] NTCWorkers nTCWorkers) { if (ModelState.IsValid) { db.Entry(nTCWorkers).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nTCWorkers)); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCclient,name_NTCclient,phone_number_NTCclient," + "email_NTCclient,skype_NTCclient")] NTCClients nTCClients) { if (ModelState.IsValid) { db.Entry(nTCClients).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nTCClients)); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCprovider,name_NTCprovider,phone_number_NTCprovider," + "website_NTCprovider,email_NTCprovider,address_NTCprovider")] NTCequipmentProviders nTCequipmentProviders) { if (ModelState.IsValid) { db.Entry(nTCequipmentProviders).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(nTCequipmentProviders)); }
public async Task <ActionResult> Edit([Bind(Include = "id_type_NTCservice,name_type_NTCservice")] TypesNTCServices typesNTCServices) { if (ModelState.IsValid) { db.Entry(typesNTCServices).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(typesNTCServices)); }
private void delete_Click(object sender, RoutedEventArgs e) { Tovar tovar = TovarTable.SelectedItem as Tovar; if (tovar != null) { using (ModelDB db = new ModelDB()) { db.Entry(tovar).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } UpdateTovar(); } }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCjournal,id_NTCclient,id_NTCworker,date_NTCjournal," + "time_NTCjournal,id_NTCservice,amount_NTCequipment,total_price,NTCworker_percentage")] NTCJournal nTCJournal) { if (ModelState.IsValid) { db.Entry(nTCJournal).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.id_NTCclient = new SelectList(db.NTCClients, "id_NTCclient", "name_NTCclient", nTCJournal.id_NTCclient); ViewBag.id_NTCservice = new SelectList(db.NTCServices, "id_NTCservice", "name_NTCservice", nTCJournal.id_NTCservice); ViewBag.id_NTCworker = new SelectList(db.NTCWorkers, "id_NTCworker", "name_NTCworker", nTCJournal.id_NTCworker); return(View(nTCJournal)); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCequipment,name_NTCequipment,id_type_NTCequipment," + "id_NTCprovider,amount_NTCequipment")] NTCequipmentInStock nTCequipmentInStock) { if (ModelState.IsValid) { db.Entry(nTCequipmentInStock).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.id_NTCprovider = new SelectList(db.NTCequipmentProviders, "id_NTCprovider", "name_NTCprovider", nTCequipmentInStock.id_NTCprovider); ViewBag.id_type_NTCequipment = new SelectList(db.TypesNTCequipment, "id_type_NTCequipment", "name_type_NTCequipment", nTCequipmentInStock.id_type_NTCequipment); return(View(nTCequipmentInStock)); }
public async Task <ActionResult> Edit([Bind(Include = "id_NTCservice,name_NTCservice,price_NTCservice,id_NTCequipment," + "id_type_NTCservice")] NTCServices nTCServices) { if (ModelState.IsValid) { db.Entry(nTCServices).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.id_NTCequipment = new SelectList(db.NTCequipmentInStock, "id_NTCequipment", "name_NTCequipment", nTCServices.id_NTCequipment); ViewBag.id_type_NTCservice = new SelectList(db.TypesNTCServices, "id_type_NTCservice", "name_type_NTCservice", nTCServices.id_type_NTCservice); return(View(nTCServices)); }
private void Button_Click_4(object sender, RoutedEventArgs e) { SdelkaModel sdelkaModel = (SdelkaModel)sdelkaList.SelectedItem; using (ModelDB db = new ModelDB()) { Sdelka sdelka = db.Sdelka.Where(p => p.sdelka1 == sdelkaModel.id).FirstOrDefault(); if (sdelka != null) { db.Entry(sdelka).State = EntityState.Deleted; db.SaveChanges(); } } sdelkaList.SelectedItem = null; UpdateSdelka(); }
public IHttpActionResult PuttbUsuario(int id, tbUsuario tbUsuario) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbUsuario.IdUsuario) { return(BadRequest()); } db.Entry(tbUsuario).State = EntityState.Modified; return(StatusCode(HttpStatusCode.NoContent)); }
private void edit_Click(object sender, RoutedEventArgs e) { Tovar tovar = TovarTable.SelectedItem as Tovar; if (tovar != null) { tovar.name = name.Text; tovar.price = decimal.Parse(price.Text); tovar.sort = sort.Text; tovar.description = description.Text; using (ModelDB db = new ModelDB()) { db.Entry(tovar).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } UpdateTovar(); } }
public ActionResult AddOrEdit(ASPMVCEmployee employee) { using (ModelDB db = new ModelDB()) { if (employee.EmployeeID == 0) { db.ASPMVCEmployees.Add(employee); db.SaveChanges(); return(Json(new { succes = true, message = "Employee Added" }, JsonRequestBehavior.AllowGet)); } else { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(Json(new { succes = true, message = "Employee Updated" }, JsonRequestBehavior.AllowGet)); } } }