public void LogIn(int ids, string password, Login log) { Main.Instance.worker = DAO.GetProfileTable().GetProfileByLoginAndPassword(ids, password); locworker = Main.Instance.worker; switch (locworker.profileCategory.id) { case 1: ReaderMainWindow rm = new ReaderMainWindow(); rm.Show(); break; case 2: LibrarianMainWindow lm = new LibrarianMainWindow(); lm.Show(); break; case 3: AdminMainWindow ad = new AdminMainWindow(); ad.Show(); break; } log.Close(); }
public int getIdProfile() { int id = DAO.GetProfileTable().GetMaxIdProfile(); id++; return(id); }
public void GiveBook(int idbook, int idclient) { Book book = DAO.GetBookTable().GetElement(idbook); if (book.status.id != 1) { throw new GivingGivenBookException(); } Profile profile = DAO.GetProfileTable().GetElement(idclient); book.recipient = profile; book.issueDate = DateTime.Now; book.status = DAO.GetBookStatusTable().GetElement(2); DAO.GetBookTable().UpdateElementInDB(book); }
public void LogIn(int id, string password) { Main.Instance.client = Main.Instance.client = DAO.GetProfileTable().GetProfileByLoginAndPassword(id, password); }
public void EditProfile() { DAO.GetProfileTable().UpdateElementInDB(pr); }
public void AddNewProfile() { DAO.GetProfileTable().InsertElementToDB(pr); }
public ObservableCollection <Profile> getSearchedProfiles(int idProfile) { ObservableCollection <Profile> res = new ObservableCollection <Profile>(DAO.GetProfileTable().GetProfileByIdProfile(idProfile)); return(res); }