public ActionResult DeleteConfirmed(int id)
        {
            StoktakiEnvanterSayisi stoktakiEnvanterSayisi = db.StoktakiEnvanterSayisi.Find(id);

            db.StoktakiEnvanterSayisi.Remove(stoktakiEnvanterSayisi);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,EnvanterAdi,EnvanterSayisi")] StoktakiEnvanterSayisi stoktakiEnvanterSayisi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stoktakiEnvanterSayisi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(stoktakiEnvanterSayisi));
 }
        public ActionResult Create([Bind(Include = "ID,EnvanterAdi,EnvanterSayisi")] StoktakiEnvanterSayisi stoktakiEnvanterSayisi)
        {
            if (ModelState.IsValid)
            {
                db.StoktakiEnvanterSayisi.Add(stoktakiEnvanterSayisi);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(stoktakiEnvanterSayisi));
        }
        // GET: StoktakiEnvanterSayisi/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StoktakiEnvanterSayisi stoktakiEnvanterSayisi = db.StoktakiEnvanterSayisi.Find(id);

            if (stoktakiEnvanterSayisi == null)
            {
                return(HttpNotFound());
            }
            return(View(stoktakiEnvanterSayisi));
        }
        // GET: PersoneleKayitliEnvant*er/Create
        public ActionResult Create(int?id)
        {
            List <StoktakiEnvanterSayisi> stoktakiEnvanter = new List <StoktakiEnvanterSayisi>();

            string cs = ConfigurationManager.ConnectionStrings["OtokarContext"].ConnectionString;

            using (SqlConnection con = new SqlConnection(cs))
            {
                SqlCommand cmd = new SqlCommand("Select * from StoktakiEnvanterSayisi", con);
                con.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StoktakiEnvanterSayisi d1 = new StoktakiEnvanterSayisi();
                    d1.EnvanterAdi = rdr["EnvanterAdi"].ToString();
                    stoktakiEnvanter.Add(d1);
                }

                con.Close();
            }

            SelectList list = new SelectList(stoktakiEnvanter, "EnvanterAdi", "EnvanterAdi");

            ViewBag.DropdownListFor = list;


            List <Personel> personel = new List <Personel>();

            string cs1 = ConfigurationManager.ConnectionStrings["OtokarContext"].ConnectionString;

            using (SqlConnection con1 = new SqlConnection(cs1))
            {
                SqlCommand cmd1 = new SqlCommand("Select * from Personel", con1);
                con1.Open();
                SqlDataReader rdr1 = cmd1.ExecuteReader();
                while (rdr1.Read())
                {
                    Personel p1 = new Personel();
                    if (id.ToString() == rdr1["PersonelSicilNo"].ToString())
                    {
                        p1.PersonelAdi = rdr1["PersonelAdi"].ToString();
                        personel.Add(p1);
                    }
                }

                con1.Close();
            }

            SelectList list1 = new SelectList(personel, "PersonelAdi", "PersonelAdi");

            ViewBag.DropdownListFor1 = list1;

            List <Personel> personel2 = new List <Personel>();

            string cs2 = ConfigurationManager.ConnectionStrings["OtokarContext"].ConnectionString;

            using (SqlConnection con2 = new SqlConnection(cs2))
            {
                SqlCommand cmd2 = new SqlCommand("Select * from Personel", con2);
                con2.Open();
                SqlDataReader rdr2 = cmd2.ExecuteReader();
                while (rdr2.Read())
                {
                    Personel p2 = new Personel();
                    if (id.ToString() == rdr2["PersonelSicilNo"].ToString())
                    {
                        p2.PersonelSoyAdi = rdr2["PersonelSoyAdi"].ToString();
                        personel2.Add(p2);
                    }
                }

                con2.Close();
            }

            SelectList list2 = new SelectList(personel2, "PersonelSoyAdi", "PersonelSoyAdi");

            ViewBag.DropdownListFor2 = list2;

            return(View());
        }