/** * Saving the user in the Database * * @user : the user to save * * return true if and only if the saving operation was successfull and false otherwise **/ public bool save(User user) { try { if (userDAO.save(user)) { user.setId(DatabaseDAOImplementation <User> .getLastId(DatabaseConstants.TABLE_USER)); return(true); } } catch (Exception e) { Logging.logInfo(true, e.Message); } return(false); }
/** * Saving the document * * @document : the document to save * * return true if and only if the save opearation was successfull **/ public bool save(Document document) { try { bool flag = documentDAO.save(document); if (flag) { document.setId(DatabaseDAOImplementation <Document> .getLastId(DatabaseConstants.TABLE_DOCUMENT)); return(true); } } catch (Exception e) { Logging.logInfo(true, e.Message); } return(false); }
/** * Saving the notebook to the database * * @notebook : the notebook object to save * * return true if and only if the save operation was done successfully and false otherwise **/ public bool save(Notebook notebook) { try { bool flag = notebookDAO.save(notebook); if (flag) { notebook.setId(DatabaseDAOImplementation <Notebook> .getLastId(DatabaseConstants.TABLE_NOTEBOOK)); return(true); } } catch (Exception e) { Logging.logInfo(true, e.Message); } return(false); }
/** * Saving a task in the databse * * @task : the task that will be saved * * return true if and only if the task was successfu;ly saved **/ public bool save(TaskNote task) { try { bool flag = taskDAO.save(task); if (flag) { task.id = DatabaseDAOImplementation <TaskNote> .getLastId(DatabaseConstants.TABLE_TASK); return(true); } } catch (Exception e) { Logging.logInfo(true, e.Message); } return(false); }