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