public static void AddExpDetail(ExpInfoDetail expInfoDetail) { using (var expInfoDetailContext = new ExpInfoDetailContext()) { expInfoDetailContext.ExpInfoDetails.Add(expInfoDetail); expInfoDetailContext.SaveChanges(); } }
public ActionResult DeleteConfirmed(int id) { ExpInfoDetail expInfoDetail = db.ExpInfoDetails.Find(id); db.ExpInfoDetails.Remove(expInfoDetail); db.SaveChanges(); return(RedirectToAction("Index")); }
public static void ReceiveData(ExpInfoDetail expInfoDetail) { if (runningExp) { expInfoDetail.ExpNo = expNo; expInfoDetailList.Add(expInfoDetail); } }
public ActionResult Edit([Bind(Include = "Id,ExpNo,CollectedTime,Acceleration")] ExpInfoDetail expInfoDetail) { if (ModelState.IsValid) { db.Entry(expInfoDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(expInfoDetail)); }
public ActionResult Create([Bind(Include = "Id,ExpNo,CollectedTime,Acceleration")] ExpInfoDetail expInfoDetail) { if (ModelState.IsValid) { db.ExpInfoDetails.Add(expInfoDetail); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(expInfoDetail)); }
// GET: ExpInfoDetails/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExpInfoDetail expInfoDetail = db.ExpInfoDetails.Find(id); if (expInfoDetail == null) { return(HttpNotFound()); } return(View(expInfoDetail)); }
private void WriteDate(object sender, EventArgs e) { int deg = 30 * counter; double rad = Math.PI * deg / 180.0; double value = Math.Sin(rad); ExpInfoDetail expInfoDetail = new ExpInfoDetail() { CollectedTime = DateTime.Now, Acceleration = value }; counter++; if (counter > 12) { counter = 1; } DataManager.ReceiveData(expInfoDetail); }
public void Add(ExpInfoDetail data) { DataManager.ReceiveData(data); return; }