예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            NTCWorkers nTCWorkers = await db.NTCWorkers.FindAsync(id);

            db.NTCWorkers.Remove(nTCWorkers);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "id_NTCworker,name_NTCworker,phone_number_NTCworker," +
                                                              "email_NTCworker,skype_NTCworker,experience,salary")] NTCWorkers nTCWorkers)
        {
            if (ModelState.IsValid)
            {
                db.Entry(nTCWorkers).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(nTCWorkers));
        }
예제 #3
0
        //Action-и для видалення
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NTCWorkers nTCWorkers = await db.NTCWorkers.FindAsync(id);

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