public async Task <ActionResult> DeleteConfirmed(int id) { Oda_Personel oda_Personel = await db.Oda_Personel.FindAsync(id); if (oda_Personel.active == (int)EnumHelperData.Satatus.Aktif) { oda_Personel.active = (int)EnumHelperData.Satatus.Pasif; } //db.Oda_Personel.Remove(oda_Personel); await db.SaveChangesAsync(); return(RedirectToAction("RoomPersonnelList", "Home")); }
// GET: Oda_Personel/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Oda_Personel oda_Personel = await db.Oda_Personel.FindAsync(id); if (oda_Personel == null) { return(HttpNotFound()); } return(View(oda_Personel)); }
public async Task <ActionResult> Create([Bind(Include = "id,ref_OdaId,ref_PersonelId,active")] Oda_Personel oda_Personel) { if (ModelState.IsValid) { oda_Personel.active = 1; db.Oda_Personel.Add(oda_Personel); await db.SaveChangesAsync(); return(RedirectToAction("RoomPersonnelList", "Home")); } ViewBag.ref_OdaId = new SelectList(db.Odas, "id", "oda_numara", oda_Personel.ref_OdaId); ViewBag.ref_PersonelId = new SelectList(db.Personels, "id", "adi", oda_Personel.ref_PersonelId); return(View(oda_Personel)); }
// GET: Oda_Personel/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Oda_Personel oda_Personel = await db.Oda_Personel.FindAsync(id); if (oda_Personel == null) { return(HttpNotFound()); } ViewBag.ref_OdaId = new SelectList(db.Odas, "id", "oda_numara", oda_Personel.ref_OdaId); ViewBag.ref_PersonelId = new SelectList(db.Personels, "id", "adi", oda_Personel.ref_PersonelId); return(View(oda_Personel)); }