Ejemplo n.º 1
0
        public ActionResult Delete(long id)
        {
            var person = ArchiveDataRepository.GetSingle(id);

            if (person != null)
            {
                ArchiveDataRepository.DeleteData(person);
                return(Ok());
            }
            return(NotFound());
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
        public ActionResult <ArchiveData> GetPerson(long borrowerId)
        {
            var data = ArchiveDataRepository.GetManyByPerson(borrowerId);

            //Check successs
            if (data != null)
            {
                return(Ok(data));
            }
            else
            {
                return(NotFound());
            }
        }
Ejemplo n.º 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());
            }
        }
Ejemplo n.º 5
0
        public ActionResult <ArchiveData> Get(long id)
        {
            var data = ArchiveDataRepository.GetSingle(id);

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

            return(Ok(allData));
        }
Ejemplo n.º 7
0
        public ActionResult Post(ArchiveData data)
        {
            ArchiveDataRepository.AddData(data);

            return(Ok());
        }