Example #1
0
        public void DeleteSertificate(int sertificateNum)
        {
            using (db)
            {
                Sertificate sert = db.Sertificates
                                   .Where(o => o.Id == sertificateNum)
                                   .FirstOrDefault();

                db.Sertificates.Remove(sert);
                db.SaveChanges();
            }
        }
Example #2
0
        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();
            }
        }