Beispiel #1
0
        public ActionResult Index()
        {
            try
            {
                List <LocationDockQuery> ldq = _repo.GetLocationDockings();

                List <TimerModel> list = new List <TimerModel>();

                foreach (var d in ldq)
                {
                    string cn = "";
                    if (d.CartNumber < 10)
                    {
                        cn = "0" + d.CartNumber.ToString();
                    }
                    else
                    {
                        cn = d.CartNumber.ToString();
                    }

                    list.Add(new TimerModel
                    {
                        TimeDisplayName = "Display_" + d.LocationCode,
                        //ReleaseDateTime = Convert.ToString(new DateTime(2020, 6, 8, 17, 42, 00))
                        //ReleaseDateTime = Convert.ToString(DateTime.Now.AddSeconds(45))
                        ReleaseDateTime = d.EndTime.ToString(),
                        CartLineNumber  = d.LineNumber + " Cart #" + cn,
                        CartDisplayName = "Display_Cart_" + d.LocationCode
                    });
                }

                FreezeDownViewModel fdvm = new FreezeDownViewModel();
                fdvm.CartLines   = new SelectList(_repo.GetCartLines(), "LineNumber", "LineNumber");
                fdvm.CartNumbers = new SelectList(_repo.GetCartNumbers(), "CartNumber", "CartNumber");
                fdvm.UserNames   = new SelectList(_repo.GetUsersForDD(), "UserName", "UserName");

                ViewBag.TimerList  = list;
                ViewBag.Controller = this;


                //Response.AddHeader("Refresh", "600");

                //return View("Index",fdvm);
                return(View("TestGrid", fdvm));
            }

            catch (Exception ex)
            {
                TempData["FreezeDownError"] = ex;
                return(RedirectToAction("ShowError", "Error"));
            }
        }