示例#1
0
        public async Task AddNewQuailReminding(int userId, FormCollection collection)
        {
            var reminding = new BreedingReminder
            {
                User         = _usersRepository.Get().FirstOrDefault(i => i.Id == userId),
                BreedingType = _breedingTypeRepository.Get().FirstOrDefault(i => i.Name == "Quail"),
                AnimalName   = collection[1],
                Text         = collection[2],
                RemindDate   = DateTime.Parse(collection[3]),
                RemindDays   = Convert.ToInt32(collection[4])
            };

            await _breedingRemindingRepository.AddAsync(reminding);
        }
        public async Task AddNewPinscherdogReminding(int userId, FormCollection collection)
        {
            var reminding = new BreedingReminder
            {
                User = _usersRepository.Get().FirstOrDefault(i => i.Id == userId),
                BreedingType = _breedingTypeRepository.Get().FirstOrDefault(i => i.Name == "Pinscherdog"),
                AnimalName = collection[1],
                Text = collection[2],
                RemindDate = DateTime.Parse(collection[3]),
                RemindDays = Convert.ToInt32(collection[4])
            };

            await _breedingRemindingRepository.AddAsync(reminding);
        }