public async Task <ActionResult> Create([Bind(Include = "id,fakulteAdi")] Fakulte fakulte)
        {
            if (ModelState.IsValid)
            {
                fakulte.active = 1;
                db.Fakultes.Add(fakulte);
                await db.SaveChangesAsync();

                return(RedirectToAction("FacultyList", "Home"));
            }

            return(View(fakulte));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,oda_numara,kat,active")] Oda oda)
        {
            if (ModelState.IsValid)
            {
                oda.active = 1;
                db.Odas.Add(oda);
                await db.SaveChangesAsync();

                return(RedirectToAction("RoomList", "Home"));
            }

            return(View(oda));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,adi,adres,telefon,email")] Okul okul)
        {
            if (ModelState.IsValid)
            {
                okul.active = 1;
                db.Okuls.Add(okul);
                await db.SaveChangesAsync();

                return(RedirectToAction("SchoolList", "Home"));
            }

            return(View(okul));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,adi,sifre,email,telefon,ref_Personel,active")] Kullanici kullanici)
        {
            if (ModelState.IsValid)
            {
                kullanici.active = 1;
                db.Kullanicis.Add(kullanici);
                await db.SaveChangesAsync();

                return(RedirectToAction("UserList", "Home"));
            }

            ViewBag.ref_Personel = new SelectList(db.Personels, "id", "adi", kullanici.ref_Personel);
            return(View(kullanici));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,adi,ref_Fakulte")] Bolum bolum)
        {
            if (ModelState.IsValid)
            {
                bolum.active = 1;
                db.Bolums.Add(bolum);
                await db.SaveChangesAsync();

                return(RedirectToAction("DepartmentList", "Home"));
            }

            ViewBag.ref_Fakulte = new SelectList(db.Fakultes, "id", "fakulteAdi", bolum.ref_Fakulte);
            return(View(bolum));
        }
Ejemplo n.º 6
0
        public async Task <ActionResult> Create([Bind(Include = "id,ders_adi,ders_referans,kredi,ref_bolum")] Der der)
        {
            if (ModelState.IsValid)
            {
                der.active = 1;
                db.Ders.Add(der);
                await db.SaveChangesAsync();

                return(RedirectToAction("LectureList", "Home"));
            }

            ViewBag.ref_bolum = new SelectList(db.Bolums, "id", "adi", der.ref_bolum);
            return(View(der));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,ref_ders,ref_personel,durum,puan,active")] Sinavlar sinavlar)
        {
            if (ModelState.IsValid)
            {
                sinavlar.active = 1;
                db.Sinavlars.Add(sinavlar);
                await db.SaveChangesAsync();

                return(RedirectToAction("ExamList", "Home"));
            }

            ViewBag.ref_ders     = new SelectList(db.Ders, "id", "ders_adi", sinavlar.ref_ders);
            ViewBag.ref_personel = new SelectList(db.Personels, "id", "adi", sinavlar.ref_personel);
            return(View(sinavlar));
        }
Ejemplo n.º 8
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));
        }
Ejemplo n.º 9
0
        public async Task <ActionResult> Create([Bind(Include = "id,Kullanici_ref,Rol_ref,active")] Kullanici_Roller kullanici_Roller)
        {
            if (ModelState.IsValid)
            {
                kullanici_Roller.active = 1;
                db.Kullanici_Roller.Add(kullanici_Roller);
                await db.SaveChangesAsync();

                return(RedirectToAction("UserTaskList", "Home"));
            }

            ViewBag.Kullanici_ref = new SelectList(db.Kullanicis, "id", "adi", kullanici_Roller.Kullanici_ref);
            ViewBag.Rol_ref       = new SelectList(db.Rols, "id", "adi", kullanici_Roller.Rol_ref);
            return(View(kullanici_Roller));
        }
Ejemplo n.º 10
0
        public async Task <ActionResult> Create([Bind(Include = "id,adi,soyad,yas,mezun_tarih,sinif,ref_bolum,ref_okul,active")] Personel personel)
        {
            if (ModelState.IsValid)
            {
                personel.active = 1;
                db.Personels.Add(personel);
                await db.SaveChangesAsync();

                return(RedirectToAction("PersonnelList", "Home"));
            }

            ViewBag.ref_bolum = new SelectList(db.Bolums, "id", "adi", personel.ref_bolum);
            ViewBag.ref_okul  = new SelectList(db.Okuls, "id", "adi", personel.ref_okul);
            return(View(personel));
        }
        public async Task <ActionResult> Create([Bind(Include = "id,ref_DersId,ref_OdId,active")] Oda_Dersleri oda_Dersleri)
        {
            if (ModelState.IsValid)
            {
                oda_Dersleri.active = 1;
                db.Oda_Dersleri.Add(oda_Dersleri);
                await db.SaveChangesAsync();

                return(RedirectToAction("RoomLectureList", "Home"));
            }

            ViewBag.ref_DersId = new SelectList(db.Ders, "id", "ders_adi", oda_Dersleri.ref_DersId);
            ViewBag.ref_OdId   = new SelectList(db.Odas, "id", "oda_numara", oda_Dersleri.ref_OdId);
            return(View(oda_Dersleri));
        }
        public async Task<ActionResult> Register([Bind(Include = "id,username,password,confirmpassword")] RegisterViewModel model)
        {

            if (ModelState.IsValid)
            {
                Login lgn = new Login()
                {
                    email = "",
                    name = "",
                    password = model.Password,
                    username = model.Username
                };
                databaseManager.Logins.Add(lgn);
                await databaseManager.SaveChangesAsync();
                return RedirectToAction("Index", "Home");

            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }