Esempio n. 1
0
        public async Task <(DailyExtractLot, bool)> CreateNewDailyExtractLot(string name, Guid managementCategoryId, int headsAmount)
        {
            var isNewDailyExtractLot = false;

            DailyExtractLot dailyExtractLot = null;

            dailyExtractLot = await _dailyExtractLotRepository.GetDailyExtractLotByManagementCategoryId(managementCategoryId);

            if (dailyExtractLot != null)
            {
                dailyExtractLot.IncreateHeadsAmount(headsAmount);
                _dailyExtractLotRepository.Update(dailyExtractLot);
            }
            else
            {
                dailyExtractLot = new DailyExtractLot(name, managementCategoryId, headsAmount);
                _dailyExtractLotRepository.Add(dailyExtractLot);
                isNewDailyExtractLot = true;
            }

            return(dailyExtractLot, isNewDailyExtractLot);
        }
Esempio n. 2
0
 public void Update(DailyExtractLot dailyExtractLot)
 {
     DbSet.Update(dailyExtractLot);
 }
Esempio n. 3
0
 public void Add(DailyExtractLot dailyExtractLot)
 {
     DbSet.Add(dailyExtractLot);
 }