public IHttpActionResult PutUSER(string id, USER uSER) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != uSER.USERNAME) { return(BadRequest()); } db.Entry(uSER).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!USERExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "id,posao_id,usluga_id")] posao_usluga posao_usluga) { if (ModelState.IsValid) { db.Entry(posao_usluga).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.posao_id = new SelectList(db.posaos, "id", "grad", posao_usluga.posao_id); ViewBag.usluga_id = new SelectList(db.uslugas, "id", "opis", posao_usluga.usluga_id); return(View(posao_usluga)); }
public IHttpActionResult PutCompras(string id, Compras compras) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != compras.Cod_Compra) { return(BadRequest()); } db.Entry(compras).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ComprasExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult AddOrEdit(Employee emp) { try { if (emp.ImageUpload != null) { var fileName = Path.GetFileNameWithoutExtension(emp.ImageUpload.FileName); var extension = Path.GetExtension(emp.ImageUpload.FileName); fileName = fileName + DateTime.Now.ToString("yy-MMM-dd ddd") + extension; emp.ImagePath = "~/AppFiles/ImageFiles/" + fileName; emp.ImageUpload.SaveAs(Path.Combine(Server.MapPath("~/AppFiles/ImageFiles/"), fileName)); } using (DbModels db = new DbModels()) { if (emp.EmployeeId == 0) { db.Employees.Add(emp); db.SaveChanges(); } else { db.Entry(emp).State = EntityState.Modified; db.SaveChanges(); } } return(Json(new { success = true, html = GlobalClass.RenderRazorViewToString(this, "ViewAll", GetAllEmployee()), Message = "Submitted Successfully!" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { success = false, Message = e.Message }, JsonRequestBehavior.AllowGet)); } }
public IHttpActionResult PutEnvio(string id, Envio envio) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != envio.Cod_Envio) { return(BadRequest()); } db.Entry(envio).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!EnvioExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutDOCUMENT(string id, DOCUMENT dOCUMENT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != dOCUMENT.STU_ID) { return(BadRequest()); } db.Entry(dOCUMENT).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DOCUMENTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPROGRAM(int id, PROGRAM pROGRAM) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pROGRAM.PRO_ID) { return(BadRequest()); } db.Entry(pROGRAM).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PROGRAMExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutCATEGORY(int id, CATEGORY cATEGORY) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cATEGORY.CATE_ID) { return(BadRequest()); } db.Entry(cATEGORY).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CATEGORYExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutYEAR(int id, YEAR yEAR) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != yEAR.YEAR_ID) { return(BadRequest()); } db.Entry(yEAR).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!YEARExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutINTAKE(int id, INTAKE iNTAKE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iNTAKE.INTAKE_ID) { return(BadRequest()); } db.Entry(iNTAKE).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!INTAKEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutBRANCH(int id, BRANCH bRANCH) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bRANCH.BRANCH_ID) { return(BadRequest()); } db.Entry(bRANCH).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BRANCHExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit(int id, User user) { using (DbModels dbModel = new DbModels()) { dbModel.Entry(user).State = EntityState.Modified; dbModel.SaveChanges(); } return(RedirectToAction("Index", "User")); }
public ActionResult Edit([Bind(Include = "id,grad,lokacija,sklopljen,zavrsen,trajanje_od,trajanje_do")] posao posao) { if (ModelState.IsValid) { if (posao.zavrsen.Length != 1) { throw new Exception("Duljina polja završen mora biti točno 1"); } if (posao.sklopljen.Length != 1) { throw new Exception("Duljina polja sklopljen mora biti točno 1"); } db.Entry(posao).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(posao)); }
public ActionResult Editar(String codigo_juego, Juego_Favorito juego_Favorito) { using (DbModels dbModel = new DbModels()) { dbModel.Entry(juego_Favorito).State = System.Data.Entity.EntityState.Modified; dbModel.SaveChanges(); } return(RedirectToAction("List")); }
public ActionResult Edit([Bind(Include = "id,naziv")] usluga_kategorija usluga_kategorija) { if (ModelState.IsValid) { db.Entry(usluga_kategorija).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usluga_kategorija)); }
public ActionResult Edit([Bind(Include = "ServiceId,ServiceName,ServicePrice")] Service service) { if (ModelState.IsValid) { db.Entry(service).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(service)); }
public ActionResult Edit([Bind(Include = "Cod_Clientes,Nombre_Cliente,Apellido_Cliente,Direccion_Cliente,Correo,Telefono_Cliente,Password")] Clientes clientes) { if (ModelState.IsValid) { db.Entry(clientes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clientes)); }
public ActionResult Edit([Bind(Include = "id,naziv")] certifikat certifikat) { if (ModelState.IsValid) { db.Entry(certifikat).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(certifikat)); }
public ActionResult Edit([Bind(Include = "UserId,UserName,Email,MobileNo,Address,Password,UserType")] UserRegistration userRegistration) { if (ModelState.IsValid) { db.Entry(userRegistration).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userRegistration)); }
public ActionResult Edit([Bind(Include = "Id,Nombre")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }
public ActionResult Edit([Bind(Include = "id,raspisala_osoba,opis,iznos,datum_od,datum_do,pobjednik,prihvacen_iznos")] natjecaj natjecaj) { if (ModelState.IsValid) { db.Entry(natjecaj).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(natjecaj)); }
public ActionResult Edit([Bind(Include = "idConsumo,userNameColaborador,tipoConsumo,lectura,fechaCreacion")] Consumo consumo) { if (ModelState.IsValid) { db.Entry(consumo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(consumo)); }
public ActionResult Edit([Bind(Include = "Id,Code,Name,Email,City,CNIC,Contact_No,BrokerID")] broker broker) { if (ModelState.IsValid) { db.Entry(broker).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Admin")); } return(View(broker)); }
public ActionResult Edit([Bind(Include = "userNameColaborador,nombreUsuario,Email,Password,sector,localidad,tipoUsuario,fechaCreacion")] Colaborador colaborador) { if (ModelState.IsValid) { db.Entry(colaborador).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(colaborador)); }
public ActionResult Edit([Bind(Include = "UserID,Image,Fullname,Username,Password,Age,CNIC,Adress,Contact_no,Email,Salary,Gender,Religion,Cast,Profession,Account_no,City")] user user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "Cod_Repartidores,CI,Telefono_Repartidor,Nombre_Repartidor,Placa")] Repartidores repartidores) { if (ModelState.IsValid) { db.Entry(repartidores).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(repartidores)); }
public ActionResult Edit([Bind(Include = "id,ime,prezime,datum_rodjenja,zauzet")] osoblje osoblje) { if (ModelState.IsValid) { db.Entry(osoblje).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(osoblje)); }
public ActionResult Edit([Bind(Include = "id,naziv,adresa")] skladiste skladiste) { if (ModelState.IsValid) { db.Entry(skladiste).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(skladiste)); }
public ActionResult Edit([Bind(Include = "numReporte,numReporteUsr,userName,Descripcion,situacion,ubicacion,longitud,latitud,FotoUrl,Comentarios,estatus,fechaCreacion,fechaCorreccion")] Reporte reporte) { if (ModelState.IsValid) { db.Entry(reporte).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(reporte)); }
public ActionResult Edit([Bind(Include = "Pid,Name,MobileNo,Email,Address")] PickupBoy pickupBoy) { if (ModelState.IsValid) { db.Entry(pickupBoy).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pickupBoy)); }