Esempio n. 1
0
        public void SetWeight(int weight, string userName)
        {
            var user = (from u in _repo.GetUserByUserName(userName) select u).FirstOrDefault();

            user.Weight = weight;
            _repo.Edit(user);
        }
Esempio n. 2
0
        //Add to Income
        public void EditIncome(decimal amount, string user)
        {
            var thisUser = _repo.GetUserByUserName(user);

            thisUser.MonthlyIncome      += amount;
            thisUser.MonthlyIncomeFixed += amount;
            _repo.Update(thisUser);
        }
Esempio n. 3
0
        //Add
        public void Add(string userId, string volume, int alcId)
        {
            var stringVol = volume.Split(' ').ToList();


            var glass = new Glass
            {
                Volume       = Double.Parse(stringVol[0]),
                TimeConsumed = DateTime.Now,
                Alcohol      = _AlcRepo.GetById(alcId).FirstOrDefault(),
                AppUser      = _AppUserRepo.GetUserByUserName(userId).FirstOrDefault(),
                IsFavorite   = false
            };

            _repo.Add(glass);
        }