public async Task <bool> RemoveWhereAsync(int changeId, int rowId)
        {
            var rowChange = await RepoDbSet
                            .FirstOrDefaultAsync(change => change.ChangeId == changeId && change.ReceiptRowId == rowId);

            if (rowChange == null)
            {
                return(false);
            }
            RepoDbSet.Remove(rowChange);
            return(true);
        }
        /// <summary>
        /// Removes row if 1)Row is found, 2)UserId matches ManagerId, 3)Receipt is not finalized
        /// </summary>
        /// <param name="rowId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task <bool> RemoveRowAsync(int rowId, int userId)
        {
            var receiptRow = await RepoDbSet
                             .Include(row => row.Receipt)
                             .FirstOrDefaultAsync(row => row.Id == rowId);

            if (receiptRow == null)
            {
                return(false);
            }
            if (receiptRow.Receipt.ReceiptManagerId != userId || receiptRow.Receipt.IsFinalized)
            {
                return(false);
            }
            RepoDbSet.Remove(receiptRow);
            return(true);
        }
Exemple #3
0
 public void RemoveNoReturnAsync(TestTypeMinimal dalTestTypeMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalTestTypeMinimal));
 }
Exemple #4
0
 public void RemoveNoReturnAsync(ComponentMinimal dalComponentMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalComponentMinimal));
 }
Exemple #5
0
 public void RemoveNoReturnAsync(UnitOfMeasureMinimal dalUnitOfMeasureMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalUnitOfMeasureMinimal));
 }
 public void RemoveNoReturnAsync(SpecificationMinimal dalSpecificationMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalSpecificationMinimal));
 }
Exemple #7
0
 public void RemoveNoReturnAsync(ManufacturerMinimal dalManufacturerMinimal)
 {
     RepoDbSet.Remove(_mapper.MapToDomain(dalManufacturerMinimal));
 }