Ejemplo n.º 1
0
        public static void silMusteri(int id)
        {
            Proje.DataAccess.otoservisdbEntities db = new Proje.DataAccess.otoservisdbEntities();
            using (db)
            {
                List <int> query1 = (from arac in db.aracs
                                     where arac.musteriID == id
                                     select arac.aracID).ToList();

                if (query1.Count == 0)
                {
                    musteri m = new musteri();
                    var     x = db.musteris.Find(id);
                    db.musteris.Remove(x);
                    db.SaveChanges();
                }

                else if (query1.Count != 0)
                {
                    int count1 = query1.Count;

                    for (int i = 0; i < count1; i++)
                    {
                        //arackayit.silAracKayit(query1[i]);
                    }

                    var x = db.musteris.Find(id);
                    db.musteris.Remove(x);
                    db.SaveChanges();
                }
            }
        }
Ejemplo n.º 2
0
        public static void guncelleMusteri(int id, string tc, string ad)
        {
            Proje.DataAccess.otoservisdbEntities db = new Proje.DataAccess.otoservisdbEntities();
            using (db)
            {
                var x = db.musteris.Find(id);

                x.tckn    = tc;
                x.adSoyad = ad;
                db.SaveChanges();
            }
        }
Ejemplo n.º 3
0
 public static void AddMusteri(string tc, string ad)
 {
     Proje.DataAccess.otoservisdbEntities db = new Proje.DataAccess.otoservisdbEntities();
     using (db)
     {
         musteri m = new musteri();
         //m.musteriID = id;
         m.tckn    = tc;
         m.adSoyad = ad;
         db.musteris.Add(m);
         db.SaveChanges();
     }
 }