示例#1
0
 private void addUser()
 {
     Benefit b = new Benefit();
     b.has401k = 0;
     b.hasBenefits = 0;
     b.hasHealthcare = 0;
     b.user = "******";
     _db.Benefits.Add(b);
     _db.SaveChanges();
 }
示例#2
0
        public void findUser(string user)
        {
            if (currentUserBenefits != null && currentUserBenefits.user.Equals(user)) return;

            var person = from p in _db.Benefits
                         where p.user == user
                select p;
            if (person.Count() == 0)
            {
                errorMessage = user + " was not found in the database";
                return;
            }
            else if (person.Count() > 1)
            {
                errorMessage = "Multiple records found in database for user " + user;
                return;
            }
            errorMessage = null;
            currentUserBenefits = person.First();
            RaisePropertyChanged(String.Empty);
        }