Example #1
0
        public IActionResult Index()
        {
            ListAllWorkersVM vm = new ListAllWorkersVM()
            {
                Uzytkownicy = _uzytkownikService.Get()
            };

            return(View(vm));
        }
Example #2
0
        public IActionResult Logowanie(string nazwa)
        {
            ListAllWorkersVM vm = new ListAllWorkersVM()
            {
                Uzytkownicy = _uzytkownikService.Loguj(nazwa)
            };

            if (nazwa == "Admin")
            {
                return(RedirectToAction("Index_Admin"));
            }
            else
            {
                if (vm.Uzytkownicy.Count > 0)
                {
                    if (nazwa == "Policja")
                    {
                        return(RedirectToAction("Index_Policja"));
                    }
                    else if (nazwa == "Urzednik")
                    {
                        return(RedirectToAction("Index_Urzednik"));
                    }
                    else if (nazwa == "Petent")
                    {
                        return(RedirectToAction("Index_Petent"));
                    }
                    else
                    {
                        return(RedirectToAction("Index_Bad"));
                    }
                }
                else
                {
                    return(RedirectToAction("Index_Bad"));
                }
            }
        }