コード例 #1
0
 public ActionResult Edit([Bind(Include = "ClientID,Name,Type,ClientCode,Description")] Client client)
 {
     if (ModelState.IsValid)
     {
         db.Entry(client).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(client));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Name,DateInitiated,HomeAddress,City,State,ZIP,Description,FamilyName")] Ecosystem dARESystem)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dARESystem).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dARESystem));
 }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "DataID,ThingID,Temperature,Date")] SensorData sensorData)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sensorData).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ThingID = new SelectList(db.Things, "ThingID", "Name", sensorData.ThingID);
     return(View(sensorData));
 }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "ActionID,ThingID,Name,Description")] Models.Action model)
 {
     if (ModelState.IsValid)
     {
         db.Entry(model).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ThingID = new SelectList(db.Things, "ThingID", "Name", model.ThingID);
     return(View(model));
 }
コード例 #5
0
ファイル: EventsController.cs プロジェクト: PruessnerN/DARE
 public ActionResult Edit([Bind(Include = "EventID,ThingID,Action,Type,Date")] Event @event)
 {
     if (ModelState.IsValid)
     {
         db.Entry(@event).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ThingID = new SelectList(db.Things, "ThingID", "Name", @event.ThingID);
     return(View(@event));
 }
コード例 #6
0
ファイル: ThingsController.cs プロジェクト: PruessnerN/DARE
 public ActionResult Edit([Bind(Include = "ThingID,ClientID,Name,Description,StateDescriptor")] Thing thing)
 {
     if (ModelState.IsValid)
     {
         db.Entry(thing).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClientID = new SelectList(db.Clients, "ClientID", "Name", thing.ClientID);
     return(View(thing));
 }
コード例 #7
0
 public ActionResult Edit([Bind(Include = "ScheduleID,ThingID,ActionID,Name,CronExpression,Description")] Schedule schedule)
 {
     if (ModelState.IsValid)
     {
         db.Entry(schedule).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ThingID = new SelectList(db.Things, "ThingID", "Name", schedule.ThingID);
     return(View(schedule));
 }
コード例 #8
0
ファイル: NotesController.cs プロジェクト: PruessnerN/DARE
 public ActionResult Edit([Bind(Include = "NoteID,SenderID,ReceiverID,Subject,Message,isNew,Alert,PushNotification,CreationDate,AlertDate")] Note note)
 {
     if (ModelState.IsValid)
     {
         db.Entry(note).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Sent"));
     }
     ViewBag.SenderID   = new SelectList(db.Users, "UserID", "Username", note.SenderID);
     ViewBag.ReceiverID = new SelectList(db.Users, "UserID", "Username", note.ReceiverID);
     return(View(note));
 }