public ActionResult Level() { var ClientId = 2; var Name = "water"; ViewBag.ClientId = ClientId; ViewBag.Name = Name; _levelModule.Initialize(ClientId, Name); ViewBag.MaxLevel = _levelModule.MaxLevel; ViewBag.MinLevel = _levelModule.MinLevel; return(View()); }
public ActionResult Level(int ClientId, string Name) { //var ClientId = 2; //var Name = "water"; ViewBag.ClientId = ClientId; ViewBag.Name = Name; _levelModule.Initialize(ClientId, Name); ViewBag.MaxLevel = _levelModule.MaxLevel; ViewBag.MinLevel = _levelModule.MinLevel; var total = _levelModule.MinLevel - _levelModule.MaxLevel; var level = _levelModule.GetLatestLevel().Value; level = level / (total == 0 ? 100 : total); ViewBag.Level = 120 - Math.Round(level * 120); return(View()); }