コード例 #1
0
 public static void AddExpDetail(ExpInfoDetail expInfoDetail)
 {
     using (var expInfoDetailContext = new ExpInfoDetailContext())
     {
         expInfoDetailContext.ExpInfoDetails.Add(expInfoDetail);
         expInfoDetailContext.SaveChanges();
     }
 }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ExpInfoDetail expInfoDetail = db.ExpInfoDetails.Find(id);

            db.ExpInfoDetails.Remove(expInfoDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public static void ReceiveData(ExpInfoDetail expInfoDetail)
 {
     if (runningExp)
     {
         expInfoDetail.ExpNo = expNo;
         expInfoDetailList.Add(expInfoDetail);
     }
 }
コード例 #4
0
 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));
 }
コード例 #5
0
        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));
        }
コード例 #6
0
        // 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));
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        public void Add(ExpInfoDetail data)
        {
            DataManager.ReceiveData(data);

            return;
        }