public ActionResult Create([Bind(Include = "UrunId,Adi,Marka,KategoriID,Fiyat,Aciklama,Resim,SatildiMi")] Tbl_Urun tbl_Urun)
        {
            if (ModelState.IsValid)
            {
                db.Tbl_Urun.Add(tbl_Urun);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.KategoriID = new SelectList(db.Tbl_Kategori, "KategoriId", "Adi", tbl_Urun.KategoriID);
            return(View(tbl_Urun));
        }
        public ActionResult UrunEkle(Tbl_Urun urun, HttpPostedFileBase file)
        {
            if (file != null)
            {
                string pic  = System.IO.Path.GetFileName(file.FileName);
                string path = System.IO.Path.Combine(
                    Server.MapPath("~/Resimler"), pic);
                file.SaveAs(path);
                urun.Resim = pic;
            }
            var KullaniciID = k.KullaniciIdGetir(User.Identity.Name);

            urun.KullaniciID = Convert.ToInt16(KullaniciID[0]);
            urun.SatildiMi   = false;
            db.Tbl_Urun.Add(urun);
            db.SaveChanges();
            return(RedirectToAction("Anasayfa", "Home"));
        }
 public ActionResult KullaniciEkle(Tbl_Kullanici kullanici)
 {
     db.Tbl_Kullanici.Add(kullanici);
     db.SaveChanges();
     return(RedirectToAction("Login", "Security"));
 }