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

            if (id != web_Correo_Sin_Restriccion.correo_sin_restriccion_id)
            {
                return(BadRequest());
            }

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

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

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

            db.Web_Correo_Sin_Restriccion.Remove(web_Correo_Sin_Restriccion);
            await db.SaveChangesAsync();

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

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

            return(Ok(web_Correo_Sin_Restriccion));
        }
Beispiel #4
0
        public async Task <ActionResult> Edit([Bind(Include = "correo_sin_restriccion_id,correo,FK_correo_sin_restriccion_estado_rips,fecha_modificacion")] Web_Correo_Sin_Restriccion web_Correo_Sin_Restriccion)
        {
            if (ModelState.IsValid)
            {
                db.Entry(web_Correo_Sin_Restriccion).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.FK_correo_sin_restriccion_estado_rips = new SelectList(db.Estado_RIPS, "estado_rips_id", "tipo", web_Correo_Sin_Restriccion.FK_correo_sin_restriccion_estado_rips);
            return(View(web_Correo_Sin_Restriccion));
        }
Beispiel #5
0
        // GET: Web_Correo_Sin_Restriccion/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Web_Correo_Sin_Restriccion web_Correo_Sin_Restriccion = await db.Web_Correo_Sin_Restriccion.FindAsync(id);

            if (web_Correo_Sin_Restriccion == null)
            {
                return(HttpNotFound());
            }
            return(View(web_Correo_Sin_Restriccion));
        }
Beispiel #6
0
        public async Task <IHttpActionResult> DeleteWeb_Correo_Sin_Restriccion(long id)
        {
            Web_Correo_Sin_Restriccion web_Correo_Sin_Restriccion = await db.Web_Correo_Sin_Restriccion.FindAsync(id);

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

            db.Web_Correo_Sin_Restriccion.Remove(web_Correo_Sin_Restriccion);
            await db.SaveChangesAsync();

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

            if (web_Correo_Sin_Restriccion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FK_correo_sin_restriccion_estado_rips = new SelectList(db.Estado_RIPS, "estado_rips_id", "tipo", web_Correo_Sin_Restriccion.FK_correo_sin_restriccion_estado_rips);
            return(View(web_Correo_Sin_Restriccion));
        }
Beispiel #8
0
        public async Task <IHttpActionResult> PostWeb_Correo_Sin_Restriccion(Web_Correo_Sin_Restriccion web_Correo_Sin_Restriccion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Web_Correo_Sin_Restriccion csrtbl = new Web_Correo_Sin_Restriccion();    // make object of table

            csrtbl.correo_sin_restriccion_id = web_Correo_Sin_Restriccion.correo_sin_restriccion_id;
            csrtbl.correo = web_Correo_Sin_Restriccion.correo;
            csrtbl.FK_correo_sin_restriccion_estado_rips = web_Correo_Sin_Restriccion.correo_sin_restriccion_id;
            csrtbl.fecha_modificacion = web_Correo_Sin_Restriccion.fecha_modificacion;
            db.Web_Correo_Sin_Restriccion.Add(csrtbl);

            //db.Web_Correo_Sin_Restriccion.Add(web_Correo_Sin_Restriccion.correo_sin_restriccion_id,web_Correo_Sin_Restriccion.correo,web_Correo_Sin_Restriccion.fecha_modificacion,1);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = web_Correo_Sin_Restriccion.correo_sin_restriccion_id }, web_Correo_Sin_Restriccion));
        }