public UserEmergencyContacts[] ReadListOfAllUserEmergencyContacts()
        {
            FarmworkersWebAPI.Models.User _userControllerInstance = new FarmworkersWebAPI.Models.User();

            DataTable _listOfUsersEmergencyContactsFromDatabase = _userControllerInstance.GetListOfAllUsers();

            UserEmergencyContacts[] _listOfUsersEmergencyContacts = new UserEmergencyContacts[_listOfUsersEmergencyContactsFromDatabase.Rows.Count];

            int _userEmergencyContactCounter = 0;

            foreach (DataRow _userRow in _listOfUsersEmergencyContactsFromDatabase.Rows)
            {
                UserEmergencyContacts _userEmergencyContact = new UserEmergencyContacts
                {
                    UserID = int.Parse(_userRow["UserID"].ToString()),
                    UserEmergencyContactsID          = int.Parse(_userRow["UserEmergencyContactsID"].ToString()),
                    UserEmergencyContactsName        = _userRow["UserEmergencyContactsName"].ToString(),
                    UserEmergencyContactsPhoneNumber = _userRow["UserEmergencyContactsPhoneNumber"].ToString(),
                    UserEmergencyContactsAddress     = _userRow["UserEmergencyContactsAddress"].ToString()
                };

                _listOfUsersEmergencyContacts[_userEmergencyContactCounter] = _userEmergencyContact;

                _userEmergencyContactCounter++;
            }

            return(_listOfUsersEmergencyContacts);
        }
        public FarmworkersWebAPI.Models.User[] ReadListOfUsers()
        {
            FarmworkersWebAPI.Models.User _userControllerInstance = new FarmworkersWebAPI.Models.User();

            DataTable _listOfUsersFromDatabase = _userControllerInstance.GetListOfAllUsers();

            FarmworkersWebAPI.Models.User[] _listOfUsers = new FarmworkersWebAPI.Models.User[_listOfUsersFromDatabase.Rows.Count];

            int _userCounter = 0;

            foreach (DataRow _userRow in _listOfUsersFromDatabase.Rows)
            {
                FarmworkersWebAPI.Models.User _user = new FarmworkersWebAPI.Models.User
                {
                    UserID           = int.Parse(_userRow["UserID"].ToString()),
                    UserType         = _userRow["UserType"].ToString(),
                    UserName         = _userRow["UserName"].ToString(),
                    UserLastName     = _userRow["UserLastName"].ToString(),
                    UserDateOfBirth  = _userRow["UserDateOfBirth"].ToString(),
                    UserWeight       = int.Parse(_userRow["UserWeight"].ToString()),
                    UserHeight       = _userRow["UserHeight"].ToString(),
                    UserGender       = _userRow["UserGender"].ToString(),
                    UserEmail        = _userRow["UserEmail"].ToString(),
                    UserPhoneNumber  = _userRow["UserPhoneNumber"].ToString(),
                    UserWorkLocation = _userRow["UserWorkLocation"].ToString(),
                    UserMemberSince  = _userRow["UserMemberSince"].ToString(),
                    IsActive         = _userRow["IsActive"].ToString(),
                    UserFarmID       = _userRow["FarmID"].ToString(),
                };

                _listOfUsers[_userCounter] = _user;

                _userCounter++;
            }

            return(_listOfUsers);
        }