public void DeleteSertificate(int sertificateNum) { using (db) { Sertificate sert = db.Sertificates .Where(o => o.Id == sertificateNum) .FirstOrDefault(); db.Sertificates.Remove(sert); db.SaveChanges(); } }
public void AddSertificate(int SertNum, Boolean shown) { BDContext db = new BDContext(); using (db) { Sertificate value = new Sertificate(); value.SertificateNumber = SertNum; value.Shown = shown; db.Sertificates.Add(value); db.SaveChanges(); } }