/// <summary author="Austin Berquam" created="2019/02/06">
        /// Method that creates a guestType through the accessor
        /// </summary>
        /// <param name="roomType">Object roomtype to create</param>
        /// <returns> bool on if the room was created </returns>
        public bool CreateRoomType(RoomType roomType)
        {
            ValidationExtensionMethods.ValidateID(roomType.RoomTypeID);
            ValidationExtensionMethods.ValidateDescription(roomType.Description);
            bool result = false;

            try
            {
                result = (1 == roomTypeAccessor.InsertRoomType(roomType));
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }
            return(result);
        }
Example #2
0
        /// <summary author="Austin Berquam" created="2019/02/06">
        /// Method that creates a department through the accessor
        /// </summary>
        /// <param name="department">Object department to create</param>
        /// <returns> bool on if the department was created </returns>
        public bool CreateDepartment(Department department)
        {
            ValidationExtensionMethods.ValidateID(department.DepartmentID);
            ValidationExtensionMethods.ValidateDescription(department.Description);
            bool result = false;

            try
            {
                result = (1 == departmentAccessor.InsertDepartment(department));
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }
            return(result);
        }
        /// <summary author="Austin Berquam" created="2019/01/26">
        /// Method that sends the created role to the accessor
        /// </summary>
        /// <param name="newRole">Object holding the new role to add to the table</param>
        /// <returns> Row Count </returns>
        public bool CreateRole(EmpRoles newRole)
        {
            ValidationExtensionMethods.ValidateID(newRole.RoleID);
            ValidationExtensionMethods.ValidateDescription(newRole.Description);
            bool result = false;

            try
            {
                result = (1 == empRolesAccessor.InsertEmpRole(newRole));
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }

            return(result);
        }
Example #4
0
        /// <summary author="Craig Barkley" created="2019/02/10">
        /// Method for creating a new Pet Type.
        /// </summary>
        /// <param name="PetType newPetType">The AddPetType calls the CreatePetType(newPetType).</param>
        /// <returns>petTypes</returns>
        public bool AddPetType(PetType newPetType)
        {
            ValidationExtensionMethods.ValidateID(newPetType.PetTypeID);
            ValidationExtensionMethods.ValidateDescription(newPetType.Description);

            bool result = false;

            try
            {
                result = (1 == _petTypeAccessor.CreatePetType(newPetType));
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }

            return(result);
        }