Exemple #1
0
 public static void AddFatura(Fatura fatura)
 {
     using (IzsuDBContext db = new IzsuDBContext())
     {
         db.Fatura.Add(fatura);
         db.SaveChanges();
     }
 }
Exemple #2
0
 public static void AddAbone(Abone abone)
 {
     using (IzsuDBContext db = new IzsuDBContext())
     {
         db.Abone.Add(abone);
         db.SaveChanges();
     }
 }
Exemple #3
0
 public static void DeleteAbone(int no)
 {
     using (IzsuDBContext db = new IzsuDBContext())
     {
         var result = db.Abone.Where(a => a.AboneID == no).FirstOrDefault();
         db.Abone.Remove(result);
         db.SaveChanges();
     }
 }
Exemple #4
0
        public static void UpdateOdenenFatura(int faturaID)
        {
            using (IzsuDBContext db = new IzsuDBContext())
            {
                var result = db.Fatura.Find(faturaID);
                result.Tahsilat = true;

                db.SaveChanges();
            }
        }
Exemple #5
0
 public static void UpdateAbone(Abone abone)
 {
     using (IzsuDBContext db = new IzsuDBContext())
     {
         var result = db.Abone.FirstOrDefault(a => a.AboneID == abone.AboneID);
         result.AboneAdSoyad = abone.AboneAdSoyad;
         result.AboneTuruID  = abone.AboneTuruID;
         db.SaveChanges();
     }
 }
Exemple #6
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            Abone a = new Abone();

            a.AboneNo      = int.Parse(txtAdoneNo.Text);
            a.AboneAdSoyad = txtAdSoyad.Text;

            AboneTuru at = (AboneTuru)cBoxAboneTuru.SelectedItem;

            a.AboneTuruID  = at.AboneTuruID;
            at.AboneTuruAd = "hususi";

            using (IzsuDBContext context = new IzsuDBContext())
            {
                context.Abone.Add(a);
                context.SaveChanges();
            }
        }