public IHttpActionResult Generisi_statistiku(Robna_kartica robna_kartica)
        {
            // USER CODE STARTS HERE

            return(Ok());
            // USER CODE ENDS HERE
        }
Exemplo n.º 2
0
        // POST: odata/Robna_kartica
        public async Task <IHttpActionResult> Post(Robna_kartica robna_kartica)
        {
            if (!LoginController.CheckAuthorizationForRequest(Request))
            {
                return(Unauthorized());
            }
            if (!ModelState.IsValid || !robna_kartica.ValidateOcl())
            {
                return(BadRequest(ModelState));
            }

            db.Robna_kartica.Add(robna_kartica);
            await db.SaveChangesAsync();

            return(Created(robna_kartica));
        }
Exemplo n.º 3
0
        // DELETE: odata/Robna_kartica(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] int key)
        {
            if (!LoginController.CheckAuthorizationForRequest(Request))
            {
                return(Unauthorized());
            }
            Robna_kartica robna_kartica = await db.Robna_kartica.FindAsync(key);

            if (robna_kartica == null)
            {
                return(NotFound());
            }

            db.Robna_kartica.Remove(robna_kartica);
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 4
0
        // PUT: odata/Robna_kartica(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <Robna_kartica> patch)
        {
            if (!LoginController.CheckAuthorizationForRequest(Request))
            {
                return(Unauthorized());
            }
            Validate(patch.GetEntity());

            if (!ModelState.IsValid || !patch.GetEntity().ValidateOcl())
            {
                return(BadRequest(ModelState));
            }

            Robna_kartica robna_kartica = await db.Robna_kartica.FindAsync(key);

            if (robna_kartica == null)
            {
                return(NotFound());
            }

            patch.Put(robna_kartica);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Robna_karticaExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(robna_kartica));
        }