public ActionResult GetNextBatch(int id)
        {
            ReportDBHelper db      = new ReportDBHelper(Session["ReportDB"].ToString(), 2);
            int            BatchNo = db.SelectNextBatchNo(id, Session["ReportTable"].ToString());

            if (BatchNo == 0)
            {
                Session["tempforview"] = "You have reached the maximum batch";
                return(RedirectToAction("Detail", new { id = id }));
            }
            DataReportModel data = db.SelectSteps(BatchNo, Session["ReportTable"].ToString());

            ViewBag.BatchNo = BatchNo;
            int dest = int.Parse(data.Data[0].Destination);

            if (tankNames.Keys.Contains(dest))
            {
                ViewBag.Destination = tankNames[dest];
            }
            else
            {
                Session["tempforview"] = "Check configuration of report config";
            }

            return(View("Detail", data.Data));
        }
        public ActionResult Detail(int id)
        {
            ReportDBHelper  db   = new ReportDBHelper(Session["ReportDB"].ToString(), 2);
            DataReportModel data = db.SelectSteps(id, Session["ReportTable"].ToString());

            //if (data.Data.Exists(p => p.RecordType == Operations.Interrupt))
            ViewBag.AmntTotal = data.Data.First(p => p.RecordType == Operations.RecipeStart).Need;
            //if (data.Data.Exists(p => p.RecordType == Operations.Interrupt))
            ViewBag.InteruptedCounts = data.Data.Where(p => p.RecordType == Operations.Interrupt).Count();
            //if (data.Data.Exists(p=> p.RecordType == Operations.StepSkip))
            ViewBag.NumberOfStepsSkipped = data.Data.Where(p => p.RecordType == Operations.StepSkip).Count();
            ViewBag.BatchNo = id;
            int dest = int.Parse(data.Data[0].Destination);

            if (tankNames.Keys.Contains(dest))
            {
                ViewBag.Destination = tankNames[dest];
            }
            else
            {
                Session["tempforview"] = "Check configuration of report config";
            }
            return(View(data.Data));
        }