Example #1
0
        public Institution Post([FromBody] Institution model)
        {
            // POST: api/User
            // this post method insert the new row or update the current row if there is a record with same ID
            InstitutionDE de    = new InstitutionDE();
            Institution   sonuc = de.AddInstitution(model);

            return(sonuc);
        }
Example #2
0
        public IEnumerable <Institution> Get(int id)
        {
            // GET: api/Institution
            //HttpContext.RiseError(new InvalidOperationException("Test"));
            Institution   model = new Institution();
            InstitutionDE de    = new InstitutionDE();

            return(de.GetInstitution(id));
        }
Example #3
0
        public IActionResult Delete(int id)
        {
            // DELETE: api/ApiWithActions/5
            InstitutionDE de    = new InstitutionDE();
            bool          sonuc = de.DeleteInstitution(id);

            if (sonuc)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Example #4
0
        public IActionResult Put([FromBody] Institution model)
        {
            // POST: api/Institution
            // this post method insert the new row or update the current row if there is a record with same ID
            InstitutionDE de    = new InstitutionDE();
            bool          sonuc = de.UpdateInstitution(model);

            if (sonuc)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }