public ActionResult DeleteConfirmed(long id)
        {
            GeneratorLog generatorLog = db.GeneratorLogs.Find(id);

            db.GeneratorLogs.Remove(generatorLog);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Temprature,FK_GeneratorId,Logging_date")] GeneratorLog generatorLog)
 {
     if (ModelState.IsValid)
     {
         db.Entry(generatorLog).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FK_GeneratorId = new SelectList(db.Generators, "Id", "GeneratorName", generatorLog.FK_GeneratorId);
     return(View(generatorLog));
 }
        // GET: GeneratorLogs/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GeneratorLog generatorLog = db.GeneratorLogs.Find(id);

            if (generatorLog == null)
            {
                return(HttpNotFound());
            }
            return(View(generatorLog));
        }
        // GET: GeneratorLogs/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GeneratorLog generatorLog = db.GeneratorLogs.Find(id);

            if (generatorLog == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FK_GeneratorId = new SelectList(db.Generators, "Id", "GeneratorName", generatorLog.FK_GeneratorId);
            return(View(generatorLog));
        }
 public static GraphDTO FromDB(GeneratorLog model)
 {
     return(new GraphDTO()
     {
         ActiveClientsQuantity = model.ActiveClientsQuantity,
         TestStartTime = model.TestStartTime.ToString(),
         ReqType = model.ReqType,
         ReqNo = model.ReqNo,
         ReqTime = model.ReqTime,
         BackendTime = model.BackendTime,
         DbSelectsQuantity = model.DbSelectsQuantity,
         DbSelectsTime = model.DbSelectsTime,
         DbUpdatesQuantity = model.DbUpdatesQuantity,
         DbUpdatesTime = model.DbUpdatesTime,
         DbInsertsQuantity = model.DbInsertsQuantity,
         DbInsertsTime = model.DbInsertsTime,
         DbDeletesQuantity = model.DbDeletesQuantity,
         DbDeletesTime = model.DbDeletesTime,
         RespType = model.RespType
     });
 }