public ActionResult Create([Bind(Include = "DepartmanID,DepartmanAd")] tblDepartman tblDepartman)
        {
            if (ModelState.IsValid)
            {
                db.tblDepartman.Add(tblDepartman);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblDepartman));
        }
Exemple #2
0
        public ActionResult Create([Bind(Include = "CalisanID,Ad,Soyad,Telefon,Departman,Yonetici")] tblCalisan tblCalisan)
        {
            if (ModelState.IsValid)
            {
                db.tblCalisan.Add(tblCalisan);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Yonetici  = new SelectList(db.tblCalisan, "CalisanID", "Ad", tblCalisan.Yonetici);
            ViewBag.Departman = new SelectList(db.tblDepartman, "DepartmanID", "DepartmanAd", tblCalisan.Departman);
            return(View(tblCalisan));
        }
 public ActionResult Edit([Bind(Include = "ID,KullaniciAd,Sifre")] tblAdmin tblAdmin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblAdmin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblAdmin));
 }