Example #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));
 }
Example #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));
 }
Example #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));
 }
Example #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));
 }
Example #5
0
 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));
 }
Example #6
0
 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));
 }
Example #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));
 }
Example #8
0
 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));
 }