Beispiel #1
0
        public async Task <IHttpActionResult> PutWeb_Tipo_Novedad(long id, Web_Tipo_Novedad web_Tipo_Novedad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != web_Tipo_Novedad.tipo_novedad_id)
            {
                return(BadRequest());
            }

            db.Entry(web_Tipo_Novedad).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public async Task <ActionResult> DeleteConfirmed(long id)
        {
            Web_Tipo_Novedad web_Tipo_Novedad = await db.Web_Tipo_Novedad.FindAsync(id);

            db.Web_Tipo_Novedad.Remove(web_Tipo_Novedad);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public async Task <IHttpActionResult> GetWeb_Tipo_Novedad(long id)
        {
            Web_Tipo_Novedad web_Tipo_Novedad = await db.Web_Tipo_Novedad.FindAsync(id);

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

            return(Ok(web_Tipo_Novedad));
        }
Beispiel #4
0
        public async Task <ActionResult> Edit([Bind(Include = "tipo_novedad_id,nombre,descripcion,FK_tipo_novedad_estado_rips,fecha_modificacion")] Web_Tipo_Novedad web_Tipo_Novedad)
        {
            if (ModelState.IsValid)
            {
                db.Entry(web_Tipo_Novedad).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.FK_tipo_novedad_estado_rips = new SelectList(db.Estado_RIPS, "estado_rips_id", "tipo", web_Tipo_Novedad.FK_tipo_novedad_estado_rips);
            return(View(web_Tipo_Novedad));
        }
Beispiel #5
0
        public async Task <IHttpActionResult> PostWeb_Tipo_Novedad(Web_Tipo_Novedad web_Tipo_Novedad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Web_Tipo_Novedad.Add(web_Tipo_Novedad);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = web_Tipo_Novedad.tipo_novedad_id }, web_Tipo_Novedad));
        }
Beispiel #6
0
        // GET: Web_Tipo_Novedad/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Web_Tipo_Novedad web_Tipo_Novedad = await db.Web_Tipo_Novedad.FindAsync(id);

            if (web_Tipo_Novedad == null)
            {
                return(HttpNotFound());
            }
            return(View(web_Tipo_Novedad));
        }
Beispiel #7
0
        public async Task <IHttpActionResult> DeleteWeb_Tipo_Novedad(long id)
        {
            Web_Tipo_Novedad web_Tipo_Novedad = await db.Web_Tipo_Novedad.FindAsync(id);

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

            db.Web_Tipo_Novedad.Remove(web_Tipo_Novedad);
            await db.SaveChangesAsync();

            return(Ok(web_Tipo_Novedad));
        }
Beispiel #8
0
        // GET: Web_Tipo_Novedad/Edit/5
        public async Task <ActionResult> Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Web_Tipo_Novedad web_Tipo_Novedad = await db.Web_Tipo_Novedad.FindAsync(id);

            if (web_Tipo_Novedad == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FK_tipo_novedad_estado_rips = new SelectList(db.Estado_RIPS, "estado_rips_id", "tipo", web_Tipo_Novedad.FK_tipo_novedad_estado_rips);
            return(View(web_Tipo_Novedad));
        }