Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public int getIdProfile()
        {
            int id = DAO.GetProfileTable().GetMaxIdProfile();

            id++;
            return(id);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public void LogIn(int id, string password)
 {
     Main.Instance.client = Main.Instance.client = DAO.GetProfileTable().GetProfileByLoginAndPassword(id, password);
 }
Ejemplo n.º 5
0
 public void EditProfile()
 {
     DAO.GetProfileTable().UpdateElementInDB(pr);
 }
Ejemplo n.º 6
0
 public void AddNewProfile()
 {
     DAO.GetProfileTable().InsertElementToDB(pr);
 }
Ejemplo n.º 7
0
        public ObservableCollection <Profile> getSearchedProfiles(int idProfile)
        {
            ObservableCollection <Profile> res = new ObservableCollection <Profile>(DAO.GetProfileTable().GetProfileByIdProfile(idProfile));

            return(res);
        }