コード例 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Work_ExploitationModel work_ExploitationModel = await db.Work_ExploitationModel.FindAsync(id);

            db.Work_ExploitationModel.Remove(work_ExploitationModel);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "SexWorkExploitationId,SexWorkExploitation")] Work_ExploitationModel work_ExploitationModel)
        {
            if (ModelState.IsValid)
            {
                db.Entry(work_ExploitationModel).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(work_ExploitationModel));
        }
コード例 #3
0
        public async Task <ActionResult> Create([Bind(Include = "SexWorkExploitationId,SexWorkExploitation")] Work_ExploitationModel work_ExploitationModel)
        {
            if (ModelState.IsValid)
            {
                db.Work_ExploitationModel.Add(work_ExploitationModel);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(work_ExploitationModel));
        }
コード例 #4
0
        // GET: Work_ExploitationModel/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Work_ExploitationModel work_ExploitationModel = await db.Work_ExploitationModel.FindAsync(id);

            if (work_ExploitationModel == null)
            {
                return(HttpNotFound());
            }
            return(View(work_ExploitationModel));
        }