public ActionResult LoginForm(LoginResponse loginResponse)
        {
            if (ModelState.IsValid)
            {
                if (loginResponse.IsValidAdmin(loginResponse.Login, loginResponse.Password))
                {
                    //FormsAuthentication.SetAuthCookie(loginResponse.Login, true);

                    var conn =
                        new OleDbConnection(
                            "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|Użytkownicy.accdb");
                    var cmd = new OleDbCommand("SELECT * FROM [Users]") {Connection = conn};
                    conn.Open();
                    var reader = cmd.ExecuteReader();

                    var usersModel = new List<UsersData>();
                    while (reader != null && reader.Read())
                    {
                        var usersData = new UsersData
                        {
                            Id = (int) reader["Identyfikator"],
                            Login = (string) reader["Login"],
                            Password = (string) reader["Hasło"],
                            Privileges = (string) reader["Prawa"]
                        };

                        usersModel.Add(usersData);
                    }
                    conn.Close();
                    return View("AdminPanelForm", usersModel);
                }
                else if (loginResponse.IsValidModerator(loginResponse.Login, loginResponse.Password))
                {
                    //FormsAuthentication.SetAuthCookie(loginResponse.Login, true);

                    var conn =
                       new OleDbConnection(
                           "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|Awarie.accdb");
                    var cmd = new OleDbCommand("SELECT * FROM [Zgloszenie]") { Connection = conn };
                    conn.Open();
                    var reader = cmd.ExecuteReader();

                    var failuresModel = new List<FailuresData>();
                    while (reader != null && reader.Read())
                    {
                        var failuresData = new FailuresData
                        {
                            Id = (int)reader["Identyfikator"],
                            EntryDate = (string)reader["Data"],
                            Topic = (string)reader["Temat"],
                            Description = (string)reader["Opis"],
                            Floor = (int)reader["Pietro"],
                            Area = (string)reader["Strefa"],
                            Worksite = (string)reader["Stanowisko"],
                            Status = (bool)reader["Status"]
                        };

                        failuresModel.Add(failuresData);
                    }
                    conn.Close();
                    return View("ModeratorPanelForm", failuresModel);
                }
                else
                {
                    ModelState.AddModelError("", "Błędne dane logowania.");
                }
            }
            return View();
        }
        public ActionResult ModeratorPanelForm()
        {
            var conn =
                      new OleDbConnection(
                          "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|Awarie.accdb");
            var cmd = new OleDbCommand("SELECT * FROM [Zgloszenie]") { Connection = conn };
            conn.Open();
            var reader = cmd.ExecuteReader();

            var failuresModel = new List<FailuresData>();
            while (reader != null && reader.Read())
            {
                var failuresData = new FailuresData
                {
                    Id = (int)reader["Identyfikator"],
                    EntryDate = (string)reader["Data"],
                    Topic = (string)reader["Temat"],
                    Description = (string)reader["Opis"],
                    Floor = (int)reader["Pietro"],
                    Area = (string)reader["Strefa"],
                    Worksite = (string)reader["Stanowisko"],
                    Status = (bool)reader["Status"]
                };
                failuresModel.Add(failuresData);
            }
            ModelState.AddModelError("", "Akcja wykonana.");
            conn.Close();
            return View("ModeratorPanelForm", failuresModel);
        }
        public ActionResult BrowseCommentsForm(int id)
        {
            var conn =
                     new OleDbConnection(
                         "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|Awarie.accdb");
            var cmd = new OleDbCommand("SELECT * FROM [Zgloszenie] WHERE [Identyfikator] = @i ") { Connection = conn };
            cmd.Parameters.Add(new OleDbParameter("@i", OleDbType.VarWChar)).Value = id;
            conn.Open();
            var reader = cmd.ExecuteReader();

            var browseCommentsModel = new List<FailuresData>();
            while (reader != null && reader.Read())
            {
                var browseCommentsData = new FailuresData
                {
                    Id = (int)reader["Identyfikator"],
                    EntryDate = (string)reader["Data"],
                    Topic = (string)reader["Temat"],
                    Description = (string)reader["Opis"],
                    Floor = (int)reader["Pietro"],
                    Area = (string)reader["Strefa"],
                    Worksite = (string)reader["Stanowisko"],
                    Status = (bool)reader["Status"]
                };
                browseCommentsModel.Add(browseCommentsData);
            }
            conn.Close();

            var newcmd = new OleDbCommand("SELECT * FROM [Komentarze] WHERE [IdAwarii] = @i ") { Connection = conn };
            newcmd.Parameters.Add(new OleDbParameter("@i", OleDbType.VarWChar)).Value = id;

            conn.Open();
            reader = newcmd.ExecuteReader();

            while (reader != null && reader.Read())
            {
                var browseCommentsData = new FailuresData
                {
                    Id = -1,
                    Comment = (string)reader["Komentarz"]
                };
                browseCommentsModel.Add(browseCommentsData);
            }

            conn.Close();

            return View("BrowseCommentsForm", browseCommentsModel);
        }