protected void Button1_Click(object sender, EventArgs e)
        {
            Tbl_Musteri t = new Tbl_Musteri();

            t.MUSTERIAD    = TextBox1.Text;
            t.MUSTERISOYAD = TextBox2.Text;
            db.Tbl_Musteri.Add(t);
            db.SaveChanges();
            Response.Redirect("Musteriler.aspx");
        }
        public ActionResult MusteriGuncelle(Tbl_Musteri k)
        {
            var mst = db.Tbl_Musteri.Find(k.id);

            mst.ad     = k.ad;
            mst.soyad  = k.soyad;
            mst.sehir  = k.sehir;
            mst.bakiye = k.bakiye;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult YeniMusteri(Tbl_Musteri p)
 {
     if (!ModelState.IsValid)
     {
         return(View("YeniMusteri"));
     }
     db.Tbl_Musteri.Add(p);
     p.durum = true;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Esempio n. 4
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Page.IsPostBack == false)
     {//BURADA HATA VAR DÜZELT!!!
         Tbl_Musteri t = new Tbl_Musteri();
         t.MUSTERIAD    = TextBox1.Text;
         t.MUSTERISOYAD = TextBox2.Text;
         db.Tbl_Musteri.Add(t);
         db.SaveChanges();
         Response.Redirect("Musterıler.aspx");
     }
 }
Esempio n. 5
0
 public ActionResult YeniMusteri(Tbl_Musteri t1)
 {
     db.Tbl_Musteri.Add(t1);
     db.SaveChanges();
     return(View());
 }