Exemple #1
0
        public ActionResult Delete(long id)
        {
            var person = ArchiveDataRepository.GetSingle(id);

            if (person != null)
            {
                ArchiveDataRepository.DeleteData(person);
                return(Ok());
            }
            return(NotFound());
        }
Exemple #2
0
        public ActionResult Put(ArchiveData person, long id)
        {
            var dbPerson = ArchiveDataRepository.GetSingle(id);

            //Update if it exist
            if (dbPerson != null)
            {
                ArchiveDataRepository.UpdateData(person);
                return(Ok());
            }
            return(NotFound());
        }
Exemple #3
0
        public ActionResult <ArchiveData> GetPerson(long borrowerId)
        {
            var data = ArchiveDataRepository.GetManyByPerson(borrowerId);

            //Check successs
            if (data != null)
            {
                return(Ok(data));
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #4
0
        public ActionResult <ArchiveData> GetSpecific(long bookId, long borrowerId)
        {
            var data = ArchiveDataRepository.GetLastByIds(bookId, borrowerId);

            //Check successs
            if (data != null)
            {
                return(Ok(data));
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #5
0
        public ActionResult <ArchiveData> Get(long id)
        {
            var data = ArchiveDataRepository.GetSingle(id);

            //Check successs
            if (data != null)
            {
                return(Ok(data));
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #6
0
        public ActionResult <IEnumerable <ArchiveData> > Get()
        {
            var allData = ArchiveDataRepository.GetAll();

            return(Ok(allData));
        }
Exemple #7
0
        public ActionResult Post(ArchiveData data)
        {
            ArchiveDataRepository.AddData(data);

            return(Ok());
        }