public async Task <IHttpActionResult> PutAPP_VI_CONTRIBUTIONS(decimal id, APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != aPP_VI_CONTRIBUTIONS.CONTRIBUTION_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <ActionResult> DeleteConfirmed(decimal id)
        {
            APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS = await db.APP_VI_CONTRIBUTIONS.FindAsync(id);

            db.APP_VI_CONTRIBUTIONS.Remove(aPP_VI_CONTRIBUTIONS);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <IHttpActionResult> GetAPP_VI_CONTRIBUTIONS(decimal id)
        {
            APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS = await db.APP_VI_CONTRIBUTIONS.FindAsync(id);

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

            return(Ok(aPP_VI_CONTRIBUTIONS));
        }
        public async Task <IHttpActionResult> PostAPP_VI_CONTRIBUTIONS(APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.APP_VI_CONTRIBUTIONS.Add(aPP_VI_CONTRIBUTIONS);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = aPP_VI_CONTRIBUTIONS.CONTRIBUTION_ID }, aPP_VI_CONTRIBUTIONS));
        }
        public async Task <ActionResult> Edit([Bind(Include = "CONTRIBUTION_ID,INVESTIGATION_ID,DESCRIPTION,INFORMANT_ID")] APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS)
        {
            if (ModelState.IsValid)
            {
                db.Entry(aPP_VI_CONTRIBUTIONS).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.INFORMANT_ID     = new SelectList(db.APP_VI_INFORMANTS, "INFORMANT_ID", "FIRST_NAME", aPP_VI_CONTRIBUTIONS.INFORMANT_ID);
            ViewBag.INVESTIGATION_ID = new SelectList(db.APP_VI_INVESTIGATIONS, "INVESTIGATION_ID", "NUNC", aPP_VI_CONTRIBUTIONS.INVESTIGATION_ID);
            return(View(aPP_VI_CONTRIBUTIONS));
        }
        public async Task <IHttpActionResult> DeleteAPP_VI_CONTRIBUTIONS(decimal id)
        {
            APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS = await db.APP_VI_CONTRIBUTIONS.FindAsync(id);

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

            db.APP_VI_CONTRIBUTIONS.Remove(aPP_VI_CONTRIBUTIONS);
            await db.SaveChangesAsync();

            return(Ok(aPP_VI_CONTRIBUTIONS));
        }
        // GET: AppContributions/Details/5
        public async Task <ActionResult> Details(decimal id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS = await db.APP_VI_CONTRIBUTIONS.FindAsync(id);

            if (aPP_VI_CONTRIBUTIONS == null)
            {
                return(HttpNotFound());
            }
            return(View(aPP_VI_CONTRIBUTIONS));
        }
        // GET: AppContributions/Edit/5
        public async Task <ActionResult> Edit(decimal id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            APP_VI_CONTRIBUTIONS aPP_VI_CONTRIBUTIONS = await db.APP_VI_CONTRIBUTIONS.FindAsync(id);

            if (aPP_VI_CONTRIBUTIONS == null)
            {
                return(HttpNotFound());
            }
            ViewBag.INFORMANT_ID     = new SelectList(db.APP_VI_INFORMANTS, "INFORMANT_ID", "FIRST_NAME", aPP_VI_CONTRIBUTIONS.INFORMANT_ID);
            ViewBag.INVESTIGATION_ID = new SelectList(db.APP_VI_INVESTIGATIONS, "INVESTIGATION_ID", "NUNC", aPP_VI_CONTRIBUTIONS.INVESTIGATION_ID);
            return(View(aPP_VI_CONTRIBUTIONS));
        }