예제 #1
0
        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"));
        }
예제 #2
0
        // 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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        // 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));
        }