コード例 #1
0
ファイル: RolesController.cs プロジェクト: KrusX/CashDesk
 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));
 }
コード例 #2
0
ファイル: TrainsController.cs プロジェクト: KrusX/CashDesk
 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));
 }
コード例 #3
0
ファイル: ClientsController.cs プロジェクト: KrusX/CashDesk
 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));
 }
コード例 #4
0
ファイル: ReysController.cs プロジェクト: KrusX/CashDesk
 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));
 }
コード例 #5
0
ファイル: PlacesController.cs プロジェクト: KrusX/CashDesk
 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));
 }
コード例 #6
0
 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));
 }
コード例 #7
0
 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));
 }