Ejemplo n.º 1
0
 public void removeStudent(string indexNumber)
 {
     using (var db = new s18838Context())
     {
         var student = db.Student.Where(s => s.IndexNumber == indexNumber).SingleOrDefault();
         db.Student.Remove(student);
         db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void DeleteRefreshToken(string refreshToken)
 {
     using (var db = new s18838Context())
     {
         var token = db.Token
                     .Where(t => t.RefreshToken == refreshToken)
                     .SingleOrDefault();
         db.Token.Remove(token);
         db.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public void SaveRefreshToken(string refreshToken, string indexNumber)
 {
     using (var db = new s18838Context())
     {
         var token = new Token
         {
             IndexNumber  = indexNumber,
             RefreshToken = refreshToken
         };
         db.Token.Add(token);
         db.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public void modifyStudent(string indexNumber, Student student)
 {
     using (var db = new s18838Context())
     {
         var s = db.Student.Where(s => s.IndexNumber == indexNumber).SingleOrDefault();
         s.IndexNumber  = student.IndexNumber;
         s.FirstName    = student.FirstName;
         s.BirthDate    = student.BirthDate;
         s.IdEnrollment = student.IdEnrollment;
         s.Salt         = student.Salt;
         s.Password     = student.Password;
         db.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 private void SaveEnrollment(s18838Context db, Enrollment enrollment)
 {
     db.Enrollment.Add(enrollment);
     db.SaveChanges();
 }
Ejemplo n.º 6
0
 private void SaveStudent(s18838Context db, Student student)
 {
     db.Student.Add(student);
     db.SaveChanges();
 }