public void AplicationAction(int ApplicationId, bool IsAccepted)
 {
     using (var context = new DonationsDataDataContext(_ConnectionString))
     {
         context.Applications.FirstOrDefault(a => a.Id == ApplicationId).Approved = IsAccepted;
         context.SubmitChanges();
     }
 }
 public void Add(Application application)
 {
     application.Date = DateTime.Now;
     using (var context = new DonationsDataDataContext(_ConnectionString))
     {
         context.Applications.InsertOnSubmit(application);
         context.SubmitChanges();
     }
 }
Пример #3
0
 public void Add(User user, string password)
 {
     user.Salt         = PasswordHelper.GenerateSalt();
     user.PasswordHash = PasswordHelper.HashPassword(password, user.Salt);
     using (var context = new DonationsDataDataContext(_ConnectionString))
     {
         context.Users.InsertOnSubmit(user);
         context.SubmitChanges();
     }
 }