Exemple #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);
        }
Exemple #2
0
 public void Update(DailyExtractLot dailyExtractLot)
 {
     DbSet.Update(dailyExtractLot);
 }
Exemple #3
0
 public void Add(DailyExtractLot dailyExtractLot)
 {
     DbSet.Add(dailyExtractLot);
 }