public ActionResult Edit([Bind(Include = "id_role,name_role")] Role role) { if (ModelState.IsValid) { db.Entry(role).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(role)); }
public ActionResult Edit([Bind(Include = "id_train,type_train_id")] Train train) { if (ModelState.IsValid) { db.Entry(train).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.type_train_id = new SelectList(db.Type_train, "id_type_train", "name_type", train.type_train_id); return(View(train)); }
public ActionResult Edit([Bind(Include = "id_client,surname,name,patronymic,pass,login,password,role_id")] Client client) { if (ModelState.IsValid) { db.Entry(client).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.role_id = new SelectList(db.Roles, "id_role", "name_role", client.role_id); return(View(client)); }
public ActionResult Edit([Bind(Include = "id_reys,train_id,start_point,end_point,start_date,end_date")] Rey rey) { if (ModelState.IsValid) { db.Entry(rey).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.train_id = new SelectList(db.Trains, "id_train", "id_train", rey.train_id); return(View(rey)); }
public ActionResult Edit([Bind(Include = "id_place,wagon_id")] Place place) { if (ModelState.IsValid) { db.Entry(place).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.wagon_id = new SelectList(db.Wagons, "id_wagon", "id_wagon", place.wagon_id); return(View(place)); }
public ActionResult Edit([Bind(Include = "id_reservation,ticket_id,date_reservation,client_id,status_reservation_id")] Reservation reservation) { if (ModelState.IsValid) { db.Entry(reservation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.client_id = new SelectList(db.Clients, "id_client", "surname", reservation.client_id); ViewBag.status_reservation_id = new SelectList(db.Status_res, "id_status_reservation", "name_status", reservation.status_reservation_id); ViewBag.ticket_id = new SelectList(db.Tickets, "id_ticket", "id_ticket", reservation.ticket_id); return(View(reservation)); }
public ActionResult Edit([Bind(Include = "id_ticket,reys_id,place_id,price,status_ticket_id")] Ticket ticket) { if (ModelState.IsValid) { db.Entry(ticket).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.place_id = new SelectList(db.Places, "id_place", "id_place", ticket.place_id); ViewBag.reys_id = new SelectList(db.Reys, "id_reys", "start_point", ticket.reys_id); ViewBag.status_ticket_id = new SelectList(db.Status_ticket, "id_status_ticket", "name_status", ticket.status_ticket_id); return(View(ticket)); }